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..bb359038bf85 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/__init__.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/__init__.py
@@ -17,9 +17,8 @@
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
-
__all__ = [
- "SecurityInsights",
+ 'SecurityInsights',
]
__all__.extend([p for p in _patch_all if p not in __all__])
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..67e97051c24f 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,19 @@
# 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,name-too-long
"""Configuration for SecurityInsights.
Note that all parameters used to create this instance are saved as instance
@@ -33,16 +26,20 @@ 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
+ :keyword api_version: Api Version. Default value is "2024-04-01-preview". 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")
+ def __init__(
+ self,
+ credential: "TokenCredential",
+ subscription_id: str,
+ **kwargs: Any
+ ) -> None:
+ api_version: str = kwargs.pop('api_version', "2024-04-01-preview")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@@ -52,21 +49,24 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
self.credential = credential
self.subscription_id = subscription_id
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.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:
- self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
- self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
- 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.authentication_policy = kwargs.get("authentication_policy")
+
+ def _configure(
+ self,
+ **kwargs: Any
+ ) -> None:
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ 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.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(
- self.credential, *self.credential_scopes, **kwargs
- )
+ self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
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..129495169edb 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,60 +8,23 @@
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
from ._serialization import Deserializer, Serializer
-from .operations import (
- ActionsOperations,
- AlertRuleTemplatesOperations,
- AlertRulesOperations,
- AutomationRulesOperations,
- BookmarkOperations,
- BookmarkRelationsOperations,
- BookmarksOperations,
- DataConnectorsCheckRequirementsOperations,
- DataConnectorsOperations,
- DomainWhoisOperations,
- EntitiesGetTimelineOperations,
- EntitiesOperations,
- EntitiesRelationsOperations,
- EntityQueriesOperations,
- EntityQueryTemplatesOperations,
- EntityRelationsOperations,
- FileImportsOperations,
- GetOperations,
- GetRecommendationsOperations,
- IPGeodataOperations,
- IncidentCommentsOperations,
- IncidentRelationsOperations,
- IncidentTasksOperations,
- IncidentsOperations,
- MetadataOperations,
- OfficeConsentsOperations,
- Operations,
- ProductSettingsOperations,
- SecurityMLAnalyticsSettingsOperations,
- SentinelOnboardingStatesOperations,
- SourceControlOperations,
- SourceControlsOperations,
- ThreatIntelligenceIndicatorMetricsOperations,
- ThreatIntelligenceIndicatorOperations,
- ThreatIntelligenceIndicatorsOperations,
- UpdateOperations,
- WatchlistItemsOperations,
- WatchlistsOperations,
-)
+from .operations import ActionsOperations, AlertRuleOperations, AlertRuleTemplatesOperations, AlertRulesOperations, AutomationRulesOperations, BillingStatisticsOperations, BookmarkOperations, BookmarkRelationsOperations, BookmarksOperations, BusinessApplicationAgentOperations, BusinessApplicationAgentsOperations, ContentPackageOperations, ContentPackagesOperations, ContentTemplateOperations, ContentTemplatesOperations, DataConnectorDefinitionsOperations, DataConnectorsCheckRequirementsOperations, DataConnectorsOperations, EntitiesGetTimelineOperations, EntitiesOperations, EntitiesRelationsOperations, EntityQueriesOperations, EntityQueryTemplatesOperations, EntityRelationsOperations, FileImportsOperations, GetOperations, GetRecommendationsOperations, GetTriggeredAnalyticsRuleRunsOperations, HuntCommentsOperations, HuntRelationsOperations, HuntsOperations, IncidentCommentsOperations, IncidentRelationsOperations, IncidentTasksOperations, IncidentsOperations, MetadataOperations, OfficeConsentsOperations, Operations, ProductPackageOperations, ProductPackagesOperations, ProductSettingsOperations, ProductTemplateOperations, ProductTemplatesOperations, ReevaluateOperations, SecurityInsightsOperationsMixin, SecurityMLAnalyticsSettingsOperations, SentinelOnboardingStatesOperations, SourceControlOperations, SourceControlsOperations, SystemsOperations, ThreatIntelligenceIndicatorMetricsOperations, ThreatIntelligenceIndicatorOperations, ThreatIntelligenceIndicatorsOperations, ThreatIntelligenceOperations, TriggeredAnalyticsRuleRunOperations, UpdateOperations, WatchlistItemsOperations, WatchlistsOperations, WorkspaceManagerAssignmentJobsOperations, WorkspaceManagerAssignmentsOperations, WorkspaceManagerConfigurationsOperations, WorkspaceManagerGroupsOperations, WorkspaceManagerMembersOperations
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(SecurityInsightsOperationsMixin): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider.
:ivar alert_rules: AlertRulesOperations operations
@@ -73,20 +36,42 @@ 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 billing_statistics: BillingStatisticsOperations operations
+ :vartype billing_statistics: azure.mgmt.securityinsight.operations.BillingStatisticsOperations
: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 business_application_agents: BusinessApplicationAgentsOperations operations
+ :vartype business_application_agents:
+ azure.mgmt.securityinsight.operations.BusinessApplicationAgentsOperations
+ :ivar business_application_agent: BusinessApplicationAgentOperations operations
+ :vartype business_application_agent:
+ azure.mgmt.securityinsight.operations.BusinessApplicationAgentOperations
+ :ivar systems: SystemsOperations operations
+ :vartype systems: azure.mgmt.securityinsight.operations.SystemsOperations
+ :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 entities_get_timeline: EntitiesGetTimelineOperations operations
:vartype entities_get_timeline:
azure.mgmt.securityinsight.operations.EntitiesGetTimelineOperations
@@ -101,6 +86,12 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
azure.mgmt.securityinsight.operations.EntityQueryTemplatesOperations
:ivar file_imports: FileImportsOperations operations
:vartype file_imports: azure.mgmt.securityinsight.operations.FileImportsOperations
+ :ivar hunts: HuntsOperations operations
+ :vartype hunts: azure.mgmt.securityinsight.operations.HuntsOperations
+ :ivar hunt_relations: HuntRelationsOperations operations
+ :vartype hunt_relations: azure.mgmt.securityinsight.operations.HuntRelationsOperations
+ :ivar hunt_comments: HuntCommentsOperations operations
+ :vartype hunt_comments: azure.mgmt.securityinsight.operations.HuntCommentsOperations
:ivar incident_comments: IncidentCommentsOperations operations
:vartype incident_comments: azure.mgmt.securityinsight.operations.IncidentCommentsOperations
:ivar incident_relations: IncidentRelationsOperations operations
@@ -121,6 +112,8 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
:vartype get: azure.mgmt.securityinsight.operations.GetOperations
:ivar update: UpdateOperations operations
:vartype update: azure.mgmt.securityinsight.operations.UpdateOperations
+ :ivar reevaluate: ReevaluateOperations operations
+ :vartype reevaluate: azure.mgmt.securityinsight.operations.ReevaluateOperations
:ivar security_ml_analytics_settings: SecurityMLAnalyticsSettingsOperations operations
:vartype security_ml_analytics_settings:
azure.mgmt.securityinsight.operations.SecurityMLAnalyticsSettingsOperations
@@ -140,10 +133,39 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
operations
:vartype threat_intelligence_indicator_metrics:
azure.mgmt.securityinsight.operations.ThreatIntelligenceIndicatorMetricsOperations
+ :ivar threat_intelligence: ThreatIntelligenceOperations operations
+ :vartype threat_intelligence:
+ azure.mgmt.securityinsight.operations.ThreatIntelligenceOperations
+ :ivar triggered_analytics_rule_run: TriggeredAnalyticsRuleRunOperations operations
+ :vartype triggered_analytics_rule_run:
+ azure.mgmt.securityinsight.operations.TriggeredAnalyticsRuleRunOperations
+ :ivar get_triggered_analytics_rule_runs: GetTriggeredAnalyticsRuleRunsOperations operations
+ :vartype get_triggered_analytics_rule_runs:
+ azure.mgmt.securityinsight.operations.GetTriggeredAnalyticsRuleRunsOperations
+ :ivar alert_rule: AlertRuleOperations operations
+ :vartype alert_rule: azure.mgmt.securityinsight.operations.AlertRuleOperations
:ivar watchlists: WatchlistsOperations operations
:vartype watchlists: azure.mgmt.securityinsight.operations.WatchlistsOperations
:ivar watchlist_items: WatchlistItemsOperations operations
:vartype watchlist_items: azure.mgmt.securityinsight.operations.WatchlistItemsOperations
+ :ivar workspace_manager_assignments: WorkspaceManagerAssignmentsOperations operations
+ :vartype workspace_manager_assignments:
+ azure.mgmt.securityinsight.operations.WorkspaceManagerAssignmentsOperations
+ :ivar workspace_manager_assignment_jobs: WorkspaceManagerAssignmentJobsOperations operations
+ :vartype workspace_manager_assignment_jobs:
+ azure.mgmt.securityinsight.operations.WorkspaceManagerAssignmentJobsOperations
+ :ivar workspace_manager_configurations: WorkspaceManagerConfigurationsOperations operations
+ :vartype workspace_manager_configurations:
+ azure.mgmt.securityinsight.operations.WorkspaceManagerConfigurationsOperations
+ :ivar workspace_manager_groups: WorkspaceManagerGroupsOperations operations
+ :vartype workspace_manager_groups:
+ azure.mgmt.securityinsight.operations.WorkspaceManagerGroupsOperations
+ :ivar workspace_manager_members: WorkspaceManagerMembersOperations operations
+ :vartype workspace_manager_members:
+ azure.mgmt.securityinsight.operations.WorkspaceManagerMembersOperations
+ :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 data_connectors_check_requirements: DataConnectorsCheckRequirementsOperations operations
@@ -153,11 +175,11 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
: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
+ :keyword api_version: Api Version. Default value is "2024-04-01-preview". 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
@@ -172,29 +194,79 @@ 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)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
- self.alert_rules = AlertRulesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.actions = ActionsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.alert_rules = AlertRulesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.actions = ActionsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
self.alert_rule_templates = AlertRuleTemplatesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.automation_rules = AutomationRulesOperations(
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.entities = EntitiesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.incidents = IncidentsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.billing_statistics = BillingStatisticsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.bookmarks = BookmarksOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
self.bookmark_relations = BookmarkRelationsOperations(
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.bookmark = BookmarkOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.business_application_agents = BusinessApplicationAgentsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.business_application_agent = BusinessApplicationAgentOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.systems = SystemsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.content_packages = ContentPackagesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ 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.product_package = ProductPackageOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.product_templates = ProductTemplatesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.product_template = ProductTemplateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.content_templates = ContentTemplatesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.content_template = ContentTemplateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
self.entities_get_timeline = EntitiesGetTimelineOperations(
self._client, self._config, self._serialize, self._deserialize
)
@@ -204,36 +276,66 @@ def __init__(
self.entity_relations = EntityRelationsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.entity_queries = EntityQueriesOperations(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._client, self._config, self._serialize, self._deserialize
)
- self.file_imports = FileImportsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.file_imports = FileImportsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.hunts = HuntsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.hunt_relations = HuntRelationsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.hunt_comments = HuntCommentsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
self.incident_comments = IncidentCommentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.incident_relations = IncidentRelationsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- 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.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.get = GetOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.update = UpdateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.reevaluate = ReevaluateOperations(
+ 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.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(
self._client, self._config, self._serialize, self._deserialize
)
@@ -243,15 +345,58 @@ def __init__(
self.threat_intelligence_indicator_metrics = ThreatIntelligenceIndicatorMetricsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- 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.threat_intelligence = ThreatIntelligenceOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.triggered_analytics_rule_run = TriggeredAnalyticsRuleRunOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.get_triggered_analytics_rule_runs = GetTriggeredAnalyticsRuleRunsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.alert_rule = AlertRuleOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.watchlists = WatchlistsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.watchlist_items = WatchlistItemsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.workspace_manager_assignments = WorkspaceManagerAssignmentsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.workspace_manager_assignment_jobs = WorkspaceManagerAssignmentJobsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.workspace_manager_configurations = WorkspaceManagerConfigurationsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.workspace_manager_groups = WorkspaceManagerGroupsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.workspace_manager_members = WorkspaceManagerMembersOperations(
+ 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.data_connectors_check_requirements = DataConnectorsCheckRequirementsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.operations = Operations(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 +416,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..59f1fcf71bc9 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_serialization.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_serialization.py
@@ -38,7 +38,22 @@
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,
+ Mapping,
+)
try:
from urllib import quote # type: ignore
@@ -48,12 +63,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:
@@ -107,7 +124,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 +143,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
@@ -153,13 +172,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:
@@ -277,8 +289,8 @@ class Model(object):
_attribute_map: Dict[str, Dict[str, Any]] = {}
_validation: Dict[str, Dict[str, Any]] = {}
- def __init__(self, **kwargs):
- self.additional_properties = {}
+ def __init__(self, **kwargs: Any) -> None:
+ self.additional_properties: Optional[Dict[str, Any]] = {}
for k in kwargs:
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__)
@@ -287,25 +299,25 @@ def __init__(self, **kwargs):
else:
setattr(self, k, kwargs[k])
- def __eq__(self, other):
+ def __eq__(self, other: Any) -> bool:
"""Compare objects by comparing all attributes."""
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
return False
- def __ne__(self, other):
+ def __ne__(self, other: Any) -> bool:
"""Compare objects by comparing all attributes."""
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:
@@ -322,8 +334,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 +346,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)
-
- def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs):
- """Return a dict that can be JSONify using json.dump.
+ return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore
+
+ 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:
@@ -368,7 +387,7 @@ def my_key_transformer(key, attr_desc, value):
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs)
+ return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore
@classmethod
def _infer_class_models(cls):
@@ -384,7 +403,7 @@ def _infer_class_models(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.
@@ -393,10 +412,15 @@ def deserialize(cls, data, content_type=None):
:raises: DeserializationError if something went wrong
"""
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
@@ -409,8 +433,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None):
:raises: DeserializationError if something went wrong
"""
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 +442,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):
@@ -518,7 +542,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):
self.serialize_type = {
"iso-8601": Serializer.serialize_iso,
"rfc-1123": Serializer.serialize_rfc,
@@ -534,7 +558,7 @@ 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
@@ -602,7 +626,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):
@@ -622,12 +646,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,12 +659,13 @@ 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)
+ raise SerializationError(msg) from err
else:
return serialized
@@ -656,8 +680,8 @@ def body(self, data, data_type, **kwargs):
"""
# 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:
@@ -683,7 +707,7 @@ def body(self, data, data_type, **kwargs):
]
data = deserializer._deserialize(data_type, data)
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)
@@ -703,6 +727,7 @@ 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:
@@ -715,7 +740,9 @@ def query(self, name, data, data_type, **kwargs):
:param data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :rtype: str
+ :keyword bool skip_quote: Whether to skip quote the serialized result.
+ Defaults to False.
+ :rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -723,10 +750,8 @@ def query(self, name, data, data_type, **kwargs):
# 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)
@@ -777,6 +802,8 @@ def serialize_data(self, data, data_type, **kwargs):
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)
@@ -795,7 +822,7 @@ 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)
+ raise SerializationError(msg.format(data, data_type)) from err
else:
return self._serialize(data, **kwargs)
@@ -863,6 +890,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
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'.
+ :keyword bool do_quote: Whether to quote the serialized result of each iterable element.
+ Defaults to False.
:rtype: list, str
"""
if isinstance(data, str):
@@ -875,9 +904,18 @@ 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)
@@ -922,7 +960,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
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:
@@ -955,7 +995,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)
@@ -1132,10 +1172,10 @@ 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):
@@ -1161,7 +1201,8 @@ def rest_key_extractor(attr, attr_desc, data):
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,7 +1211,6 @@ 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:])
@@ -1191,7 +1231,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:])
@@ -1242,7 +1281,7 @@ 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
@@ -1266,7 +1305,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):
@@ -1332,7 +1371,7 @@ class Deserializer(object):
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}]?")
- def __init__(self, classes=None):
+ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.deserialize_type = {
"iso-8601": Deserializer.deserialize_iso,
"rfc-1123": Deserializer.deserialize_rfc,
@@ -1352,7 +1391,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
@@ -1405,12 +1444,12 @@ 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):
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
@@ -1442,7 +1481,7 @@ 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)
+ raise DeserializationError(msg) from err
else:
additional_properties = self._build_additional_properties(attributes, data)
return self._instantiate_model(response, d_attrs, additional_properties)
@@ -1471,22 +1510,22 @@ 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.
"""
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
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,7 +1535,7 @@ 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.
"""
try:
@@ -1539,7 +1578,7 @@ 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
@@ -1613,7 +1652,7 @@ 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)
+ raise DeserializationError(msg) from err
else:
return self._deserialize(obj_type, data)
@@ -1661,7 +1700,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:
@@ -1718,7 +1757,7 @@ def deserialize_basic(self, attr, data_type):
if data_type == "bool":
if attr in [True, False, 1, 0]:
return bool(attr)
- elif isinstance(attr, basestring):
+ elif isinstance(attr, str):
if attr.lower() in ["true", "1"]:
return True
elif attr.lower() in ["false", "0"]:
@@ -1769,7 +1808,6 @@ 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:
@@ -1823,10 +1861,10 @@ def deserialize_decimal(attr):
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):
@@ -1854,7 +1892,7 @@ 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)
+ raise DeserializationError(msg) from err
else:
return duration
@@ -1871,7 +1909,7 @@ 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):
@@ -1906,7 +1944,7 @@ 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)
+ raise DeserializationError(msg) from err
else:
return date_obj
@@ -1943,7 +1981,7 @@ 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)
+ raise DeserializationError(msg) from err
else:
return date_obj
@@ -1959,9 +1997,10 @@ def deserialize_unix(attr):
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)
+ raise DeserializationError(msg) from err
else:
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
index 9aad73fc743e..aec284c47df9 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_vendor.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_vendor.py
@@ -5,23 +5,23 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from azure.core.pipeline.transport import HttpRequest
+from abc import ABC
+from typing import TYPE_CHECKING
+from ._configuration import SecurityInsightsConfiguration
-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
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from azure.core import PipelineClient
+ from ._serialization import Deserializer, Serializer
+
+class SecurityInsightsMixinABC(
+ ABC
+):
+ """DO NOT use this class. It is for internal typing use only."""
+ _client: "PipelineClient"
+ _config: SecurityInsightsConfiguration
+ _serialize: "Serializer"
+ _deserialize: "Deserializer"
-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..027fdbe8bb46 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
@@ -14,9 +14,8 @@
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
-
__all__ = [
- "SecurityInsights",
+ 'SecurityInsights',
]
__all__.extend([p for p in _patch_all if p not in __all__])
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..38fe30ac4298 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,19 @@
# 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,name-too-long
"""Configuration for SecurityInsights.
Note that all parameters used to create this instance are saved as instance
@@ -33,16 +26,20 @@ 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
+ :keyword api_version: Api Version. Default value is "2024-04-01-preview". 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")
+ def __init__(
+ self,
+ credential: "AsyncTokenCredential",
+ subscription_id: str,
+ **kwargs: Any
+ ) -> None:
+ api_version: str = kwargs.pop('api_version', "2024-04-01-preview")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@@ -52,21 +49,24 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k
self.credential = credential
self.subscription_id = subscription_id
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.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:
- self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
- self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
- 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.authentication_policy = kwargs.get("authentication_policy")
+
+ def _configure(
+ self,
+ **kwargs: Any
+ ) -> None:
+ self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
+ 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.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(
- self.credential, *self.credential_scopes, **kwargs
- )
+ self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
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..580e079a24bf 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,60 +8,23 @@
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
from ._configuration import SecurityInsightsConfiguration
-from .operations import (
- ActionsOperations,
- AlertRuleTemplatesOperations,
- AlertRulesOperations,
- AutomationRulesOperations,
- BookmarkOperations,
- BookmarkRelationsOperations,
- BookmarksOperations,
- DataConnectorsCheckRequirementsOperations,
- DataConnectorsOperations,
- DomainWhoisOperations,
- EntitiesGetTimelineOperations,
- EntitiesOperations,
- EntitiesRelationsOperations,
- EntityQueriesOperations,
- EntityQueryTemplatesOperations,
- EntityRelationsOperations,
- FileImportsOperations,
- GetOperations,
- GetRecommendationsOperations,
- IPGeodataOperations,
- IncidentCommentsOperations,
- IncidentRelationsOperations,
- IncidentTasksOperations,
- IncidentsOperations,
- MetadataOperations,
- OfficeConsentsOperations,
- Operations,
- ProductSettingsOperations,
- SecurityMLAnalyticsSettingsOperations,
- SentinelOnboardingStatesOperations,
- SourceControlOperations,
- SourceControlsOperations,
- ThreatIntelligenceIndicatorMetricsOperations,
- ThreatIntelligenceIndicatorOperations,
- ThreatIntelligenceIndicatorsOperations,
- UpdateOperations,
- WatchlistItemsOperations,
- WatchlistsOperations,
-)
+from .operations import ActionsOperations, AlertRuleOperations, AlertRuleTemplatesOperations, AlertRulesOperations, AutomationRulesOperations, BillingStatisticsOperations, BookmarkOperations, BookmarkRelationsOperations, BookmarksOperations, BusinessApplicationAgentOperations, BusinessApplicationAgentsOperations, ContentPackageOperations, ContentPackagesOperations, ContentTemplateOperations, ContentTemplatesOperations, DataConnectorDefinitionsOperations, DataConnectorsCheckRequirementsOperations, DataConnectorsOperations, EntitiesGetTimelineOperations, EntitiesOperations, EntitiesRelationsOperations, EntityQueriesOperations, EntityQueryTemplatesOperations, EntityRelationsOperations, FileImportsOperations, GetOperations, GetRecommendationsOperations, GetTriggeredAnalyticsRuleRunsOperations, HuntCommentsOperations, HuntRelationsOperations, HuntsOperations, IncidentCommentsOperations, IncidentRelationsOperations, IncidentTasksOperations, IncidentsOperations, MetadataOperations, OfficeConsentsOperations, Operations, ProductPackageOperations, ProductPackagesOperations, ProductSettingsOperations, ProductTemplateOperations, ProductTemplatesOperations, ReevaluateOperations, SecurityInsightsOperationsMixin, SecurityMLAnalyticsSettingsOperations, SentinelOnboardingStatesOperations, SourceControlOperations, SourceControlsOperations, SystemsOperations, ThreatIntelligenceIndicatorMetricsOperations, ThreatIntelligenceIndicatorOperations, ThreatIntelligenceIndicatorsOperations, ThreatIntelligenceOperations, TriggeredAnalyticsRuleRunOperations, UpdateOperations, WatchlistItemsOperations, WatchlistsOperations, WorkspaceManagerAssignmentJobsOperations, WorkspaceManagerAssignmentsOperations, WorkspaceManagerConfigurationsOperations, WorkspaceManagerGroupsOperations, WorkspaceManagerMembersOperations
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(SecurityInsightsOperationsMixin): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider.
:ivar alert_rules: AlertRulesOperations operations
@@ -73,8 +36,13 @@ 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 billing_statistics: BillingStatisticsOperations operations
+ :vartype billing_statistics:
+ azure.mgmt.securityinsight.aio.operations.BillingStatisticsOperations
:ivar bookmarks: BookmarksOperations operations
:vartype bookmarks: azure.mgmt.securityinsight.aio.operations.BookmarksOperations
:ivar bookmark_relations: BookmarkRelationsOperations operations
@@ -82,12 +50,32 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
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 business_application_agents: BusinessApplicationAgentsOperations operations
+ :vartype business_application_agents:
+ azure.mgmt.securityinsight.aio.operations.BusinessApplicationAgentsOperations
+ :ivar business_application_agent: BusinessApplicationAgentOperations operations
+ :vartype business_application_agent:
+ azure.mgmt.securityinsight.aio.operations.BusinessApplicationAgentOperations
+ :ivar systems: SystemsOperations operations
+ :vartype systems: azure.mgmt.securityinsight.aio.operations.SystemsOperations
+ :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 entities_get_timeline: EntitiesGetTimelineOperations operations
:vartype entities_get_timeline:
azure.mgmt.securityinsight.aio.operations.EntitiesGetTimelineOperations
@@ -103,6 +91,12 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
azure.mgmt.securityinsight.aio.operations.EntityQueryTemplatesOperations
:ivar file_imports: FileImportsOperations operations
:vartype file_imports: azure.mgmt.securityinsight.aio.operations.FileImportsOperations
+ :ivar hunts: HuntsOperations operations
+ :vartype hunts: azure.mgmt.securityinsight.aio.operations.HuntsOperations
+ :ivar hunt_relations: HuntRelationsOperations operations
+ :vartype hunt_relations: azure.mgmt.securityinsight.aio.operations.HuntRelationsOperations
+ :ivar hunt_comments: HuntCommentsOperations operations
+ :vartype hunt_comments: azure.mgmt.securityinsight.aio.operations.HuntCommentsOperations
:ivar incident_comments: IncidentCommentsOperations operations
:vartype incident_comments:
azure.mgmt.securityinsight.aio.operations.IncidentCommentsOperations
@@ -125,6 +119,8 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
:vartype get: azure.mgmt.securityinsight.aio.operations.GetOperations
:ivar update: UpdateOperations operations
:vartype update: azure.mgmt.securityinsight.aio.operations.UpdateOperations
+ :ivar reevaluate: ReevaluateOperations operations
+ :vartype reevaluate: azure.mgmt.securityinsight.aio.operations.ReevaluateOperations
:ivar security_ml_analytics_settings: SecurityMLAnalyticsSettingsOperations operations
:vartype security_ml_analytics_settings:
azure.mgmt.securityinsight.aio.operations.SecurityMLAnalyticsSettingsOperations
@@ -144,10 +140,39 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
operations
:vartype threat_intelligence_indicator_metrics:
azure.mgmt.securityinsight.aio.operations.ThreatIntelligenceIndicatorMetricsOperations
+ :ivar threat_intelligence: ThreatIntelligenceOperations operations
+ :vartype threat_intelligence:
+ azure.mgmt.securityinsight.aio.operations.ThreatIntelligenceOperations
+ :ivar triggered_analytics_rule_run: TriggeredAnalyticsRuleRunOperations operations
+ :vartype triggered_analytics_rule_run:
+ azure.mgmt.securityinsight.aio.operations.TriggeredAnalyticsRuleRunOperations
+ :ivar get_triggered_analytics_rule_runs: GetTriggeredAnalyticsRuleRunsOperations operations
+ :vartype get_triggered_analytics_rule_runs:
+ azure.mgmt.securityinsight.aio.operations.GetTriggeredAnalyticsRuleRunsOperations
+ :ivar alert_rule: AlertRuleOperations operations
+ :vartype alert_rule: azure.mgmt.securityinsight.aio.operations.AlertRuleOperations
:ivar watchlists: WatchlistsOperations operations
:vartype watchlists: azure.mgmt.securityinsight.aio.operations.WatchlistsOperations
:ivar watchlist_items: WatchlistItemsOperations operations
:vartype watchlist_items: azure.mgmt.securityinsight.aio.operations.WatchlistItemsOperations
+ :ivar workspace_manager_assignments: WorkspaceManagerAssignmentsOperations operations
+ :vartype workspace_manager_assignments:
+ azure.mgmt.securityinsight.aio.operations.WorkspaceManagerAssignmentsOperations
+ :ivar workspace_manager_assignment_jobs: WorkspaceManagerAssignmentJobsOperations operations
+ :vartype workspace_manager_assignment_jobs:
+ azure.mgmt.securityinsight.aio.operations.WorkspaceManagerAssignmentJobsOperations
+ :ivar workspace_manager_configurations: WorkspaceManagerConfigurationsOperations operations
+ :vartype workspace_manager_configurations:
+ azure.mgmt.securityinsight.aio.operations.WorkspaceManagerConfigurationsOperations
+ :ivar workspace_manager_groups: WorkspaceManagerGroupsOperations operations
+ :vartype workspace_manager_groups:
+ azure.mgmt.securityinsight.aio.operations.WorkspaceManagerGroupsOperations
+ :ivar workspace_manager_members: WorkspaceManagerMembersOperations operations
+ :vartype workspace_manager_members:
+ azure.mgmt.securityinsight.aio.operations.WorkspaceManagerMembersOperations
+ :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 data_connectors_check_requirements: DataConnectorsCheckRequirementsOperations operations
@@ -157,11 +182,11 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
: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
+ :keyword api_version: Api Version. Default value is "2024-04-01-preview". 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
@@ -176,29 +201,79 @@ 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)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
- self.alert_rules = AlertRulesOperations(self._client, self._config, self._serialize, self._deserialize)
- self.actions = ActionsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.alert_rules = AlertRulesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.actions = ActionsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
self.alert_rule_templates = AlertRuleTemplatesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.automation_rules = AutomationRulesOperations(
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.entities = EntitiesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.incidents = IncidentsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.billing_statistics = BillingStatisticsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.bookmarks = BookmarksOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
self.bookmark_relations = BookmarkRelationsOperations(
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.bookmark = BookmarkOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.business_application_agents = BusinessApplicationAgentsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.business_application_agent = BusinessApplicationAgentOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.systems = SystemsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.content_packages = ContentPackagesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ 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.product_package = ProductPackageOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.product_templates = ProductTemplatesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.product_template = ProductTemplateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.content_templates = ContentTemplatesOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.content_template = ContentTemplateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
self.entities_get_timeline = EntitiesGetTimelineOperations(
self._client, self._config, self._serialize, self._deserialize
)
@@ -208,36 +283,66 @@ def __init__(
self.entity_relations = EntityRelationsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.entity_queries = EntityQueriesOperations(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._client, self._config, self._serialize, self._deserialize
)
- self.file_imports = FileImportsOperations(self._client, self._config, self._serialize, self._deserialize)
+ self.file_imports = FileImportsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.hunts = HuntsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.hunt_relations = HuntRelationsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.hunt_comments = HuntCommentsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
self.incident_comments = IncidentCommentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.incident_relations = IncidentRelationsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- 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.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.get = GetOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.update = UpdateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.reevaluate = ReevaluateOperations(
+ 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.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(
self._client, self._config, self._serialize, self._deserialize
)
@@ -247,15 +352,58 @@ def __init__(
self.threat_intelligence_indicator_metrics = ThreatIntelligenceIndicatorMetricsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- 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.threat_intelligence = ThreatIntelligenceOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.triggered_analytics_rule_run = TriggeredAnalyticsRuleRunOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.get_triggered_analytics_rule_runs = GetTriggeredAnalyticsRuleRunsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.alert_rule = AlertRuleOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.watchlists = WatchlistsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.watchlist_items = WatchlistItemsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.workspace_manager_assignments = WorkspaceManagerAssignmentsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.workspace_manager_assignment_jobs = WorkspaceManagerAssignmentJobsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.workspace_manager_configurations = WorkspaceManagerConfigurationsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.workspace_manager_groups = WorkspaceManagerGroupsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.workspace_manager_members = WorkspaceManagerMembersOperations(
+ 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.data_connectors_check_requirements = DataConnectorsCheckRequirementsOperations(
self._client, self._config, self._serialize, self._deserialize
)
- self.operations = Operations(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 +423,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/_vendor.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_vendor.py
new file mode 100644
index 000000000000..0eee39b4389c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/_vendor.py
@@ -0,0 +1,27 @@
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 abc import ABC
+from typing import TYPE_CHECKING
+
+from ._configuration import SecurityInsightsConfiguration
+
+if TYPE_CHECKING:
+ # pylint: disable=unused-import,ungrouped-imports
+ from azure.core import AsyncPipelineClient
+
+ from .._serialization import Deserializer, Serializer
+
+class SecurityInsightsMixinABC(
+ ABC
+):
+ """DO NOT use this class. It is for internal typing use only."""
+ _client: "AsyncPipelineClient"
+ _config: SecurityInsightsConfiguration
+ _serialize: "Serializer"
+ _deserialize: "Deserializer"
+
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..c8c06ca4ee57 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
@@ -10,19 +10,33 @@
from ._actions_operations import ActionsOperations
from ._alert_rule_templates_operations import AlertRuleTemplatesOperations
from ._automation_rules_operations import AutomationRulesOperations
+from ._entities_operations import EntitiesOperations
from ._incidents_operations import IncidentsOperations
+from ._billing_statistics_operations import BillingStatisticsOperations
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 ._business_application_agents_operations import BusinessApplicationAgentsOperations
+from ._business_application_agent_operations import BusinessApplicationAgentOperations
+from ._systems_operations import SystemsOperations
+from ._content_packages_operations import ContentPackagesOperations
+from ._content_package_operations import ContentPackageOperations
+from ._product_packages_operations import ProductPackagesOperations
+from ._product_package_operations import ProductPackageOperations
+from ._product_templates_operations import ProductTemplatesOperations
+from ._product_template_operations import ProductTemplateOperations
+from ._content_templates_operations import ContentTemplatesOperations
+from ._content_template_operations import ContentTemplateOperations
+from ._security_insights_operations import SecurityInsightsOperationsMixin
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 ._hunts_operations import HuntsOperations
+from ._hunt_relations_operations import HuntRelationsOperations
+from ._hunt_comments_operations import HuntCommentsOperations
from ._incident_comments_operations import IncidentCommentsOperations
from ._incident_relations_operations import IncidentRelationsOperations
from ._incident_tasks_operations import IncidentTasksOperations
@@ -32,6 +46,7 @@
from ._get_recommendations_operations import GetRecommendationsOperations
from ._get_operations import GetOperations
from ._update_operations import UpdateOperations
+from ._reevaluate_operations import ReevaluateOperations
from ._security_ml_analytics_settings_operations import SecurityMLAnalyticsSettingsOperations
from ._product_settings_operations import ProductSettingsOperations
from ._source_control_operations import SourceControlOperations
@@ -39,8 +54,18 @@
from ._threat_intelligence_indicator_operations import ThreatIntelligenceIndicatorOperations
from ._threat_intelligence_indicators_operations import ThreatIntelligenceIndicatorsOperations
from ._threat_intelligence_indicator_metrics_operations import ThreatIntelligenceIndicatorMetricsOperations
+from ._threat_intelligence_operations import ThreatIntelligenceOperations
+from ._triggered_analytics_rule_run_operations import TriggeredAnalyticsRuleRunOperations
+from ._get_triggered_analytics_rule_runs_operations import GetTriggeredAnalyticsRuleRunsOperations
+from ._alert_rule_operations import AlertRuleOperations
from ._watchlists_operations import WatchlistsOperations
from ._watchlist_items_operations import WatchlistItemsOperations
+from ._workspace_manager_assignments_operations import WorkspaceManagerAssignmentsOperations
+from ._workspace_manager_assignment_jobs_operations import WorkspaceManagerAssignmentJobsOperations
+from ._workspace_manager_configurations_operations import WorkspaceManagerConfigurationsOperations
+from ._workspace_manager_groups_operations import WorkspaceManagerGroupsOperations
+from ._workspace_manager_members_operations import WorkspaceManagerMembersOperations
+from ._data_connector_definitions_operations import DataConnectorDefinitionsOperations
from ._data_connectors_operations import DataConnectorsOperations
from ._data_connectors_check_requirements_operations import DataConnectorsCheckRequirementsOperations
from ._operations import Operations
@@ -48,46 +73,70 @@
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
-
__all__ = [
- "AlertRulesOperations",
- "ActionsOperations",
- "AlertRuleTemplatesOperations",
- "AutomationRulesOperations",
- "IncidentsOperations",
- "BookmarksOperations",
- "BookmarkRelationsOperations",
- "BookmarkOperations",
- "IPGeodataOperations",
- "DomainWhoisOperations",
- "EntitiesOperations",
- "EntitiesGetTimelineOperations",
- "EntitiesRelationsOperations",
- "EntityRelationsOperations",
- "EntityQueriesOperations",
- "EntityQueryTemplatesOperations",
- "FileImportsOperations",
- "IncidentCommentsOperations",
- "IncidentRelationsOperations",
- "IncidentTasksOperations",
- "MetadataOperations",
- "OfficeConsentsOperations",
- "SentinelOnboardingStatesOperations",
- "GetRecommendationsOperations",
- "GetOperations",
- "UpdateOperations",
- "SecurityMLAnalyticsSettingsOperations",
- "ProductSettingsOperations",
- "SourceControlOperations",
- "SourceControlsOperations",
- "ThreatIntelligenceIndicatorOperations",
- "ThreatIntelligenceIndicatorsOperations",
- "ThreatIntelligenceIndicatorMetricsOperations",
- "WatchlistsOperations",
- "WatchlistItemsOperations",
- "DataConnectorsOperations",
- "DataConnectorsCheckRequirementsOperations",
- "Operations",
+ 'AlertRulesOperations',
+ 'ActionsOperations',
+ 'AlertRuleTemplatesOperations',
+ 'AutomationRulesOperations',
+ 'EntitiesOperations',
+ 'IncidentsOperations',
+ 'BillingStatisticsOperations',
+ 'BookmarksOperations',
+ 'BookmarkRelationsOperations',
+ 'BookmarkOperations',
+ 'BusinessApplicationAgentsOperations',
+ 'BusinessApplicationAgentOperations',
+ 'SystemsOperations',
+ 'ContentPackagesOperations',
+ 'ContentPackageOperations',
+ 'ProductPackagesOperations',
+ 'ProductPackageOperations',
+ 'ProductTemplatesOperations',
+ 'ProductTemplateOperations',
+ 'ContentTemplatesOperations',
+ 'ContentTemplateOperations',
+ 'SecurityInsightsOperationsMixin',
+ 'EntitiesGetTimelineOperations',
+ 'EntitiesRelationsOperations',
+ 'EntityRelationsOperations',
+ 'EntityQueriesOperations',
+ 'EntityQueryTemplatesOperations',
+ 'FileImportsOperations',
+ 'HuntsOperations',
+ 'HuntRelationsOperations',
+ 'HuntCommentsOperations',
+ 'IncidentCommentsOperations',
+ 'IncidentRelationsOperations',
+ 'IncidentTasksOperations',
+ 'MetadataOperations',
+ 'OfficeConsentsOperations',
+ 'SentinelOnboardingStatesOperations',
+ 'GetRecommendationsOperations',
+ 'GetOperations',
+ 'UpdateOperations',
+ 'ReevaluateOperations',
+ 'SecurityMLAnalyticsSettingsOperations',
+ 'ProductSettingsOperations',
+ 'SourceControlOperations',
+ 'SourceControlsOperations',
+ 'ThreatIntelligenceIndicatorOperations',
+ 'ThreatIntelligenceIndicatorsOperations',
+ 'ThreatIntelligenceIndicatorMetricsOperations',
+ 'ThreatIntelligenceOperations',
+ 'TriggeredAnalyticsRuleRunOperations',
+ 'GetTriggeredAnalyticsRuleRunsOperations',
+ 'AlertRuleOperations',
+ 'WatchlistsOperations',
+ 'WatchlistItemsOperations',
+ 'WorkspaceManagerAssignmentsOperations',
+ 'WorkspaceManagerAssignmentJobsOperations',
+ 'WorkspaceManagerConfigurationsOperations',
+ 'WorkspaceManagerGroupsOperations',
+ 'WorkspaceManagerMembersOperations',
+ 'DataConnectorDefinitionsOperations',
+ 'DataConnectorsOperations',
+ 'DataConnectorsCheckRequirementsOperations',
+ 'Operations',
]
__all__.extend([p for p in _patch_all if p not in __all__])
_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..0579f9605956 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_get_request,
- build_list_by_alert_rule_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._actions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_alert_rule_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class ActionsOperations:
+class ActionsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,9 +49,16 @@ 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_by_alert_rule(
- self, resource_group_name: str, workspace_name: str, rule_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ **kwargs: Any
) -> AsyncIterable["_models.ActionResponse"]:
"""Gets all actions of alert rule.
@@ -76,7 +69,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,65 +77,58 @@ 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
)
- cls: ClsType[_models.ActionsList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("ActionsList", pipeline_response)
+ deserialized = self._deserialize(
+ "ActionsList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -153,15 +138,20 @@ async def get_next(next_link=None):
return pipeline_response
- 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"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, rule_id: str, action_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ action_id: str,
+ **kwargs: Any
) -> _models.ActionResponse:
"""Gets the action of alert rule.
@@ -174,43 +164,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.ActionResponse] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -219,16 +207,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}"
- }
@overload
async def create_or_update(
@@ -258,7 +247,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 +259,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,16 +276,16 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
@@ -305,7 +293,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,42 +307,35 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.ActionResponse] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +345,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -381,24 +363,26 @@ 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 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
- self, resource_group_name: str, workspace_name: str, rule_id: str, action_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ action_id: str,
+ **kwargs: Any
) -> None:
"""Delete the action of alert rule.
@@ -411,43 +395,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -457,8 +439,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rule_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rule_operations.py
new file mode 100644
index 000000000000..3eef90e229d5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rule_operations.py
@@ -0,0 +1,274 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, StreamConsumedError, map_error
+from azure.core.pipeline import PipelineResponse
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
+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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
+
+from ... import models as _models
+from ...operations._alert_rule_operations import build_trigger_rule_run_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class AlertRuleOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`alert_rule` 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 _trigger_rule_run_initial(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ analytics_rule_run_trigger_parameter: Union[_models.AnalyticsRuleRunTrigger, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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[AsyncIterator[bytes]] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(analytics_rule_run_trigger_parameter, (IOBase, bytes)):
+ _content = analytics_rule_run_trigger_parameter
+ else:
+ _json = self._serialize.body(analytics_rule_run_trigger_parameter, 'AnalyticsRuleRunTrigger')
+
+ _request = build_trigger_rule_run_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,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ 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]:
+ 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 = {}
+ 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
+
+
+
+ @overload
+ async def begin_trigger_rule_run(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ analytics_rule_run_trigger_parameter: _models.AnalyticsRuleRunTrigger,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """triggers analytics rule run.
+
+ :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 rule_id: Alert rule ID. Required.
+ :type rule_id: str
+ :param analytics_rule_run_trigger_parameter: The Analytics Rule Run Trigger parameter.
+ Required.
+ :type analytics_rule_run_trigger_parameter:
+ ~azure.mgmt.securityinsight.models.AnalyticsRuleRunTrigger
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :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:
+ """
+
+ @overload
+ async def begin_trigger_rule_run(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ analytics_rule_run_trigger_parameter: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """triggers analytics rule run.
+
+ :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 rule_id: Alert rule ID. Required.
+ :type rule_id: str
+ :param analytics_rule_run_trigger_parameter: The Analytics Rule Run Trigger parameter.
+ Required.
+ :type analytics_rule_run_trigger_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
+ :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:
+ """
+
+
+ @distributed_trace_async
+ async def begin_trigger_rule_run(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ analytics_rule_run_trigger_parameter: Union[_models.AnalyticsRuleRunTrigger, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """triggers analytics rule run.
+
+ :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 rule_id: Alert rule ID. Required.
+ :type rule_id: str
+ :param analytics_rule_run_trigger_parameter: The Analytics Rule Run Trigger parameter. Is
+ either a AnalyticsRuleRunTrigger type or a IO[bytes] type. Required.
+ :type analytics_rule_run_trigger_parameter:
+ ~azure.mgmt.securityinsight.models.AnalyticsRuleRunTrigger or IO[bytes]
+ :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:
+ """
+ _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[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._trigger_rule_run_initial(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ rule_id=rule_id,
+ analytics_rule_run_trigger_parameter=analytics_rule_run_trigger_parameter,
+ 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)
+
+ 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': 'location'},
+
+ **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
+ )
+
+
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..3c1c9a0e9e7b 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,39 +7,29 @@
# 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
+from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class AlertRuleTemplatesOperations:
+class AlertRuleTemplatesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -58,9 +48,15 @@ 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> AsyncIterable["_models.AlertRuleTemplate"]:
"""Gets all alert rule templates.
@@ -69,7 +65,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,64 +73,57 @@ 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
)
- cls: ClsType[_models.AlertRuleTemplatesList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("AlertRuleTemplatesList", pipeline_response)
+ deserialized = self._deserialize(
+ "AlertRuleTemplatesList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -145,15 +133,19 @@ 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/alertRuleTemplates"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, alert_rule_template_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ alert_rule_template_id: str,
+ **kwargs: Any
) -> _models.AlertRuleTemplate:
"""Gets the alert rule template.
@@ -164,42 +156,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.AlertRuleTemplate] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -208,13 +198,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates/{alertRuleTemplateId}"
- }
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..9fa34ede0f14 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._alert_rules_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class AlertRulesOperations:
+class AlertRulesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,8 +49,16 @@ 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.AlertRule"]:
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.AlertRule"]:
"""Gets all alert rules.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -72,7 +66,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,64 +73,57 @@ 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
)
- cls: ClsType[_models.AlertRulesList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("AlertRulesList", pipeline_response)
+ deserialized = self._deserialize(
+ "AlertRulesList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -147,15 +133,19 @@ 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/alertRules"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, rule_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ **kwargs: Any
) -> _models.AlertRule:
"""Gets the alert rule.
@@ -166,42 +156,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.AlertRule] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -210,16 +198,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}"
- }
@overload
async def create_or_update(
@@ -246,7 +235,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 +246,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,23 +261,23 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
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,42 +289,35 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.AlertRule] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +326,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -362,24 +344,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ **kwargs: Any
) -> None:
"""Delete the alert rule.
@@ -390,42 +373,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -435,8 +416,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}"
- }
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..567ad69fcb27 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,50 +6,32 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_get_request,
- build_list_request,
-)
+from ...operations._automation_rules_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
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
-T = TypeVar("T")
+JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class AutomationRulesOperations:
+class AutomationRulesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -68,9 +50,16 @@ 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_async
async def get(
- self, resource_group_name: str, workspace_name: str, automation_rule_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ automation_rule_id: str,
+ **kwargs: Any
) -> _models.AutomationRule:
"""Gets the automation rule.
@@ -81,42 +70,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.AutomationRule] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -125,16 +112,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}"
- }
@overload
async def create_or_update(
@@ -161,7 +149,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 +160,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,23 +175,23 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
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,46 +203,39 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.AutomationRule] = kwargs.pop(
+ 'cls', None
)
- 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:
- _json = self._serialize.body(automation_rule_to_upsert, "AutomationRule")
+ _json = self._serialize.body(automation_rule_to_upsert, 'AutomationRule')
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 +244,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -281,24 +262,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ automation_rule_id: str,
+ **kwargs: Any
) -> JSON:
"""Delete the automation rule.
@@ -309,42 +291,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[JSON] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -353,24 +333,24 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> AsyncIterable["_models.AutomationRule"]:
"""Gets all automation rules.
@@ -379,7 +359,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,64 +367,57 @@ 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
)
- cls: ClsType[_models.AutomationRulesList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("AutomationRulesList", pipeline_response)
+ deserialized = self._deserialize(
+ "AutomationRulesList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -455,8 +427,8 @@ 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"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_billing_statistics_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_billing_statistics_operations.py
new file mode 100644
index 000000000000..a9b532c4f8f2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_billing_statistics_operations.py
@@ -0,0 +1,213 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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.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._billing_statistics_operations import build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class BillingStatisticsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`billing_statistics` 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.BillingStatistic"]:
+ """Gets all Microsoft Sentinel billing statistics.
+
+ :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
+ :return: An iterator like instance of either BillingStatistic or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.BillingStatistic]
+ :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.BillingStatisticList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "BillingStatisticList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace_async
+ async def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ billing_statistic_name: str,
+ **kwargs: Any
+ ) -> _models.BillingStatistic:
+ """Gets a billing statistic.
+
+ :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 billing_statistic_name: The name of the billing statistic. Required.
+ :type billing_statistic_name: str
+ :return: BillingStatistic or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.BillingStatistic
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.BillingStatistic] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ billing_statistic_name=billing_statistic_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'BillingStatistic',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
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
index e87871dba5df..617539f771f8 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,37 +6,28 @@
# 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 typing import Any, Callable, Dict, IO, Optional, Type, 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.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._bookmark_operations import build_expand_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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class BookmarkOperations:
+class BookmarkOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -55,6 +46,9 @@ 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
async def expand(
self,
@@ -81,7 +75,6 @@ async def expand(
: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:
@@ -93,7 +86,7 @@ async def expand(
resource_group_name: str,
workspace_name: str,
bookmark_id: str,
- parameters: IO,
+ parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -109,23 +102,23 @@ async def expand(
:type bookmark_id: str
:param parameters: The parameters required to execute an expand operation on the given
bookmark. Required.
- :type parameters: IO
+ :type parameters: 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: 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],
+ parameters: Union[_models.BookmarkExpandParameters, IO[bytes]],
**kwargs: Any
) -> _models.BookmarkExpandResponse:
"""Expand an bookmark.
@@ -138,42 +131,35 @@ async def expand(
: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
+ bookmark. Is either a BookmarkExpandParameters type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.securityinsight.models.BookmarkExpandParameters or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.BookmarkExpandResponse] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
- _json = self._serialize.body(parameters, "BookmarkExpandParameters")
+ _json = self._serialize.body(parameters, 'BookmarkExpandParameters')
- request = build_expand_request(
+ _request = build_expand_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
bookmark_id=bookmark_id,
@@ -182,15 +168,16 @@ async def expand(
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -199,13 +186,14 @@ async def expand(
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)
+ deserialized = self._deserialize(
+ 'BookmarkExpandResponse',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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
index 237aca3682c1..c11148079033 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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._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
+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, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class BookmarkRelationsOperations:
+class BookmarkRelationsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,6 +49,9 @@ 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,
@@ -96,7 +85,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,23 +92,19 @@ 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
)
- cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,
bookmark_id=bookmark_id,
@@ -130,43 +114,40 @@ 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
_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 = 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
+ _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("RelationList", pipeline_response)
+ deserialized = self._deserialize(
+ "RelationList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -176,15 +157,20 @@ 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/bookmarks/{bookmarkId}/relations"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, bookmark_id: str, relation_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ bookmark_id: str,
+ relation_name: str,
+ **kwargs: Any
) -> _models.Relation:
"""Gets a bookmark relation.
@@ -197,43 +183,41 @@ async def get(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Relation] = kwargs.pop(
+ 'cls', None
)
- 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,
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -242,16 +226,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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(
@@ -281,7 +266,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,7 +278,7 @@ async def create_or_update(
workspace_name: str,
bookmark_id: str,
relation_name: str,
- relation: IO,
+ relation: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -311,16 +295,16 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
@@ -328,7 +312,7 @@ async def create_or_update(
workspace_name: str,
bookmark_id: str,
relation_name: str,
- relation: Union[_models.Relation, IO],
+ relation: Union[_models.Relation, IO[bytes]],
**kwargs: Any
) -> _models.Relation:
"""Creates the bookmark relation.
@@ -342,42 +326,35 @@ async def create_or_update(
: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
+ :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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Relation] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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,
bookmark_id=bookmark_id,
@@ -387,15 +364,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -404,24 +382,26 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ bookmark_id: str,
+ relation_name: str,
+ **kwargs: Any
) -> None:
"""Delete the bookmark relation.
@@ -434,43 +414,41 @@ async def delete( # pylint: disable=inconsistent-return-statements
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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,
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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -480,8 +458,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- 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..37452b2fb27e 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._bookmarks_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class BookmarksOperations:
+class BookmarksOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,8 +49,16 @@ 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.Bookmark"]:
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.Bookmark"]:
"""Gets all bookmarks.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -72,7 +66,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,64 +73,57 @@ 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
)
- cls: ClsType[_models.BookmarkList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("BookmarkList", pipeline_response)
+ deserialized = self._deserialize(
+ "BookmarkList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -147,15 +133,19 @@ 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/bookmarks"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, bookmark_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ bookmark_id: str,
+ **kwargs: Any
) -> _models.Bookmark:
"""Gets a bookmark.
@@ -166,42 +156,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Bookmark] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -210,16 +198,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}"
- }
@overload
async def create_or_update(
@@ -246,7 +235,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 +246,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,23 +261,23 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
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,42 +289,35 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Bookmark] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +326,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -362,24 +344,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ bookmark_id: str,
+ **kwargs: Any
) -> None:
"""Delete the bookmark.
@@ -390,42 +373,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -435,8 +416,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_business_application_agent_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_business_application_agent_operations.py
new file mode 100644
index 000000000000..f354709a0e3e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_business_application_agent_operations.py
@@ -0,0 +1,120 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, TypeVar
+
+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._business_application_agent_operations import build_get_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class BusinessApplicationAgentOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`business_application_agent` 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,
+ workspace_name: str,
+ agent_resource_name: str,
+ **kwargs: Any
+ ) -> _models.BusinessApplicationAgentResource:
+ """Gets Business Application Agent.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :return: BusinessApplicationAgentResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.BusinessApplicationAgentResource] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ 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(
+ 'BusinessApplicationAgentResource',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_business_application_agents_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_business_application_agents_operations.py
new file mode 100644
index 000000000000..03c9c457a1ef
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_business_application_agents_operations.py
@@ -0,0 +1,369 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...operations._business_application_agents_operations import build_create_or_update_request, build_delete_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class BusinessApplicationAgentsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`business_application_agents` 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 create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ agent_to_upsert: Optional[_models.BusinessApplicationAgentResource] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.BusinessApplicationAgentResource:
+ """Creates or updates the Business Application Agent.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param agent_to_upsert: The Business Application Agent. Default value is None.
+ :type agent_to_upsert: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: BusinessApplicationAgentResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ agent_to_upsert: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.BusinessApplicationAgentResource:
+ """Creates or updates the Business Application Agent.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param agent_to_upsert: The Business Application Agent. Default value is None.
+ :type agent_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
+ :return: BusinessApplicationAgentResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ agent_to_upsert: Optional[Union[_models.BusinessApplicationAgentResource, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> _models.BusinessApplicationAgentResource:
+ """Creates or updates the Business Application Agent.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param agent_to_upsert: The Business Application Agent. Is either a
+ BusinessApplicationAgentResource type or a IO[bytes] type. Default value is None.
+ :type agent_to_upsert: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource or
+ IO[bytes]
+ :return: BusinessApplicationAgentResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.BusinessApplicationAgentResource] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(agent_to_upsert, (IOBase, bytes)):
+ _content = agent_to_upsert
+ else:
+ if agent_to_upsert is not None:
+ _json = self._serialize.body(agent_to_upsert, 'BusinessApplicationAgentResource')
+ else:
+ _json = None
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ 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(
+ 'BusinessApplicationAgentResource',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Delete the Business Application Agent.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ agent_resource_name=agent_resource_name,
+ 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
+
+
+
+ @distributed_trace
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ filter: Optional[str] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.BusinessApplicationAgentResource"]:
+ """Gets all Business Application Agents under 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 filter: Filters the results, based on a Boolean condition. Optional. Default value is
+ None.
+ :type filter: 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
+ :return: An iterator like instance of either BusinessApplicationAgentResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource]
+ :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.BusinessApplicationAgentsList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "BusinessApplicationAgentsList",
+ 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/_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..80d9b389ee3c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_package_operations.py
@@ -0,0 +1,262 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # pylint: disable=ungrouped-imports
+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[int, Type[HttpResponseError]] = {
+ 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( # 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[int, Type[HttpResponseError]] = {
+ 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/_content_packages_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_packages_operations.py
new file mode 100644
index 000000000000..cacb748f629b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_packages_operations.py
@@ -0,0 +1,245 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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.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_packages_operations import build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+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:`content_packages` 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.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 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.PackageModel]
+ :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.PackageList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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(
+ "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)
+
+ _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
+ )
+
+
+ @distributed_trace_async
+ async def get(
+ 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 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.PackageModel] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _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,
+ 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(
+ 'PackageModel',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ 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..0030879f4666
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_template_operations.py
@@ -0,0 +1,338 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # pylint: disable=ungrouped-imports
+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[int, Type[HttpResponseError]] = {
+ 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[int, Type[HttpResponseError]] = {
+ 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( # pylint: disable=inconsistent-return-statements
+ 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[int, Type[HttpResponseError]] = {
+ 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..5176340f849d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_content_templates_operations.py
@@ -0,0 +1,183 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # pylint: disable=ungrouped-imports
+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[int, Type[HttpResponseError]] = {
+ 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/_data_connector_definitions_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connector_definitions_operations.py
new file mode 100644
index 000000000000..c94f5122ae36
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connector_definitions_operations.py
@@ -0,0 +1,425 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...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, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+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:`data_connector_definitions` 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.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
+ :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: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.DataConnectorDefinitionArmCollectionWrapper] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "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)
+
+ _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
+ )
+
+
+ @distributed_trace_async
+ async def get(
+ 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 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.DataConnectorDefinition] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ data_connector_definition_name=data_connector_definition_name,
+ 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(
+ 'DataConnectorDefinition',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ connector_definition_input: _models.DataConnectorDefinition,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _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 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
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ connector_definition_input: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _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 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
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ connector_definition_input: Union[_models.DataConnectorDefinition, IO[bytes]],
+ **kwargs: Any
+ ) -> _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 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.DataConnectorDefinition] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(connector_definition_input, (IOBase, bytes)):
+ _content = connector_definition_input
+ else:
+ _json = self._serialize.body(connector_definition_input, 'DataConnectorDefinition')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ 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,
+ 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(
+ 'DataConnectorDefinition',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ **kwargs: Any
+ ) -> None:
+ """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 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ data_connector_definition_name=data_connector_definition_name,
+ 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/_data_connectors_check_requirements_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_check_requirements_operations.py
index ad27dbca1787..3ea4a18af257 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,37 +6,28 @@
# 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 typing import Any, Callable, Dict, IO, Optional, Type, 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.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._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
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class DataConnectorsCheckRequirementsOperations:
+class DataConnectorsCheckRequirementsOperations: # pylint: disable=name-too-long
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -55,6 +46,9 @@ 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
async def post(
self,
@@ -79,7 +73,6 @@ async def post(
: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:
@@ -90,7 +83,7 @@ async def post(
self,
resource_group_name: str,
workspace_name: str,
- data_connectors_check_requirements: IO,
+ data_connectors_check_requirements: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -104,22 +97,22 @@ async def post(
:type workspace_name: str
:param data_connectors_check_requirements: The parameters for requirements check message.
Required.
- :type data_connectors_check_requirements: IO
+ :type data_connectors_check_requirements: 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: 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],
+ data_connectors_check_requirements: Union[_models.DataConnectorsCheckRequirements, IO[bytes]],
**kwargs: Any
) -> _models.DataConnectorRequirementsState:
"""Get requirements state for a data connector type.
@@ -130,43 +123,36 @@ async def post(
: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.
+ either a DataConnectorsCheckRequirements type or a IO[bytes] 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
+ ~azure.mgmt.securityinsight.models.DataConnectorsCheckRequirements or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.DataConnectorRequirementsState] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(data_connectors_check_requirements, (IOBase, bytes)):
_content = data_connectors_check_requirements
else:
- _json = self._serialize.body(data_connectors_check_requirements, "DataConnectorsCheckRequirements")
+ _json = self._serialize.body(data_connectors_check_requirements, 'DataConnectorsCheckRequirements')
- request = build_post_request(
+ _request = build_post_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@@ -174,15 +160,16 @@ async def post(
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -191,13 +178,14 @@ async def post(
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)
+ deserialized = self._deserialize(
+ 'DataConnectorRequirementsState',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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..c2f091703276 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,47 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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
+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, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class DataConnectorsOperations:
+class DataConnectorsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -65,9 +49,15 @@ 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> AsyncIterable["_models.DataConnector"]:
"""Gets all data connectors.
@@ -76,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 DataConnector or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.DataConnector]
@@ -85,64 +74,57 @@ 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
)
- cls: ClsType[_models.DataConnectorList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("DataConnectorList", pipeline_response)
+ deserialized = self._deserialize(
+ "DataConnectorList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -152,15 +134,19 @@ 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/dataConnectors"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, data_connector_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_id: str,
+ **kwargs: Any
) -> _models.DataConnector:
"""Gets a data connector.
@@ -171,42 +157,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.DataConnector] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -215,16 +199,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}"
- }
@overload
async def create_or_update(
@@ -251,7 +236,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 +247,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,23 +262,23 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
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,42 +290,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.DataConnector] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +328,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -367,24 +346,25 @@ 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 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
- self, resource_group_name: str, workspace_name: str, data_connector_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_id: str,
+ **kwargs: Any
) -> None:
"""Delete the data connector.
@@ -395,42 +375,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -440,11 +418,9 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- 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
@@ -471,7 +447,6 @@ async def connect( # 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:
@@ -483,7 +458,7 @@ async def connect( # pylint: disable=inconsistent-return-statements
resource_group_name: str,
workspace_name: str,
data_connector_id: str,
- connect_body: IO,
+ connect_body: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -498,23 +473,23 @@ async def connect( # pylint: disable=inconsistent-return-statements
:param data_connector_id: Connector ID. Required.
:type data_connector_id: str
:param connect_body: The data connector. Required.
- :type connect_body: IO
+ :type connect_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: 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],
+ connect_body: Union[_models.DataConnectorConnectBody, IO[bytes]],
**kwargs: Any
) -> None:
"""Connects a data connector.
@@ -526,42 +501,36 @@ async def connect( # pylint: disable=inconsistent-return-statements
: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
+ :param connect_body: The data connector. Is either a DataConnectorConnectBody type or a
+ IO[bytes] type. Required.
+ :type connect_body: ~azure.mgmt.securityinsight.models.DataConnectorConnectBody or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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[None] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(connect_body, (IOBase, bytes)):
_content = connect_body
else:
- _json = self._serialize.body(connect_body, "DataConnectorConnectBody")
+ _json = self._serialize.body(connect_body, 'DataConnectorConnectBody')
- request = build_connect_request(
+ _request = build_connect_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_connector_id=data_connector_id,
@@ -570,15 +539,16 @@ async def connect( # pylint: disable=inconsistent-return-statements
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -588,15 +558,17 @@ async def connect( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_id: str,
+ **kwargs: Any
) -> None:
"""Disconnect a data connector.
@@ -607,42 +579,40 @@ async def disconnect( # 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_disconnect_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -652,8 +622,6 @@ async def disconnect( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- disconnect.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/disconnect"
- }
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
index 62111c6a7259..bf653823ad9f 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,37 +6,28 @@
# 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 typing import Any, Callable, Dict, IO, Optional, Type, 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.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_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
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class EntitiesGetTimelineOperations:
+class EntitiesGetTimelineOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -55,6 +46,9 @@ 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
async def list(
self,
@@ -81,7 +75,6 @@ async def list(
: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:
@@ -93,7 +86,7 @@ async def list(
resource_group_name: str,
workspace_name: str,
entity_id: str,
- parameters: IO,
+ parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -109,23 +102,23 @@ async def list(
:type entity_id: str
:param parameters: The parameters required to execute an timeline operation on the given
entity. Required.
- :type parameters: IO
+ :type parameters: 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: 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],
+ parameters: Union[_models.EntityTimelineParameters, IO[bytes]],
**kwargs: Any
) -> _models.EntityTimelineResponse:
"""Timeline for an entity.
@@ -138,42 +131,35 @@ async def list(
: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
+ entity. Is either a EntityTimelineParameters type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.securityinsight.models.EntityTimelineParameters or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.EntityTimelineResponse] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
- _json = self._serialize.body(parameters, "EntityTimelineParameters")
+ _json = self._serialize.body(parameters, 'EntityTimelineParameters')
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
entity_id=entity_id,
@@ -182,15 +168,16 @@ async def list(
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -199,13 +186,14 @@ 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("EntityTimelineResponse", pipeline_response)
+ deserialized = self._deserialize(
+ 'EntityTimelineResponse',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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..e18d1eb5a944 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,46 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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._entities_operations import (
- build_expand_request,
- build_get_insights_request,
- build_get_request,
- build_list_request,
- build_queries_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._entities_operations import build_expand_request, build_get_insights_request, build_get_request, build_list_request, build_queries_request, build_run_playbook_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class EntitiesOperations:
+class EntitiesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -64,8 +49,162 @@ 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
+ async def run_playbook( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_identifier: str,
+ request_body: Optional[_models.EntityManualTriggerRequestBody] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> 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_identifier: Entity identifier. 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
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def run_playbook( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_identifier: str,
+ request_body: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> 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_identifier: Entity identifier. 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
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def run_playbook( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_identifier: str,
+ request_body: Optional[Union[_models.EntityManualTriggerRequestBody, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> 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_identifier: Entity identifier. 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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[None] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(request_body, (IOBase, bytes)):
+ _content = request_body
+ else:
+ if request_body is not None:
+ _json = self._serialize.body(request_body, 'EntityManualTriggerRequestBody')
+ else:
+ _json = None
+
+ _request = build_run_playbook_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ entity_identifier=entity_identifier,
+ 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 [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
+
+
+
@distributed_trace
- def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> AsyncIterable["_models.Entity"]:
+ 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.
@@ -73,7 +212,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 Entity or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Entity]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -81,64 +219,57 @@ 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.EntityList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.EntityList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("EntityList", pipeline_response)
+ deserialized = self._deserialize(
+ "EntityList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -148,14 +279,20 @@ 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"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
- async def get(self, resource_group_name: str, workspace_name: str, entity_id: str, **kwargs: Any) -> _models.Entity:
+ 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.
@@ -165,42 +302,40 @@ async def get(self, resource_group_name: str, workspace_name: str, entity_id: st
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Entity] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.Entity] = kwargs.pop("cls", None)
- request = build_get_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -209,16 +344,17 @@ async def get(self, resource_group_name: str, workspace_name: str, entity_id: st
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)
+ deserialized = self._deserialize(
+ 'Entity',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}"
- }
@overload
async def expand(
@@ -246,7 +382,6 @@ async def expand(
: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:
@@ -258,7 +393,7 @@ async def expand(
resource_group_name: str,
workspace_name: str,
entity_id: str,
- parameters: IO,
+ parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -274,23 +409,23 @@ async def expand(
:type entity_id: str
:param parameters: The parameters required to execute an expand operation on the given entity.
Required.
- :type parameters: IO
+ :type parameters: 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
:raises ~azure.core.exceptions.HttpResponseError:
"""
+
@distributed_trace_async
async def expand(
self,
resource_group_name: str,
workspace_name: str,
entity_id: str,
- parameters: Union[_models.EntityExpandParameters, IO],
+ parameters: Union[_models.EntityExpandParameters, IO[bytes]],
**kwargs: Any
) -> _models.EntityExpandResponse:
"""Expands an entity.
@@ -303,42 +438,35 @@ async def expand(
: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
+ Is either a EntityExpandParameters type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.securityinsight.models.EntityExpandParameters or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.EntityExpandResponse] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
- _json = self._serialize.body(parameters, "EntityExpandParameters")
+ _json = self._serialize.body(parameters, 'EntityExpandParameters')
- request = build_expand_request(
+ _request = build_expand_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
entity_id=entity_id,
@@ -347,15 +475,16 @@ async def expand(
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -364,26 +493,27 @@ async def expand(
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)
+ deserialized = self._deserialize(
+ 'EntityExpandResponse',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
- return deserialized
+ return deserialized # type: ignore
- expand.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand"
- }
- @distributed_trace_async
- async def queries(
+
+ @distributed_trace
+ def queries(
self,
resource_group_name: str,
workspace_name: str,
entity_id: str,
kind: Union[str, _models.EntityItemQueryKind],
**kwargs: Any
- ) -> _models.GetQueriesResponse:
+ ) -> AsyncIterable["_models.EntityQueryItem"]:
"""Get Insights and Activities for an entity.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -395,61 +525,81 @@ async def queries(
: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
+ :return: An iterator like instance of either EntityQueryItem or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.EntityQueryItem]
: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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.GetQueriesResponse] = kwargs.pop(
+ 'cls', None
)
- 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)
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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_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,
+ 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
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize(
+ "GetQueriesResponse",
+ pipeline_response
)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return None, AsyncList(list_of_elem)
- response = pipeline_response.http_response
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
- 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)
+ _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("GetQueriesResponse", pipeline_response)
+ return pipeline_response
- if cls:
- return cls(pipeline_response, deserialized, {})
- return deserialized
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
- queries.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/queries"
- }
@overload
async def get_insights(
@@ -476,7 +626,6 @@ async def get_insights(
: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:
@@ -488,7 +637,7 @@ async def get_insights(
resource_group_name: str,
workspace_name: str,
entity_id: str,
- parameters: IO,
+ parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -503,23 +652,23 @@ async def get_insights(
: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
+ :type parameters: 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
: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],
+ parameters: Union[_models.EntityGetInsightsParameters, IO[bytes]],
**kwargs: Any
) -> _models.EntityGetInsightsResponse:
"""Execute Insights for an entity.
@@ -532,42 +681,35 @@ async def get_insights(
: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
+ EntityGetInsightsParameters type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.securityinsight.models.EntityGetInsightsParameters or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.EntityGetInsightsResponse] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
- _json = self._serialize.body(parameters, "EntityGetInsightsParameters")
+ _json = self._serialize.body(parameters, 'EntityGetInsightsParameters')
- request = build_get_insights_request(
+ _request = build_get_insights_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
entity_id=entity_id,
@@ -576,15 +718,16 @@ async def get_insights(
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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -593,13 +736,14 @@ async def get_insights(
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)
+ deserialized = self._deserialize(
+ 'EntityGetInsightsResponse',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get_insights.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights"
- }
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/_entities_relations_operations.py
index d232b818621f..fa051bf83b1f 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/_entities_relations_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,38 +7,28 @@
# 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
+from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.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.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
-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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class EntitiesRelationsOperations:
+class EntitiesRelationsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -57,6 +47,9 @@ 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,
@@ -90,7 +83,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:
@@ -98,23 +90,19 @@ 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
)
- cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,
@@ -124,43 +112,40 @@ 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
_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 = 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
+ _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("RelationList", pipeline_response)
+ deserialized = self._deserialize(
+ "RelationList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -170,8 +155,8 @@ 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"
- }
+ 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/_entity_queries_operations.py
index 2a53846738ea..752340ff9751 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/_entity_queries_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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 (
- 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
+from ...operations._entity_queries_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class EntityQueriesOperations:
+class EntityQueriesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,12 +49,15 @@ 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,
- kind: Optional[Union[str, _models.Enum13]] = None,
+ kind: Optional[Union[str, _models.EntityQueryTemplateKind]] = None,
**kwargs: Any
) -> AsyncIterable["_models.EntityQuery"]:
"""Gets all entity queries.
@@ -78,10 +67,10 @@ def list(
: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
+ :param kind: The entity query kind we want to fetch. Known values are: "Activity", "Insight",
+ "SecurityAlert", "Bookmark", "Expansion", "GuidedInsight", and "Anomaly". Default value is
+ None.
+ :type kind: str or ~azure.mgmt.securityinsight.models.EntityQueryTemplateKind
: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]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -89,65 +78,58 @@ 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.EntityQueryList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.EntityQueryList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("EntityQueryList", pipeline_response)
+ deserialized = self._deserialize(
+ "EntityQueryList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -157,15 +139,19 @@ 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/entityQueries"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, entity_query_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_query_id: str,
+ **kwargs: Any
) -> _models.EntityQuery:
"""Gets an entity query.
@@ -176,42 +162,40 @@ async def get(
: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
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.EntityQuery] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.EntityQuery] = 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,
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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -220,16 +204,17 @@ 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(
+ 'EntityQuery',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}"
- }
@overload
async def create_or_update(
@@ -256,7 +241,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: EntityQuery or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.EntityQuery
:raises ~azure.core.exceptions.HttpResponseError:
@@ -268,7 +252,7 @@ async def create_or_update(
resource_group_name: str,
workspace_name: str,
entity_query_id: str,
- entity_query: IO,
+ entity_query: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -283,23 +267,23 @@ async def create_or_update(
: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
+ :type entity_query: 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
:raises ~azure.core.exceptions.HttpResponseError:
"""
+
@distributed_trace_async
async def create_or_update(
self,
resource_group_name: str,
workspace_name: str,
entity_query_id: str,
- entity_query: Union[_models.CustomEntityQuery, IO],
+ entity_query: Union[_models.CustomEntityQuery, IO[bytes]],
**kwargs: Any
) -> _models.EntityQuery:
"""Creates or updates the entity query.
@@ -311,43 +295,36 @@ async def create_or_update(
: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
+ :param entity_query: The entity query we want to create or update. Is either a
+ CustomEntityQuery type or a IO[bytes] type. Required.
+ :type entity_query: ~azure.mgmt.securityinsight.models.CustomEntityQuery or IO[bytes]
:return: EntityQuery or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.EntityQuery
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.EntityQuery] = kwargs.pop(
+ 'cls', None
)
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.EntityQuery] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(entity_query, (IO, bytes)):
+ if isinstance(entity_query, (IOBase, bytes)):
_content = entity_query
else:
- _json = self._serialize.body(entity_query, "CustomEntityQuery")
+ _json = self._serialize.body(entity_query, 'CustomEntityQuery')
- 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,
@@ -356,15 +333,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -373,24 +351,25 @@ 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(
+ 'EntityQuery',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
+ 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_query_id: str,
+ **kwargs: Any
) -> None:
"""Delete the entity query.
@@ -401,42 +380,40 @@ async def delete( # pylint: disable=inconsistent-return-statements
: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: 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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,
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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -446,8 +423,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}"
- }
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/_entity_query_templates_operations.py
index e2f34e18fc04..41ff9b9b45da 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/_entity_query_templates_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,39 +7,29 @@
# 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, Type, TypeVar, Union
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.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.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
-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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class EntityQueryTemplatesOperations:
+class EntityQueryTemplatesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -58,12 +48,15 @@ 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,
- kind: Optional[Union[str, _models.Enum15]] = None,
+ kind: Optional[Union[str, _models.EntityQueryTemplateKind]] = None,
**kwargs: Any
) -> AsyncIterable["_models.EntityQueryTemplate"]:
"""Gets all entity query templates.
@@ -73,9 +66,10 @@ def list(
: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
+ :param kind: The entity template query kind we want to fetch. Known values are: "Activity",
+ "Insight", "SecurityAlert", "Bookmark", "Expansion", "GuidedInsight", and "Anomaly". Default
+ value is None.
+ :type kind: str or ~azure.mgmt.securityinsight.models.EntityQueryTemplateKind
:return: An iterator like instance of either EntityQueryTemplate or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.EntityQueryTemplate]
@@ -84,65 +78,58 @@ 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.EntityQueryTemplateList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.EntityQueryTemplateList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("EntityQueryTemplateList", pipeline_response)
+ deserialized = self._deserialize(
+ "EntityQueryTemplateList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -152,15 +139,19 @@ 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/entityQueryTemplates"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, entity_query_template_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_query_template_id: str,
+ **kwargs: Any
) -> _models.EntityQueryTemplate:
"""Gets an entity query.
@@ -171,42 +162,40 @@ async def get(
: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
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.EntityQueryTemplate] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.EntityQueryTemplate] = 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,
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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -215,13 +204,14 @@ 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(
+ 'EntityQueryTemplate',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{entityQueryTemplateId}"
- }
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
index 9cb8ac64c04b..933b8f799026 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,36 +7,26 @@
# 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 typing import Any, Callable, Dict, Optional, Type, 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.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._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
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class EntityRelationsOperations:
+class EntityRelationsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -55,9 +45,17 @@ 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_async
async def get_relation(
- self, resource_group_name: str, workspace_name: str, entity_id: str, relation_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_id: str,
+ relation_name: str,
+ **kwargs: Any
) -> _models.Relation:
"""Gets an entity relation.
@@ -70,43 +68,41 @@ async def get_relation(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Relation] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
- request = build_get_relation_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -115,13 +111,14 @@ async def get_relation(
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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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
index 5636b9487428..656bb4b42a33 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,23 +6,16 @@
# 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, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, 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.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, StreamConsumedError, 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.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
@@ -30,23 +23,16 @@
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
+from ...operations._file_imports_operations import build_create_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class FileImportsOperations:
+class FileImportsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -65,6 +51,9 @@ 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,
@@ -95,7 +84,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 FileImport or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.FileImport]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -103,23 +91,19 @@ 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.FileImportList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.FileImportList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,
@@ -128,61 +112,63 @@ 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
_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 = 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
+ _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("FileImportList", pipeline_response)
+ deserialized = self._deserialize(
+ "FileImportList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, 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"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, file_import_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ file_import_id: str,
+ **kwargs: Any
) -> _models.FileImport:
"""Gets a file import.
@@ -193,60 +179,60 @@ async def get(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.FileImport] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.FileImport] = kwargs.pop("cls", None)
- request = build_get_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("FileImport", pipeline_response)
+ deserialized = self._deserialize(
+ 'FileImport',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}"
- }
@overload
async def create(
@@ -273,7 +259,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: FileImport or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.FileImport
:raises ~azure.core.exceptions.HttpResponseError:
@@ -285,7 +270,7 @@ async def create(
resource_group_name: str,
workspace_name: str,
file_import_id: str,
- file_import: IO,
+ file_import: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -300,23 +285,23 @@ async def create(
:param file_import_id: File import ID. Required.
:type file_import_id: str
:param file_import: The file import. Required.
- :type file_import: IO
+ :type file_import: 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: 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],
+ file_import: Union[_models.FileImport, IO[bytes]],
**kwargs: Any
) -> _models.FileImport:
"""Creates the file import.
@@ -328,42 +313,35 @@ async def create(
: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
+ :param file_import: The file import. Is either a FileImport type or a IO[bytes] type. Required.
+ :type file_import: ~azure.mgmt.securityinsight.models.FileImport or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.FileImport] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(file_import, (IOBase, bytes)):
_content = file_import
else:
- _json = self._serialize.body(file_import, "FileImport")
+ _json = self._serialize.body(file_import, 'FileImport')
- request = build_create_request(
+ _request = build_create_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
file_import_id=file_import_id,
@@ -372,92 +350,109 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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 [201]:
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("FileImport", pipeline_response)
+ deserialized = self._deserialize(
+ 'FileImport',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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,
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ file_import_id: str,
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[Optional[_models.FileImport]] = kwargs.pop("cls", None)
- request = build_delete_request(
+
+ _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
+ _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)
- 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)
- deserialized = None
+ response_headers = {}
if response.status_code == 202:
- deserialized = self._deserialize("FileImport", pipeline_response)
+ 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, {})
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
- 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ file_import_id: str,
+ **kwargs: Any
) -> AsyncLROPoller[_models.FileImport]:
"""Delete the file import.
@@ -468,14 +463,6 @@ async def begin_delete(
: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]
@@ -484,49 +471,62 @@ async def begin_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[_models.FileImport] = kwargs.pop(
+ 'cls', None
+ )
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True)
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
)
- 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)
+ 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,
+ cls=lambda x,y,z: x,
headers=_headers,
params=_params,
**kwargs
)
- kwargs.pop("error_map", None)
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("FileImport", pipeline_response)
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
+
+ deserialized = self._deserialize(
+ 'FileImport',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
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
+ 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(
+ return AsyncLROPoller[_models.FileImport].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
- deserialization_callback=get_long_running_output,
+ deserialization_callback=get_long_running_output
)
- return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+ return AsyncLROPoller[_models.FileImport](
+ 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
index 015f667e45a7..ec3d661609c9 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,36 +7,26 @@
# 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 typing import Any, Callable, Dict, Optional, Type, 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.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_operations import build_single_recommendation_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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class GetOperations:
+class GetOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -55,9 +45,16 @@ 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_async
async def single_recommendation(
- self, resource_group_name: str, workspace_name: str, recommendation_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ recommendation_id: str,
+ **kwargs: Any
) -> _models.Recommendation:
"""Gets a recommendation by its id.
@@ -68,42 +65,40 @@ async def single_recommendation(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Recommendation] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.Recommendation] = kwargs.pop("cls", None)
- request = build_single_recommendation_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -112,13 +107,14 @@ async 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(
+ 'Recommendation',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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/_get_recommendations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_get_recommendations_operations.py
index e46e68a6f58a..2fedc1144021 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/_get_recommendations_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,36 +7,28 @@
# 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 typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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_async import distributed_trace_async
+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._get_recommendations_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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class GetRecommendationsOperations:
+class GetRecommendationsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -55,8 +47,16 @@ 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_async
- async def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.RecommendationList:
+
+
+
+ @distributed_trace
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.Recommendation"]:
"""Gets a list of all recommendations.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -64,56 +64,76 @@ async def list(self, resource_group_name: str, workspace_name: str, **kwargs: An
: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
+ :return: An iterator like instance of either Recommendation or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~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.RecommendationList] = 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,
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.RecommendationList] = kwargs.pop(
+ 'cls', None
)
- 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
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "RecommendationList",
+ 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)
- response = pipeline_response.http_response
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
- 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)
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
+ )
+ response = pipeline_response.http_response
- deserialized = self._deserialize("RecommendationList", pipeline_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, deserialized, {})
+ return pipeline_response
- return deserialized
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_get_triggered_analytics_rule_runs_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_get_triggered_analytics_rule_runs_operations.py
new file mode 100644
index 000000000000..f863a6bf071c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_get_triggered_analytics_rule_runs_operations.py
@@ -0,0 +1,140 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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._get_triggered_analytics_rule_runs_operations import build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class GetTriggeredAnalyticsRuleRunsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`get_triggered_analytics_rule_runs` 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.TriggeredAnalyticsRuleRun"]:
+ """Gets the triggered analytics rule runs.
+
+ :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
+ :return: An iterator like instance of either TriggeredAnalyticsRuleRun or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.TriggeredAnalyticsRuleRun]
+ :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.TriggeredAnalyticsRuleRuns] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "TriggeredAnalyticsRuleRuns",
+ 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/_hunt_comments_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_hunt_comments_operations.py
new file mode 100644
index 000000000000..4222fb70f157
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_hunt_comments_operations.py
@@ -0,0 +1,464 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...operations._hunt_comments_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class HuntCommentsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`hunt_comments` 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,
+ hunt_id: str,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.HuntComment"]:
+ """Gets all hunt comments.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_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
+ :return: An iterator like instance of either HuntComment or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.HuntComment]
+ :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.HuntCommentList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ hunt_id=hunt_id,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ orderby=orderby,
+ top=top,
+ 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(
+ "HuntCommentList",
+ 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
+ )
+
+
+ @distributed_trace_async
+ async def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_id: str,
+ **kwargs: Any
+ ) -> _models.HuntComment:
+ """Gets a hunt comment.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_comment_id: The hunt comment id (GUID). Required.
+ :type hunt_comment_id: str
+ :return: HuntComment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntComment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.HuntComment] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_id,
+ hunt_comment_id=hunt_comment_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(
+ 'HuntComment',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_id: str,
+ **kwargs: Any
+ ) -> None:
+ """Delete a hunt comment.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_comment_id: The hunt comment id (GUID). Required.
+ :type hunt_comment_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ hunt_id=hunt_id,
+ hunt_comment_id=hunt_comment_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
+
+
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_id: str,
+ hunt_comment: _models.HuntComment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.HuntComment:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_comment_id: The hunt comment id (GUID). Required.
+ :type hunt_comment_id: str
+ :param hunt_comment: The hunt comment. Required.
+ :type hunt_comment: ~azure.mgmt.securityinsight.models.HuntComment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: HuntComment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntComment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_id: str,
+ hunt_comment: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.HuntComment:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_comment_id: The hunt comment id (GUID). Required.
+ :type hunt_comment_id: str
+ :param hunt_comment: The hunt comment. Required.
+ :type hunt_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
+ :return: HuntComment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntComment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_id: str,
+ hunt_comment: Union[_models.HuntComment, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.HuntComment:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_comment_id: The hunt comment id (GUID). Required.
+ :type hunt_comment_id: str
+ :param hunt_comment: The hunt comment. Is either a HuntComment type or a IO[bytes] type.
+ Required.
+ :type hunt_comment: ~azure.mgmt.securityinsight.models.HuntComment or IO[bytes]
+ :return: HuntComment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntComment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.HuntComment] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(hunt_comment, (IOBase, bytes)):
+ _content = hunt_comment
+ else:
+ _json = self._serialize.body(hunt_comment, 'HuntComment')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_id,
+ hunt_comment_id=hunt_comment_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(
+ 'HuntComment',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_hunt_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_hunt_relations_operations.py
new file mode 100644
index 000000000000..5ca3784bbaad
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_hunt_relations_operations.py
@@ -0,0 +1,465 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...operations._hunt_relations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class HuntRelationsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`hunt_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,
+ hunt_id: str,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.HuntRelation"]:
+ """Gets all hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_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
+ :return: An iterator like instance of either HuntRelation or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.HuntRelation]
+ :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.HuntRelationList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ hunt_id=hunt_id,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ orderby=orderby,
+ top=top,
+ 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(
+ "HuntRelationList",
+ 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
+ )
+
+
+ @distributed_trace_async
+ async def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_id: str,
+ **kwargs: Any
+ ) -> _models.HuntRelation:
+ """Gets a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_relation_id: The hunt relation id (GUID). Required.
+ :type hunt_relation_id: str
+ :return: HuntRelation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntRelation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.HuntRelation] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_id,
+ hunt_relation_id=hunt_relation_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(
+ 'HuntRelation',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_id: str,
+ **kwargs: Any
+ ) -> None:
+ """Delete a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_relation_id: The hunt relation id (GUID). Required.
+ :type hunt_relation_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ hunt_id=hunt_id,
+ hunt_relation_id=hunt_relation_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
+
+
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_id: str,
+ hunt_relation: _models.HuntRelation,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.HuntRelation:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_relation_id: The hunt relation id (GUID). Required.
+ :type hunt_relation_id: str
+ :param hunt_relation: The hunt relation. Required.
+ :type hunt_relation: ~azure.mgmt.securityinsight.models.HuntRelation
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: HuntRelation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntRelation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_id: str,
+ hunt_relation: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.HuntRelation:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_relation_id: The hunt relation id (GUID). Required.
+ :type hunt_relation_id: str
+ :param hunt_relation: The hunt relation. Required.
+ :type hunt_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
+ :return: HuntRelation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntRelation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_id: str,
+ hunt_relation: Union[_models.HuntRelation, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.HuntRelation:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_relation_id: The hunt relation id (GUID). Required.
+ :type hunt_relation_id: str
+ :param hunt_relation: The hunt relation. Is either a HuntRelation type or a IO[bytes] type.
+ Required.
+ :type hunt_relation: ~azure.mgmt.securityinsight.models.HuntRelation or IO[bytes]
+ :return: HuntRelation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntRelation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.HuntRelation] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(hunt_relation, (IOBase, bytes)):
+ _content = hunt_relation
+ else:
+ _json = self._serialize.body(hunt_relation, 'HuntRelation')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_id,
+ hunt_relation_id=hunt_relation_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(
+ 'HuntRelation',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_hunts_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_hunts_operations.py
new file mode 100644
index 000000000000..cf077cfa6354
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_hunts_operations.py
@@ -0,0 +1,441 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...operations._hunts_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class HuntsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`hunts` 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.Hunt"]:
+ """Gets all hunts, without relations and comments.
+
+ :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
+ :return: An iterator like instance of either Hunt or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Hunt]
+ :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.HuntList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "HuntList",
+ 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
+ )
+
+
+ @distributed_trace_async
+ async def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ **kwargs: Any
+ ) -> _models.Hunt:
+ """Gets a hunt, without relations and comments.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :return: Hunt or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Hunt
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.Hunt] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_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(
+ 'Hunt',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ **kwargs: Any
+ ) -> None:
+ """Delete a hunt.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ hunt_id=hunt_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
+
+
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt: _models.Hunt,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Hunt:
+ """Create or update a hunt.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt: The hunt. Required.
+ :type hunt: ~azure.mgmt.securityinsight.models.Hunt
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: Hunt or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Hunt
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Hunt:
+ """Create or update a hunt.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt: The hunt. Required.
+ :type hunt: 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: Hunt or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Hunt
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt: Union[_models.Hunt, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.Hunt:
+ """Create or update a hunt.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt: The hunt. Is either a Hunt type or a IO[bytes] type. Required.
+ :type hunt: ~azure.mgmt.securityinsight.models.Hunt or IO[bytes]
+ :return: Hunt or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Hunt
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.Hunt] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(hunt, (IOBase, bytes)):
+ _content = hunt
+ else:
+ _json = self._serialize.body(hunt, 'Hunt')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_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(
+ 'Hunt',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
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..4a29cf8723de 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._incident_comments_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class IncidentCommentsOperations:
+class IncidentCommentsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,6 +49,9 @@ 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,
@@ -96,7 +85,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,23 +93,19 @@ 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
)
- cls: ClsType[_models.IncidentCommentList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,43 +115,40 @@ 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
_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 = 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
+ _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("IncidentCommentList", pipeline_response)
+ deserialized = self._deserialize(
+ "IncidentCommentList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -177,15 +158,20 @@ 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/incidents/{incidentId}/comments"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, incident_id: str, incident_comment_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ incident_comment_id: str,
+ **kwargs: Any
) -> _models.IncidentComment:
"""Gets an incident comment.
@@ -198,43 +184,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.IncidentComment] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -243,16 +227,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}"
- }
@overload
async def create_or_update(
@@ -282,7 +267,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,7 +279,7 @@ 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
@@ -312,16 +296,16 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
@@ -329,7 +313,7 @@ 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.
@@ -343,42 +327,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.IncidentComment] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +366,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -405,24 +384,26 @@ 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 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
- self, resource_group_name: str, workspace_name: str, incident_id: str, incident_comment_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ incident_comment_id: str,
+ **kwargs: Any
) -> None:
"""Delete the incident comment.
@@ -435,43 +416,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -481,8 +460,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}"
- }
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..07b900a74aef 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._incident_relations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class IncidentRelationsOperations:
+class IncidentRelationsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,6 +49,9 @@ 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,
@@ -96,7 +85,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,23 +92,19 @@ 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
)
- cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,43 +114,40 @@ 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
_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 = 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
+ _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("RelationList", pipeline_response)
+ deserialized = self._deserialize(
+ "RelationList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -176,15 +157,20 @@ 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/incidents/{incidentId}/relations"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, incident_id: str, relation_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ relation_name: str,
+ **kwargs: Any
) -> _models.Relation:
"""Gets an incident relation.
@@ -197,43 +183,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Relation] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -242,16 +226,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}"
- }
@overload
async def create_or_update(
@@ -281,7 +266,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,7 +278,7 @@ 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
@@ -311,16 +295,16 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
@@ -328,7 +312,7 @@ 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.
@@ -342,42 +326,35 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Relation] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +364,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -404,24 +382,26 @@ 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 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
- self, resource_group_name: str, workspace_name: str, incident_id: str, relation_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ relation_name: str,
+ **kwargs: Any
) -> None:
"""Delete the incident relation.
@@ -434,43 +414,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -480,8 +458,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}"
- }
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..490cebdc9b21 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._incident_tasks_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class IncidentTasksOperations:
+class IncidentTasksOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,9 +49,16 @@ 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, incident_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> AsyncIterable["_models.IncidentTask"]:
"""Gets all incident tasks.
@@ -76,7 +69,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,65 +77,58 @@ 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
)
- cls: ClsType[_models.IncidentTaskList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("IncidentTaskList", pipeline_response)
+ deserialized = self._deserialize(
+ "IncidentTaskList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -153,15 +138,20 @@ 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/incidents/{incidentId}/tasks"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, incident_id: str, incident_task_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ incident_task_id: str,
+ **kwargs: Any
) -> _models.IncidentTask:
"""Gets an incident task.
@@ -174,43 +164,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.IncidentTask] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -219,16 +207,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}"
- }
@overload
async def create_or_update(
@@ -258,7 +247,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 +259,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,16 +276,16 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
@@ -305,7 +293,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,42 +307,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.IncidentTask] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +346,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -381,24 +364,26 @@ 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 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
- self, resource_group_name: str, workspace_name: str, incident_id: str, incident_task_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ incident_task_id: str,
+ **kwargs: Any
) -> None:
"""Delete the incident task.
@@ -411,43 +396,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -457,8 +440,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}"
- }
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..d69e7cc577b1 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,55 +6,32 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_list_bookmarks_request,
- build_list_entities_request,
- build_list_request,
- build_run_playbook_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, build_list_bookmarks_request, build_list_entities_request, build_list_request, build_run_playbook_request
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
-T = TypeVar("T")
+JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class IncidentsOperations:
+class IncidentsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -73,6 +50,9 @@ 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
async def run_playbook(
self,
@@ -98,7 +78,6 @@ async def run_playbook(
: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
:raises ~azure.core.exceptions.HttpResponseError:
@@ -110,7 +89,7 @@ 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
@@ -125,23 +104,23 @@ async def run_playbook(
:param incident_identifier: Required.
:type incident_identifier: str
:param request_body: Default value is None.
- :type request_body: IO
+ :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
:raises ~azure.core.exceptions.HttpResponseError:
"""
+
@distributed_trace_async
async def run_playbook(
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:
"""Triggers playbook on a specific incident.
@@ -153,45 +132,39 @@ async def run_playbook(
:type workspace_name: str
:param incident_identifier: 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
+ :param request_body: 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: JSON or the result of cls(response)
:rtype: JSON
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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[JSON] = kwargs.pop(
+ 'cls', None
)
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[JSON] = 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:
- _json = self._serialize.body(request_body, "ManualTriggerRequestBody")
+ _json = self._serialize.body(request_body, 'ManualTriggerRequestBody')
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 +173,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -217,16 +191,17 @@ 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)
+ deserialized = self._deserialize(
+ 'object',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- run_playbook.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentIdentifier}/runPlaybook"
- }
@distributed_trace
def list(
@@ -258,7 +233,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,23 +240,19 @@ 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
)
- cls: ClsType[_models.IncidentList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,43 +261,40 @@ 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
_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 = 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
+ _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("IncidentList", pipeline_response)
+ deserialized = self._deserialize(
+ "IncidentList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -337,15 +304,19 @@ 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/incidents"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> _models.Incident:
"""Gets an incident.
@@ -356,42 +327,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Incident] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -400,16 +369,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}"
- }
@overload
async def create_or_update(
@@ -436,7 +406,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,7 +417,7 @@ 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
@@ -463,23 +432,23 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
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.
@@ -491,42 +460,35 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Incident] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +497,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -552,24 +515,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> None:
"""Delete the incident.
@@ -580,42 +544,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -625,11 +587,9 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}"
- }
@overload
async def create_team(
@@ -657,7 +617,6 @@ async def create_team(
: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:
@@ -669,7 +628,7 @@ async def create_team(
resource_group_name: str,
workspace_name: str,
incident_id: str,
- team_properties: IO,
+ team_properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -685,23 +644,23 @@ async def create_team(
:param incident_id: Incident ID. Required.
:type incident_id: str
:param team_properties: Team properties. Required.
- :type team_properties: IO
+ :type team_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: 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],
+ team_properties: Union[_models.TeamInformation, IO[bytes]],
**kwargs: Any
) -> _models.TeamInformation:
"""Creates a Microsoft team to investigate the incident by sharing information and insights
@@ -714,42 +673,36 @@ async def create_team(
: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
+ :param team_properties: Team properties. Is either a TeamInformation type or a IO[bytes] type.
+ Required.
+ :type team_properties: ~azure.mgmt.securityinsight.models.TeamInformation or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.TeamInformation] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(team_properties, (IOBase, bytes)):
_content = team_properties
else:
- _json = self._serialize.body(team_properties, "TeamInformation")
+ _json = self._serialize.body(team_properties, 'TeamInformation')
- request = build_create_team_request(
+ _request = build_create_team_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -758,15 +711,16 @@ async def create_team(
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -775,20 +729,25 @@ async def create_team(
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)
+ deserialized = self._deserialize(
+ 'TeamInformation',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- create_team.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/createTeam"
- }
@distributed_trace_async
async def list_alerts(
- self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> _models.IncidentAlertList:
"""Gets all incident alerts.
@@ -799,42 +758,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.IncidentAlertList] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -843,20 +800,25 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- list_alerts.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/alerts"
- }
@distributed_trace_async
async def list_bookmarks(
- self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> _models.IncidentBookmarkList:
"""Gets all incident bookmarks.
@@ -867,42 +829,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.IncidentBookmarkList] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -911,20 +871,25 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- list_bookmarks.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/bookmarks"
- }
@distributed_trace_async
async def list_entities(
- self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> _models.IncidentEntitiesResponse:
"""Gets all incident related entities.
@@ -935,42 +900,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.IncidentEntitiesResponse] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -979,13 +942,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- list_entities.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/entities"
- }
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..6374559b2cd3 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,46 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- 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
+from ...operations._metadata_operations import build_create_request, build_delete_request, build_get_request, build_list_request, build_update_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class MetadataOperations:
+class MetadataOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -64,6 +49,9 @@ 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,
@@ -92,7 +80,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,23 +88,19 @@ 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
)
- cls: ClsType[_models.MetadataList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,43 +109,40 @@ 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
_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 = 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
+ _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("MetadataList", pipeline_response)
+ deserialized = self._deserialize(
+ "MetadataList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -172,15 +152,19 @@ 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/metadata"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, metadata_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ metadata_name: str,
+ **kwargs: Any
) -> _models.MetadataModel:
"""Get a Metadata.
@@ -191,42 +175,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.MetadataModel] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -235,20 +217,25 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
@distributed_trace_async
async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, metadata_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ metadata_name: str,
+ **kwargs: Any
) -> None:
"""Delete a Metadata.
@@ -259,42 +246,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -304,11 +289,9 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
@overload
async def create(
@@ -335,7 +318,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 +329,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,23 +344,23 @@ 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:
"""
+
@distributed_trace_async
async def create(
self,
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,42 +372,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.MetadataModel] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +410,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -451,20 +428,17 @@ 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 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(
@@ -491,7 +465,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 +476,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,23 +491,23 @@ 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:
"""
+
@distributed_trace_async
async def update(
self,
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,42 +519,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.MetadataModel] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +557,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -607,13 +575,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
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
index fffada186187..cf1bfac06af9 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,39 +7,29 @@
# 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
+from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.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.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._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
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class OfficeConsentsOperations:
+class OfficeConsentsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -58,9 +48,15 @@ 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> AsyncIterable["_models.OfficeConsent"]:
"""Gets all office365 consents.
@@ -69,7 +65,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 OfficeConsent or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.OfficeConsent]
@@ -78,64 +73,57 @@ 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.OfficeConsentList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.OfficeConsentList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("OfficeConsentList", pipeline_response)
+ deserialized = self._deserialize(
+ "OfficeConsentList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -145,15 +133,19 @@ 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/officeConsents"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, consent_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ consent_id: str,
+ **kwargs: Any
) -> _models.OfficeConsent:
"""Gets an office365 consent.
@@ -164,42 +156,40 @@ async def get(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.OfficeConsent] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.OfficeConsent] = 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,
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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -208,20 +198,25 @@ 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("OfficeConsent", pipeline_response)
+ deserialized = self._deserialize(
+ 'OfficeConsent',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ consent_id: str,
+ **kwargs: Any
) -> None:
"""Delete the office365 consent.
@@ -232,42 +227,40 @@ async def delete( # pylint: disable=inconsistent-return-statements
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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,
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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -277,8 +270,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- 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..60f41361d220 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,38 +7,28 @@
# 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
+from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class Operations:
+class Operations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -57,11 +47,16 @@ 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, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
+ 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,61 +64,54 @@ 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
)
- cls: ClsType[_models.OperationsList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("OperationsList", pipeline_response)
+ deserialized = self._deserialize(
+ "OperationsList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -133,6 +121,8 @@ async def get_next(next_link=None):
return pipeline_response
- return AsyncItemPaged(get_next, extract_data)
- list.metadata = {"url": "/providers/Microsoft.SecurityInsights/operations"}
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_package_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_package_operations.py
new file mode 100644
index 000000000000..70dfd1d71933
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_package_operations.py
@@ -0,0 +1,120 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, TypeVar
+
+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._product_package_operations import build_get_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+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:`product_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")
+
+
+
+
+ @distributed_trace_async
+ 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
+ :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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.ProductPackageModel] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _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,
+ 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(
+ 'ProductPackageModel',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_packages_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_packages_operations.py
new file mode 100644
index 000000000000..fbd5711000da
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_packages_operations.py
@@ -0,0 +1,164 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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_packages_operations import build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+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:`product_packages` 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.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 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
+ :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: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.ProductPackageList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "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)
+
+ _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/_product_settings_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_settings_operations.py
index 3324a16bab68..8090a3377863 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,42 +6,31 @@
# 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 typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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._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
+from ...operations._product_settings_operations import build_delete_request, build_get_request, build_list_request, build_update_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class ProductSettingsOperations:
+class ProductSettingsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -60,8 +49,16 @@ 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_async
- async def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _models.SettingList:
+
+
+
+ @distributed_trace
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.Settings"]:
"""List of all the settings.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -69,63 +66,86 @@ async def list(self, resource_group_name: str, workspace_name: str, **kwargs: An
: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
+ :return: An iterator like instance of either Settings or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.SettingList] = kwargs.pop(
+ 'cls', None
)
- 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,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "SettingList",
+ pipeline_response
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
- response = pipeline_response.http_response
+ _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)
+ 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)
+ return pipeline_response
- if cls:
- return cls(pipeline_response, deserialized, {})
- return deserialized
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
- 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ settings_name: str,
+ **kwargs: Any
) -> _models.Settings:
"""Gets a setting.
@@ -137,42 +157,40 @@ async def get(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Settings] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.Settings] = kwargs.pop("cls", None)
- request = build_get_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -181,20 +199,25 @@ 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("Settings", pipeline_response)
+ deserialized = self._deserialize(
+ 'Settings',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ settings_name: str,
+ **kwargs: Any
) -> None:
"""Delete setting of the product.
@@ -206,42 +229,40 @@ async def delete( # pylint: disable=inconsistent-return-statements
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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_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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -251,11 +272,9 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}"
- }
@overload
async def update(
@@ -283,7 +302,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: Settings or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Settings
:raises ~azure.core.exceptions.HttpResponseError:
@@ -295,7 +313,7 @@ async def update(
resource_group_name: str,
workspace_name: str,
settings_name: str,
- settings: IO,
+ settings: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -311,23 +329,23 @@ async def update(
Required.
:type settings_name: str
:param settings: The setting. Required.
- :type settings: IO
+ :type settings: 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: 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],
+ settings: Union[_models.Settings, IO[bytes]],
**kwargs: Any
) -> _models.Settings:
"""Updates setting.
@@ -340,42 +358,35 @@ async def update(
: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
+ :param settings: The setting. Is either a Settings type or a IO[bytes] type. Required.
+ :type settings: ~azure.mgmt.securityinsight.models.Settings or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Settings] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(settings, (IOBase, bytes)):
_content = settings
else:
- _json = self._serialize.body(settings, "Settings")
+ _json = self._serialize.body(settings, 'Settings')
- request = build_update_request(
+ _request = build_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
settings_name=settings_name,
@@ -384,30 +395,32 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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]:
+ 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("Settings", pipeline_response)
+ deserialized = self._deserialize(
+ 'Settings',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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/_product_template_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_template_operations.py
new file mode 100644
index 000000000000..6fd57db9ce66
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_template_operations.py
@@ -0,0 +1,120 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, TypeVar
+
+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._product_template_operations import build_get_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+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:`product_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")
+
+
+
+
+ @distributed_trace_async
+ 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 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.ProductTemplateModel] = 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(
+ 'ProductTemplateModel',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ 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..f25b3a6b6483
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_product_templates_operations.py
@@ -0,0 +1,174 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # pylint: disable=ungrouped-imports
+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[int, Type[HttpResponseError]] = {
+ 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/_reevaluate_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_reevaluate_operations.py
new file mode 100644
index 000000000000..7ca80b9ebb29
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_reevaluate_operations.py
@@ -0,0 +1,120 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, TypeVar
+
+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._reevaluate_operations import build_recommendation_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class ReevaluateOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`reevaluate` 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 recommendation(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ recommendation_id: str,
+ **kwargs: Any
+ ) -> _models.ReevaluateResponse:
+ """Reevaluate 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
+ :return: ReevaluateResponse or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ReevaluateResponse
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.ReevaluateResponse] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _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,
+ 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(
+ 'ReevaluateResponse',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_security_insights_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_security_insights_operations.py
new file mode 100644
index 000000000000..c5a787c4032b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_security_insights_operations.py
@@ -0,0 +1,327 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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._security_insights_operations import build_list_geodata_by_ip_request, build_list_whois_by_domain_request
+from .._vendor import SecurityInsightsMixinABC
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class SecurityInsightsOperationsMixin(
+ SecurityInsightsMixinABC
+):
+
+ @overload
+ async def list_geodata_by_ip(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ ip_address_body: _models.EnrichmentIpAddressBody,
+ *,
+ content_type: str = "application/json",
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param ip_address_body: IP address (v4 or v6) to be enriched. Required.
+ :type ip_address_body: ~azure.mgmt.securityinsight.models.EnrichmentIpAddressBody
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: EnrichmentIpGeodata or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentIpGeodata
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def list_geodata_by_ip(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ ip_address_body: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param ip_address_body: IP address (v4 or v6) to be enriched. Required.
+ :type ip_address_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
+ :return: EnrichmentIpGeodata or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentIpGeodata
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def list_geodata_by_ip(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ ip_address_body: Union[_models.EnrichmentIpAddressBody, IO[bytes]],
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param ip_address_body: IP address (v4 or v6) to be enriched. Is either a
+ EnrichmentIpAddressBody type or a IO[bytes] type. Required.
+ :type ip_address_body: ~azure.mgmt.securityinsight.models.EnrichmentIpAddressBody or IO[bytes]
+ :return: EnrichmentIpGeodata or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentIpGeodata
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.EnrichmentIpGeodata] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(ip_address_body, (IOBase, bytes)):
+ _content = ip_address_body
+ else:
+ _json = self._serialize.body(ip_address_body, 'EnrichmentIpAddressBody')
+
+ _request = build_list_geodata_by_ip_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ enrichment_type=enrichment_type,
+ 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( # type: ignore # 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(
+ 'EnrichmentIpGeodata',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ async def list_whois_by_domain(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ domain_body: _models.EnrichmentDomainBody,
+ *,
+ content_type: str = "application/json",
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param domain_body: Domain name to be enriched. Only domain name is accepted. Required.
+ :type domain_body: ~azure.mgmt.securityinsight.models.EnrichmentDomainBody
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: EnrichmentDomainWhois or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhois
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def list_whois_by_domain(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ domain_body: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param domain_body: Domain name to be enriched. Only domain name is accepted. Required.
+ :type domain_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
+ :return: EnrichmentDomainWhois or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhois
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def list_whois_by_domain(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ domain_body: Union[_models.EnrichmentDomainBody, IO[bytes]],
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param domain_body: Domain name to be enriched. Only domain name is accepted. Is either a
+ EnrichmentDomainBody type or a IO[bytes] type. Required.
+ :type domain_body: ~azure.mgmt.securityinsight.models.EnrichmentDomainBody or IO[bytes]
+ :return: EnrichmentDomainWhois or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhois
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.EnrichmentDomainWhois] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(domain_body, (IOBase, bytes)):
+ _content = domain_body
+ else:
+ _json = self._serialize.body(domain_body, 'EnrichmentDomainBody')
+
+ _request = build_list_whois_by_domain_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ enrichment_type=enrichment_type,
+ 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( # type: ignore # 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(
+ 'EnrichmentDomainWhois',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
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..ca71c2144f60 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._security_ml_analytics_settings_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class SecurityMLAnalyticsSettingsOperations:
+class SecurityMLAnalyticsSettingsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,9 +49,15 @@ 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> AsyncIterable["_models.SecurityMLAnalyticsSetting"]:
"""Gets all Security ML Analytics Settings.
@@ -74,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 SecurityMLAnalyticsSetting or the result of
cls(response)
:rtype:
@@ -84,64 +75,57 @@ 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
)
- cls: ClsType[_models.SecurityMLAnalyticsSettingsList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("SecurityMLAnalyticsSettingsList", pipeline_response)
+ deserialized = self._deserialize(
+ "SecurityMLAnalyticsSettingsList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -151,15 +135,19 @@ 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/securityMLAnalyticsSettings"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, settings_resource_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ settings_resource_name: str,
+ **kwargs: Any
) -> _models.SecurityMLAnalyticsSetting:
"""Gets the Security ML Analytics Settings.
@@ -170,42 +158,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.SecurityMLAnalyticsSetting] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -214,16 +200,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}"
- }
@overload
async def create_or_update(
@@ -251,7 +238,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 +249,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,23 +264,23 @@ 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
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,44 +292,37 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.SecurityMLAnalyticsSetting] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +331,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -369,24 +349,25 @@ 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 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
- self, resource_group_name: str, workspace_name: str, settings_resource_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ settings_resource_name: str,
+ **kwargs: Any
) -> None:
"""Delete the Security ML Analytics Settings.
@@ -397,42 +378,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -442,8 +421,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}"
- }
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..baf082fbae1a 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,42 +6,28 @@
# 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 typing import Any, Callable, Dict, IO, Optional, Type, 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.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,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._sentinel_onboarding_states_operations import build_create_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class SentinelOnboardingStatesOperations:
+class SentinelOnboardingStatesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -60,9 +46,16 @@ 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_async
async def get(
- self, resource_group_name: str, workspace_name: str, sentinel_onboarding_state_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ sentinel_onboarding_state_name: str,
+ **kwargs: Any
) -> _models.SentinelOnboardingState:
"""Get Sentinel onboarding state.
@@ -74,42 +67,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.SentinelOnboardingState] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -118,16 +109,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}"
- }
@overload
async def create(
@@ -157,7 +149,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 +160,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,23 +177,23 @@ 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:
"""
+
@distributed_trace_async
async def create(
self,
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,46 +207,39 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.SentinelOnboardingState] = kwargs.pop(
+ 'cls', None
)
- 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:
- _json = self._serialize.body(sentinel_onboarding_state_parameter, "SentinelOnboardingState")
+ _json = self._serialize.body(sentinel_onboarding_state_parameter, 'SentinelOnboardingState')
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 +248,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -281,24 +266,25 @@ 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 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
- self, resource_group_name: str, workspace_name: str, sentinel_onboarding_state_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ sentinel_onboarding_state_name: str,
+ **kwargs: Any
) -> None:
"""Delete Sentinel onboarding state.
@@ -310,42 +296,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -355,15 +339,16 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}"
- }
@distributed_trace_async
async def list(
- self, resource_group_name: str, workspace_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> _models.SentinelOnboardingStatesList:
"""Gets all Sentinel onboarding states.
@@ -372,41 +357,39 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.SentinelOnboardingStatesList] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -415,13 +398,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates"
- }
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..99869d97c4b1 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,39 +6,30 @@
# 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, Type, 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.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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class SourceControlOperations:
+class SourceControlOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -57,9 +48,71 @@ 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 +121,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,68 +132,68 @@ 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)
+ 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
)
- content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json"))
- cls: ClsType[_models.RepoList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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
_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 = 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
+ _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("RepoList", pipeline_response)
+ deserialized = self._deserialize(
+ "RepoList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -149,8 +203,8 @@ 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"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
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..7de5e345e5f3 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._source_controls_operations import build_create_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class SourceControlsOperations:
+class SourceControlsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,9 +49,15 @@ 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> AsyncIterable["_models.SourceControl"]:
"""Gets all source controls, without source control items.
@@ -74,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 SourceControl or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.SourceControl]
@@ -83,64 +74,57 @@ 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
)
- cls: ClsType[_models.SourceControlList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("SourceControlList", pipeline_response)
+ deserialized = self._deserialize(
+ "SourceControlList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -150,15 +134,19 @@ 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/sourcecontrols"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, source_control_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ source_control_id: str,
+ **kwargs: Any
) -> _models.SourceControl:
"""Gets a source control byt its identifier.
@@ -169,42 +157,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.SourceControl] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -213,22 +199,89 @@ 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
+
+
+
+ @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:
+ """
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}"
- }
@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,69 +290,86 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ 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[None] = 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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]:
+ 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
+
+ return deserialized # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}"
- }
@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 +378,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 +408,27 @@ 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,42 +437,37 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Warning] = kwargs.pop(
+ 'cls', None
)
- 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, (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 +476,32 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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]:
+ 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 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/_systems_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_systems_operations.py
new file mode 100644
index 000000000000..c560aaa4a3c1
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_systems_operations.py
@@ -0,0 +1,863 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...operations._systems_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_actions_request, build_list_request, build_report_action_status_request, build_undo_action_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class SystemsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`systems` 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 create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ system_to_upsert: Optional[_models.SystemResource] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SystemResource:
+ """Creates or updates the system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param system_to_upsert: The system to upsert. Default value is None.
+ :type system_to_upsert: ~azure.mgmt.securityinsight.models.SystemResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SystemResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SystemResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ system_to_upsert: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SystemResource:
+ """Creates or updates the system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param system_to_upsert: The system to upsert. Default value is None.
+ :type system_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
+ :return: SystemResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SystemResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ system_to_upsert: Optional[Union[_models.SystemResource, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> _models.SystemResource:
+ """Creates or updates the system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param system_to_upsert: The system to upsert. Is either a SystemResource type or a IO[bytes]
+ type. Default value is None.
+ :type system_to_upsert: ~azure.mgmt.securityinsight.models.SystemResource or IO[bytes]
+ :return: SystemResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SystemResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.SystemResource] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(system_to_upsert, (IOBase, bytes)):
+ _content = system_to_upsert
+ else:
+ if system_to_upsert is not None:
+ _json = self._serialize.body(system_to_upsert, 'SystemResource')
+ else:
+ _json = None
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ 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(
+ 'SystemResource',
+ 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,
+ agent_resource_name: str,
+ system_resource_name: str,
+ **kwargs: Any
+ ) -> _models.SystemResource:
+ """Gets the system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :return: SystemResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SystemResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.SystemResource] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ 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(
+ 'SystemResource',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes the system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ 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
+
+
+
+ @distributed_trace
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ filter: Optional[str] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.SystemResource"]:
+ """ListAll the systems.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
+ None.
+ :type filter: 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
+ :return: An iterator like instance of either SystemResource or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.SystemResource]
+ :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.SystemsList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ agent_resource_name=agent_resource_name,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ 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(
+ "SystemsList",
+ 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
+ )
+
+
+ @distributed_trace
+ def list_actions(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.Action"]:
+ """List of actions for a business application system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :return: An iterator like instance of either Action or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Action]
+ :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.ListActionsResponse] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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_actions_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ subscription_id=self._config.subscription_id,
+ 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(
+ "ListActionsResponse",
+ 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
+ )
+
+
+ @overload
+ async def undo_action( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[_models.UndoActionPayload] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Undo action, based on the actionId.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Undo action, based on the actionId. Default value is None.
+ :type payload: ~azure.mgmt.securityinsight.models.UndoActionPayload
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def undo_action( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Undo action, based on the actionId.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Undo action, based on the actionId. Default value is None.
+ :type payload: 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: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def undo_action( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[Union[_models.UndoActionPayload, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> None:
+ """Undo action, based on the actionId.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Undo action, based on the actionId. Is either a UndoActionPayload type or a
+ IO[bytes] type. Default value is None.
+ :type payload: ~azure.mgmt.securityinsight.models.UndoActionPayload or IO[bytes]
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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[None] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(payload, (IOBase, bytes)):
+ _content = payload
+ else:
+ if payload is not None:
+ _json = self._serialize.body(payload, 'UndoActionPayload')
+ else:
+ _json = None
+
+ _request = build_undo_action_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ 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 [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
+
+
+
+ @overload
+ async def report_action_status( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[_models.ReportActionStatusPayload] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Report the status of the action.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Report a status of the action that was performed by the agent. Default value is
+ None.
+ :type payload: ~azure.mgmt.securityinsight.models.ReportActionStatusPayload
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def report_action_status( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Report the status of the action.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Report a status of the action that was performed by the agent. Default value is
+ None.
+ :type payload: 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: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def report_action_status( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[Union[_models.ReportActionStatusPayload, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> None:
+ """Report the status of the action.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Report a status of the action that was performed by the agent. Is either a
+ ReportActionStatusPayload type or a IO[bytes] type. Default value is None.
+ :type payload: ~azure.mgmt.securityinsight.models.ReportActionStatusPayload or IO[bytes]
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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[None] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(payload, (IOBase, bytes)):
+ _content = payload
+ else:
+ if payload is not None:
+ _json = self._serialize.body(payload, 'ReportActionStatusPayload')
+ else:
+ _json = None
+
+ _request = build_report_action_status_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ 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 [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/_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..5f2fc7979bb6 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,36 +7,26 @@
# 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 typing import Any, Callable, Dict, Optional, Type, 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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+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.
@@ -55,9 +45,15 @@ 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_async
async def list(
- self, resource_group_name: str, workspace_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> _models.ThreatIntelligenceMetricsList:
"""Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source).
@@ -66,41 +62,39 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.ThreatIntelligenceMetricsList] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -109,13 +103,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics"
- }
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..e0e1035abd95 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,48 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_create_request,
- build_delete_request,
- build_get_request,
- build_query_indicators_request,
- build_replace_tags_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._threat_intelligence_indicator_operations import build_append_tags_request, build_create_indicator_request, build_create_request, build_delete_request, build_get_request, build_query_indicators_request, build_replace_tags_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class ThreatIntelligenceIndicatorOperations:
+class ThreatIntelligenceIndicatorOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -66,6 +49,9 @@ 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
async def create_indicator(
self,
@@ -90,7 +76,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 +86,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,22 +100,22 @@ 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:
"""
+
@distributed_trace_async
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,43 +126,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.ThreatIntelligenceInformation] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +163,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -202,24 +181,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ name: str,
+ **kwargs: Any
) -> _models.ThreatIntelligenceInformation:
"""View a threat intelligence indicator by name.
@@ -230,42 +210,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.ThreatIntelligenceInformation] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -274,16 +252,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}"
- }
@overload
async def create(
@@ -312,7 +291,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 +302,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,23 +318,23 @@ 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:
"""
+
@distributed_trace_async
async def create(
self,
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,43 +347,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.ThreatIntelligenceInformation] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +385,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -431,24 +403,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ name: str,
+ **kwargs: Any
) -> None:
"""Delete a threat intelligence indicator.
@@ -459,42 +432,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -504,11 +475,9 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}"
- }
@overload
def query_indicators(
@@ -534,7 +503,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 +515,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 +529,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:
@@ -573,12 +540,13 @@ def query_indicators(
:raises ~azure.core.exceptions.HttpResponseError:
"""
+
@distributed_trace
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 +557,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,31 +570,27 @@ 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
)
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.ThreatIntelligenceInformationList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ error_map.update(kwargs.pop('error_map', {}) or {})
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")
-
+ _json = self._serialize.body(threat_intelligence_filtering_criteria, 'ThreatIntelligenceFilteringCriteria')
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,43 +598,40 @@ 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
_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 = 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
+ _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("ThreatIntelligenceInformationList", pipeline_response)
+ deserialized = self._deserialize(
+ "ThreatIntelligenceInformationList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -683,11 +641,11 @@ async def get_next(next_link=None):
return pipeline_response
- 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"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@overload
async def append_tags( # pylint: disable=inconsistent-return-statements
@@ -716,7 +674,6 @@ 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:
@@ -728,7 +685,7 @@ async def append_tags( # pylint: disable=inconsistent-return-statements
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 +701,23 @@ 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
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,43 +730,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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[None] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +768,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -836,11 +787,9 @@ async def append_tags( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- append_tags.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/appendTags"
- }
@overload
async def replace_tags(
@@ -869,7 +818,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 +829,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,23 +845,23 @@ 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:
"""
+
@distributed_trace_async
async def replace_tags(
self,
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,43 +874,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.ThreatIntelligenceInformation] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +912,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -988,13 +930,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- replace_tags.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/replaceTags"
- }
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..010d1111f3a9 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,38 +7,28 @@
# 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
+from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, 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.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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class ThreatIntelligenceIndicatorsOperations:
+class ThreatIntelligenceIndicatorsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -57,6 +47,9 @@ 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,
@@ -87,7 +80,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 ThreatIntelligenceInformation or the result of
cls(response)
:rtype:
@@ -97,23 +89,19 @@ 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
)
- cls: ClsType[_models.ThreatIntelligenceInformationList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,
@@ -122,43 +110,40 @@ 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
_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 = 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
+ _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("ThreatIntelligenceInformationList", pipeline_response)
+ deserialized = self._deserialize(
+ "ThreatIntelligenceInformationList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -168,8 +153,8 @@ 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"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_operations.py
new file mode 100644
index 000000000000..ad9d2d14067e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_threat_intelligence_operations.py
@@ -0,0 +1,373 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...operations._threat_intelligence_operations import build_count_request, build_query_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class ThreatIntelligenceOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`threat_intelligence` 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 count(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[_models.CountQuery] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.ThreatIntelligenceCount:
+ """Gets the count of all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Default value is None.
+ :type query: ~azure.mgmt.securityinsight.models.CountQuery
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: ThreatIntelligenceCount or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceCount
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def count(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.ThreatIntelligenceCount:
+ """Gets the count of all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Default value is None.
+ :type query: 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: ThreatIntelligenceCount or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceCount
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def count(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[Union[_models.CountQuery, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> _models.ThreatIntelligenceCount:
+ """Gets the count of all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Is either a CountQuery type
+ or a IO[bytes] type. Default value is None.
+ :type query: ~azure.mgmt.securityinsight.models.CountQuery or IO[bytes]
+ :return: ThreatIntelligenceCount or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceCount
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.ThreatIntelligenceCount] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(query, (IOBase, bytes)):
+ _content = query
+ else:
+ if query is not None:
+ _json = self._serialize.body(query, 'CountQuery')
+ else:
+ _json = None
+
+ _request = build_count_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ ti_type=ti_type,
+ 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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'ThreatIntelligenceCount',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ def query(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[_models.Query] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncIterable["_models.TIObject"]:
+ """Gets all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Default value is None.
+ :type query: ~azure.mgmt.securityinsight.models.Query
+ :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 TIObject or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.TIObject]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def query(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncIterable["_models.TIObject"]:
+ """Gets all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Default value is None.
+ :type query: 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 TIObject or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.TIObject]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def query(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[Union[_models.Query, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.TIObject"]:
+ """Gets all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Is either a Query type or a
+ IO[bytes] type. Default value is None.
+ :type query: ~azure.mgmt.securityinsight.models.Query or IO[bytes]
+ :return: An iterator like instance of either TIObject or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.TIObject]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _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.ThreatIntelligenceList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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(query, (IOBase, bytes)):
+ _content = query
+ else:
+ if query is not None:
+ _json = self._serialize.body(query, 'Query')
+ else:
+ _json = None
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_query_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ ti_type=ti_type,
+ 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)
+
+ 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(
+ "ThreatIntelligenceList",
+ 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/_triggered_analytics_rule_run_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_triggered_analytics_rule_run_operations.py
new file mode 100644
index 000000000000..285970abf5d5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_triggered_analytics_rule_run_operations.py
@@ -0,0 +1,120 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, TypeVar
+
+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._triggered_analytics_rule_run_operations import build_get_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class TriggeredAnalyticsRuleRunOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`triggered_analytics_rule_run` 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,
+ workspace_name: str,
+ rule_run_id: str,
+ **kwargs: Any
+ ) -> _models.TriggeredAnalyticsRuleRun:
+ """Gets the triggered analytics rule run.
+
+ :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 rule_run_id: the triggered rule id. Required.
+ :type rule_run_id: str
+ :return: TriggeredAnalyticsRuleRun or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.TriggeredAnalyticsRuleRun
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.TriggeredAnalyticsRuleRun] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ rule_run_id=rule_run_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(
+ 'TriggeredAnalyticsRuleRun',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
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
index 18154771938c..10f15e30251e 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,39 +6,28 @@
# 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, List, Optional, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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 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
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class UpdateOperations:
+class UpdateOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -57,87 +46,20 @@ 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")
- 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(
+ async def recommendation(
self,
resource_group_name: str,
workspace_name: str,
recommendation_id: str,
- recommendation_patch: List[_models.RecommendationPatch],
+ recommendation_patch: _models.RecommendationPatch,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> AsyncLROPoller[_models.Recommendation]:
+ ) -> _models.Recommendation:
"""Patch a recommendation.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -148,35 +70,26 @@ async def begin_recommendation(
: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]
+ :type recommendation_patch: ~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]
+ :return: Recommendation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Recommendation
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
- async def begin_recommendation(
+ async def recommendation(
self,
resource_group_name: str,
workspace_name: str,
recommendation_id: str,
- recommendation_patch: IO,
+ recommendation_patch: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> AsyncLROPoller[_models.Recommendation]:
+ ) -> _models.Recommendation:
"""Patch a recommendation.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -187,33 +100,25 @@ async def begin_recommendation(
:param recommendation_id: Recommendation Id. Required.
:type recommendation_id: str
:param recommendation_patch: Recommendation Fields to Update. Required.
- :type recommendation_patch: IO
+ :type recommendation_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
- :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]
+ :return: Recommendation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Recommendation
:raises ~azure.core.exceptions.HttpResponseError:
"""
+
@distributed_trace_async
- async def begin_recommendation(
+ async def recommendation(
self,
resource_group_name: str,
workspace_name: str,
recommendation_id: str,
- recommendation_patch: Union[List[_models.RecommendationPatch], IO],
+ recommendation_patch: Union[_models.RecommendationPatch, IO[bytes]],
**kwargs: Any
- ) -> AsyncLROPoller[_models.Recommendation]:
+ ) -> _models.Recommendation:
"""Patch a recommendation.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -223,72 +128,70 @@ async def begin_recommendation(
: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]
+ :param recommendation_patch: Recommendation Fields to Update. Is either a RecommendationPatch
+ type or a IO[bytes] type. Required.
+ :type recommendation_patch: ~azure.mgmt.securityinsight.models.RecommendationPatch or IO[bytes]
+ :return: Recommendation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Recommendation
:raises ~azure.core.exceptions.HttpResponseError:
"""
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.Recommendation] = kwargs.pop(
+ 'cls', None
)
- 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())
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(recommendation_patch, (IOBase, bytes)):
+ _content = recommendation_patch
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
+ _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,
+ 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(
+ 'Recommendation',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # 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..3067ab277d77 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,31 @@
# 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, Callable, Dict, IO, Optional, Type, 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.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.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,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._watchlist_items_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class WatchlistItemsOperations:
+class WatchlistItemsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,6 +49,9 @@ 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,
@@ -86,7 +75,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 WatchlistItem or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.WatchlistItem]
@@ -95,66 +83,59 @@ 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
)
- cls: ClsType[_models.WatchlistItemList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("WatchlistItemList", pipeline_response)
+ deserialized = self._deserialize(
+ "WatchlistItemList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -164,15 +145,20 @@ 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/watchlists/{watchlistAlias}/watchlistItems"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, watchlist_alias: str, watchlist_item_id: str, **kwargs: Any
+ 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.
@@ -185,43 +171,41 @@ async def get(
:type watchlist_alias: str
:param watchlist_item_id: 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.WatchlistItem] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -230,20 +214,26 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}"
- }
@distributed_trace_async
async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, watchlist_alias: str, watchlist_item_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: str,
+ watchlist_item_id: str,
+ **kwargs: Any
) -> None:
"""Delete a watchlist item.
@@ -256,43 +246,41 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type watchlist_alias: str
:param watchlist_item_id: 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -302,11 +290,9 @@ async def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}"
- }
@overload
async def create_or_update(
@@ -336,7 +322,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: WatchlistItem or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.WatchlistItem
:raises ~azure.core.exceptions.HttpResponseError:
@@ -349,7 +334,7 @@ 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
@@ -366,16 +351,16 @@ async def create_or_update(
:param watchlist_item_id: 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:
"""
+
@distributed_trace_async
async def create_or_update(
self,
@@ -383,7 +368,7 @@ 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.
@@ -397,42 +382,36 @@ async def create_or_update(
:type watchlist_alias: str
:param watchlist_item_id: 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.WatchlistItem] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +421,16 @@ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -459,17 +439,14 @@ 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 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..a6eac13842fc 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,45 +6,33 @@
# 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, Type, 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.exceptions import ClientAuthenticationError, HttpResponseError, 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,
- build_get_request,
- build_list_request,
-)
-
-if sys.version_info >= (3, 8):
- from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
+from ...operations._watchlists_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
else:
- from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
-
-class WatchlistsOperations:
+class WatchlistsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -63,9 +51,16 @@ 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, skip_token: Optional[str] = None, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
) -> AsyncIterable["_models.Watchlist"]:
"""Gets all watchlists, without watchlist items.
@@ -79,7 +74,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,65 +81,58 @@ 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
)
- cls: ClsType[_models.WatchlistList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("WatchlistList", pipeline_response)
+ deserialized = self._deserialize(
+ "WatchlistList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -155,15 +142,19 @@ 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/watchlists"
- }
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace_async
async def get(
- self, resource_group_name: str, workspace_name: str, watchlist_alias: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: str,
+ **kwargs: Any
) -> _models.Watchlist:
"""Gets a watchlist, without its watchlist items.
@@ -174,42 +165,40 @@ async def get(
:type workspace_name: str
:param watchlist_alias: 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Watchlist] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -218,21 +207,92 @@ 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, {}) # 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[int, Type[HttpResponseError]] = {
+ 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'))
+
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, watchlist_alias: str, **kwargs: Any
- ) -> None:
+ async def begin_delete(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: str,
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
"""Delete a watchlist.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -242,65 +302,143 @@ async def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param watchlist_alias: 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ _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,
+
+
+ **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[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ 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
)
- cls: ClsType[None] = 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)
-
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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 [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:
- response_headers["Azure-AsyncOperation"] = self._deserialize(
- "str", response.headers.get("Azure-AsyncOperation")
- )
+ 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
+
+ return deserialized # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
@overload
- async def create_or_update(
+ async def begin_create_or_update(
self,
resource_group_name: str,
workspace_name: str,
@@ -309,7 +447,7 @@ 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
@@ -329,23 +467,23 @@ 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: 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
@@ -361,25 +499,26 @@ async def create_or_update(
:param watchlist_alias: 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
@@ -394,83 +533,71 @@ async def create_or_update(
:type workspace_name: str
:param watchlist_alias: 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)
- )
- 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,
+ 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
)
- 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
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop('polling', True)
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
)
-
- 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")
+ 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
+ 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
+
+
+ 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[_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
+ )
- return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_assignment_jobs_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_assignment_jobs_operations.py
new file mode 100644
index 000000000000..d175087f94c3
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_assignment_jobs_operations.py
@@ -0,0 +1,380 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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.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._workspace_manager_assignment_jobs_operations import build_create_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class WorkspaceManagerAssignmentJobsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`workspace_manager_assignment_jobs` 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,
+ workspace_manager_assignment_name: str,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.Job"]:
+ """Get all jobs for the specified workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: 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
+ :return: An iterator like instance of either Job or the result of cls(response)
+ :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.Job]
+ :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.JobList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ subscription_id=self._config.subscription_id,
+ orderby=orderby,
+ top=top,
+ 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(
+ "JobList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace_async
+ async def create(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ **kwargs: Any
+ ) -> _models.Job:
+ """Create a job for the specified workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :return: Job or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Job
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.Job] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_create_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'Job',
+ 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,
+ workspace_manager_assignment_name: str,
+ job_name: str,
+ **kwargs: Any
+ ) -> _models.Job:
+ """Gets a job.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :param job_name: The job name. Required.
+ :type job_name: str
+ :return: Job or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Job
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.Job] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ job_name=job_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'Job',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ job_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes the specified job from the specified workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :param job_name: The job name. Required.
+ :type job_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ job_name=job_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, 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/_workspace_manager_assignments_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_assignments_operations.py
new file mode 100644
index 000000000000..2830efb27e0a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_assignments_operations.py
@@ -0,0 +1,450 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...operations._workspace_manager_assignments_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class WorkspaceManagerAssignmentsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`workspace_manager_assignments` 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,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.WorkspaceManagerAssignment"]:
+ """Get all workspace manager assignments for the Sentinel workspace manager.
+
+ :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 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
+ :return: An iterator like instance of either WorkspaceManagerAssignment or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment]
+ :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.WorkspaceManagerAssignmentList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ orderby=orderby,
+ top=top,
+ 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(
+ "WorkspaceManagerAssignmentList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace_async
+ async def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerAssignment:
+ """Gets a workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :return: WorkspaceManagerAssignment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerAssignment] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerAssignment',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ workspace_manager_assignment: _models.WorkspaceManagerAssignment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerAssignment:
+ """Creates or updates a workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :param workspace_manager_assignment: The workspace manager assignment. Required.
+ :type workspace_manager_assignment:
+ ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: WorkspaceManagerAssignment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ workspace_manager_assignment: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerAssignment:
+ """Creates or updates a workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :param workspace_manager_assignment: The workspace manager assignment. Required.
+ :type workspace_manager_assignment: 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: WorkspaceManagerAssignment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ workspace_manager_assignment: Union[_models.WorkspaceManagerAssignment, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerAssignment:
+ """Creates or updates a workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :param workspace_manager_assignment: The workspace manager assignment. Is either a
+ WorkspaceManagerAssignment type or a IO[bytes] type. Required.
+ :type workspace_manager_assignment:
+ ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment or IO[bytes]
+ :return: WorkspaceManagerAssignment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerAssignment] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(workspace_manager_assignment, (IOBase, bytes)):
+ _content = workspace_manager_assignment
+ else:
+ _json = self._serialize.body(workspace_manager_assignment, 'WorkspaceManagerAssignment')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerAssignment',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes a workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, 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/_workspace_manager_configurations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_configurations_operations.py
new file mode 100644
index 000000000000..55150259bc39
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_configurations_operations.py
@@ -0,0 +1,450 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...operations._workspace_manager_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class WorkspaceManagerConfigurationsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`workspace_manager_configurations` 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,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.WorkspaceManagerConfiguration"]:
+ """Gets all workspace manager configurations for a Sentinel 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 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
+ :return: An iterator like instance of either WorkspaceManagerConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration]
+ :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.WorkspaceManagerConfigurationList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ orderby=orderby,
+ top=top,
+ 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(
+ "WorkspaceManagerConfigurationList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace_async
+ async def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_name: str,
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerConfiguration:
+ """Gets a workspace manager configuration.
+
+ :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 workspace_manager_configuration_name: The name of the workspace manager configuration.
+ Required.
+ :type workspace_manager_configuration_name: str
+ :return: WorkspaceManagerConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerConfiguration] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_configuration_name=workspace_manager_configuration_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerConfiguration',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes a workspace manager configuration.
+
+ :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 workspace_manager_configuration_name: The name of the workspace manager configuration.
+ Required.
+ :type workspace_manager_configuration_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_configuration_name=workspace_manager_configuration_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_name: str,
+ workspace_manager_configuration: _models.WorkspaceManagerConfiguration,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerConfiguration:
+ """Creates or updates a workspace manager configuration.
+
+ :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 workspace_manager_configuration_name: The name of the workspace manager configuration.
+ Required.
+ :type workspace_manager_configuration_name: str
+ :param workspace_manager_configuration: The workspace manager configuration. Required.
+ :type workspace_manager_configuration:
+ ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: WorkspaceManagerConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_name: str,
+ workspace_manager_configuration: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerConfiguration:
+ """Creates or updates a workspace manager configuration.
+
+ :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 workspace_manager_configuration_name: The name of the workspace manager configuration.
+ Required.
+ :type workspace_manager_configuration_name: str
+ :param workspace_manager_configuration: The workspace manager configuration. Required.
+ :type workspace_manager_configuration: 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: WorkspaceManagerConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_name: str,
+ workspace_manager_configuration: Union[_models.WorkspaceManagerConfiguration, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerConfiguration:
+ """Creates or updates a workspace manager configuration.
+
+ :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 workspace_manager_configuration_name: The name of the workspace manager configuration.
+ Required.
+ :type workspace_manager_configuration_name: str
+ :param workspace_manager_configuration: The workspace manager configuration. Is either a
+ WorkspaceManagerConfiguration type or a IO[bytes] type. Required.
+ :type workspace_manager_configuration:
+ ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration or IO[bytes]
+ :return: WorkspaceManagerConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerConfiguration] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(workspace_manager_configuration, (IOBase, bytes)):
+ _content = workspace_manager_configuration
+ else:
+ _json = self._serialize.body(workspace_manager_configuration, 'WorkspaceManagerConfiguration')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_configuration_name=workspace_manager_configuration_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerConfiguration',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_groups_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_groups_operations.py
new file mode 100644
index 000000000000..43d7046ee578
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_groups_operations.py
@@ -0,0 +1,444 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...operations._workspace_manager_groups_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class WorkspaceManagerGroupsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`workspace_manager_groups` 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,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.WorkspaceManagerGroup"]:
+ """Gets all workspace manager groups in the Sentinel workspace manager.
+
+ :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 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
+ :return: An iterator like instance of either WorkspaceManagerGroup or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.WorkspaceManagerGroup]
+ :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.WorkspaceManagerGroupList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ orderby=orderby,
+ top=top,
+ 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(
+ "WorkspaceManagerGroupList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace_async
+ async def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_group_name: str,
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerGroup:
+ """Gets a workspace manager group.
+
+ :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 workspace_manager_group_name: The name of the workspace manager group. Required.
+ :type workspace_manager_group_name: str
+ :return: WorkspaceManagerGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerGroup] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_group_name=workspace_manager_group_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerGroup',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_group_name: str,
+ workspace_manager_group: _models.WorkspaceManagerGroup,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerGroup:
+ """Creates or updates a workspace manager group.
+
+ :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 workspace_manager_group_name: The name of the workspace manager group. Required.
+ :type workspace_manager_group_name: str
+ :param workspace_manager_group: The workspace manager group object. Required.
+ :type workspace_manager_group: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: WorkspaceManagerGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_group_name: str,
+ workspace_manager_group: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerGroup:
+ """Creates or updates a workspace manager group.
+
+ :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 workspace_manager_group_name: The name of the workspace manager group. Required.
+ :type workspace_manager_group_name: str
+ :param workspace_manager_group: The workspace manager group object. Required.
+ :type workspace_manager_group: 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: WorkspaceManagerGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_group_name: str,
+ workspace_manager_group: Union[_models.WorkspaceManagerGroup, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerGroup:
+ """Creates or updates a workspace manager group.
+
+ :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 workspace_manager_group_name: The name of the workspace manager group. Required.
+ :type workspace_manager_group_name: str
+ :param workspace_manager_group: The workspace manager group object. Is either a
+ WorkspaceManagerGroup type or a IO[bytes] type. Required.
+ :type workspace_manager_group: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup or
+ IO[bytes]
+ :return: WorkspaceManagerGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerGroup] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(workspace_manager_group, (IOBase, bytes)):
+ _content = workspace_manager_group
+ else:
+ _json = self._serialize.body(workspace_manager_group, 'WorkspaceManagerGroup')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_group_name=workspace_manager_group_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerGroup',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_group_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes a workspace manager group.
+
+ :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 workspace_manager_group_name: The name of the workspace manager group. Required.
+ :type workspace_manager_group_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_group_name=workspace_manager_group_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, 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/_workspace_manager_members_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_members_operations.py
new file mode 100644
index 000000000000..968f48219400
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_workspace_manager_members_operations.py
@@ -0,0 +1,444 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, AsyncIterable, Callable, Dict, IO, Optional, Type, 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.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 ...operations._workspace_manager_members_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+class WorkspaceManagerMembersOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.aio.SecurityInsights`'s
+ :attr:`workspace_manager_members` 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,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.WorkspaceManagerMember"]:
+ """Gets all workspace manager members that exist for the given Sentinel workspace manager.
+
+ :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 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
+ :return: An iterator like instance of either WorkspaceManagerMember or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.securityinsight.models.WorkspaceManagerMember]
+ :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.WorkspaceManagerMembersList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ orderby=orderby,
+ top=top,
+ 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(
+ "WorkspaceManagerMembersList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return AsyncItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace_async
+ async def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_member_name: str,
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerMember:
+ """Gets a workspace manager member.
+
+ :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 workspace_manager_member_name: The name of the workspace manager member. Required.
+ :type workspace_manager_member_name: str
+ :return: WorkspaceManagerMember or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerMember] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_member_name=workspace_manager_member_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerMember',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_member_name: str,
+ workspace_manager_member: _models.WorkspaceManagerMember,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerMember:
+ """Creates or updates a workspace manager member.
+
+ :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 workspace_manager_member_name: The name of the workspace manager member. Required.
+ :type workspace_manager_member_name: str
+ :param workspace_manager_member: The workspace manager member object. Required.
+ :type workspace_manager_member: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: WorkspaceManagerMember or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_member_name: str,
+ workspace_manager_member: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerMember:
+ """Creates or updates a workspace manager member.
+
+ :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 workspace_manager_member_name: The name of the workspace manager member. Required.
+ :type workspace_manager_member_name: str
+ :param workspace_manager_member: The workspace manager member object. Required.
+ :type workspace_manager_member: 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: WorkspaceManagerMember or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_member_name: str,
+ workspace_manager_member: Union[_models.WorkspaceManagerMember, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerMember:
+ """Creates or updates a workspace manager member.
+
+ :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 workspace_manager_member_name: The name of the workspace manager member. Required.
+ :type workspace_manager_member_name: str
+ :param workspace_manager_member: The workspace manager member object. Is either a
+ WorkspaceManagerMember type or a IO[bytes] type. Required.
+ :type workspace_manager_member: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember or
+ IO[bytes]
+ :return: WorkspaceManagerMember or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerMember] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(workspace_manager_member, (IOBase, bytes)):
+ _content = workspace_manager_member
+ else:
+ _json = self._serialize.body(workspace_manager_member, 'WorkspaceManagerMember')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_member_name=workspace_manager_member_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerMember',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace_async
+ async def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_member_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes a workspace manager member.
+
+ :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 workspace_manager_member_name: The name of the workspace manager member. Required.
+ :type workspace_manager_member_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_member_name=workspace_manager_member_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # 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..c9b5279719b1 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
@@ -17,8 +17,10 @@
from ._models_py3 import ASCCheckRequirements
from ._models_py3 import ASCDataConnector
from ._models_py3 import ASCDataConnectorProperties
+from ._models_py3 import AWSAuthModel
from ._models_py3 import AccountEntity
from ._models_py3 import AccountEntityProperties
+from ._models_py3 import Action
from ._models_py3 import ActionPropertiesBase
from ._models_py3 import ActionRequest
from ._models_py3 import ActionRequestProperties
@@ -32,6 +34,8 @@
from ._models_py3 import ActivityEntityQueryTemplatePropertiesQueryDefinitions
from ._models_py3 import ActivityTimelineItem
from ._models_py3 import AddIncidentTaskActionProperties
+from ._models_py3 import AgentConfiguration
+from ._models_py3 import AgentSystem
from ._models_py3 import AlertDetailsOverride
from ._models_py3 import AlertPropertyMapping
from ._models_py3 import AlertRule
@@ -42,9 +46,13 @@
from ._models_py3 import AlertRuleTemplatesList
from ._models_py3 import AlertRulesList
from ._models_py3 import AlertsDataTypeOfDataConnector
+from ._models_py3 import AnalyticsRuleRunTrigger
from ._models_py3 import Anomalies
from ._models_py3 import AnomalySecurityMLAnalyticsSettings
from ._models_py3 import AnomalyTimelineItem
+from ._models_py3 import ApiKeyAuthModel
+from ._models_py3 import AssignmentItem
+from ._models_py3 import AttackPattern
from ._models_py3 import AutomationRule
from ._models_py3 import AutomationRuleAction
from ._models_py3 import AutomationRuleAddIncidentTaskAction
@@ -68,8 +76,12 @@
from ._models_py3 import AwsS3DataConnectorDataTypes
from ._models_py3 import AwsS3DataConnectorDataTypesLogs
from ._models_py3 import AzureDevOpsResourceInfo
+from ._models_py3 import AzureEntityResource
from ._models_py3 import AzureResourceEntity
from ._models_py3 import AzureResourceEntityProperties
+from ._models_py3 import BasicAuthModel
+from ._models_py3 import BillingStatistic
+from ._models_py3 import BillingStatisticList
from ._models_py3 import Bookmark
from ._models_py3 import BookmarkEntityMappings
from ._models_py3 import BookmarkExpandParameters
@@ -78,6 +90,10 @@
from ._models_py3 import BookmarkList
from ._models_py3 import BookmarkTimelineItem
from ._models_py3 import BooleanConditionProperties
+from ._models_py3 import BusinessApplicationAgentResource
+from ._models_py3 import BusinessApplicationAgentsList
+from ._models_py3 import CcpAuthConfig
+from ._models_py3 import CcpResponseConfig
from ._models_py3 import ClientInfo
from ._models_py3 import CloudApplicationEntity
from ._models_py3 import CloudApplicationEntityProperties
@@ -95,17 +111,30 @@
from ._models_py3 import CodelessUiConnectorConfigPropertiesInstructionStepsItem
from ._models_py3 import CodelessUiConnectorConfigPropertiesSampleQueriesItem
from ._models_py3 import CodelessUiDataConnector
+from ._models_py3 import ConditionClause
+from ._models_py3 import ConditionProperties
from ._models_py3 import ConnectedEntity
from ._models_py3 import ConnectivityCriteria
+from ._models_py3 import ConnectivityCriterion
+from ._models_py3 import ConnectorDataType
+from ._models_py3 import ConnectorDefinitionsAvailability
+from ._models_py3 import ConnectorDefinitionsPermissions
+from ._models_py3 import ConnectorDefinitionsResourceProvider
from ._models_py3 import ConnectorInstructionModelBase
-from ._models_py3 import Content
-from ._models_py3 import ContentPathMap
+from ._models_py3 import CountQuery
from ._models_py3 import CustomEntityQuery
+from ._models_py3 import CustomPermissionDetails
+from ._models_py3 import CustomizableConnectionsConfig
+from ._models_py3 import CustomizableConnectorDefinition
+from ._models_py3 import CustomizableConnectorUiConfig
from ._models_py3 import Customs
from ._models_py3 import CustomsPermission
+from ._models_py3 import DCRConfiguration
from ._models_py3 import DataConnector
from ._models_py3 import DataConnectorConnectBody
from ._models_py3 import DataConnectorDataTypeCommon
+from ._models_py3 import DataConnectorDefinition
+from ._models_py3 import DataConnectorDefinitionArmCollectionWrapper
from ._models_py3 import DataConnectorList
from ._models_py3 import DataConnectorRequirementsState
from ._models_py3 import DataConnectorTenantId
@@ -122,11 +151,13 @@
from ._models_py3 import Dynamics365DataConnectorDataTypes
from ._models_py3 import Dynamics365DataConnectorDataTypesDynamics365CdsActivities
from ._models_py3 import Dynamics365DataConnectorProperties
+from ._models_py3 import EnrichmentDomainBody
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 EnrichmentIpAddressBody
from ._models_py3 import EnrichmentIpGeodata
from ._models_py3 import Entity
from ._models_py3 import EntityAnalytics
@@ -141,6 +172,7 @@
from ._models_py3 import EntityInsightItem
from ._models_py3 import EntityInsightItemQueryTimeInterval
from ._models_py3 import EntityList
+from ._models_py3 import EntityManualTriggerRequestBody
from ._models_py3 import EntityMapping
from ._models_py3 import EntityQuery
from ._models_py3 import EntityQueryItem
@@ -152,6 +184,10 @@
from ._models_py3 import EntityTimelineItem
from ._models_py3 import EntityTimelineParameters
from ._models_py3 import EntityTimelineResponse
+from ._models_py3 import Error
+from ._models_py3 import ErrorAdditionalInfo
+from ._models_py3 import ErrorDetail
+from ._models_py3 import ErrorResponse
from ._models_py3 import EventGroupingSettings
from ._models_py3 import ExpansionEntityQuery
from ._models_py3 import ExpansionResultAggregation
@@ -175,17 +211,32 @@
from ._models_py3 import FusionTemplateSourceSetting
from ._models_py3 import FusionTemplateSourceSubType
from ._models_py3 import FusionTemplateSubTypeSeverityFilter
+from ._models_py3 import GCPAuthModel
+from ._models_py3 import GCPAuthProperties
+from ._models_py3 import GCPDataConnector
+from ._models_py3 import GCPRequestProperties
+from ._models_py3 import GenericBlobSbsAuthModel
from ._models_py3 import GeoLocation
from ._models_py3 import GetInsightsErrorKind
from ._models_py3 import GetInsightsResultsMetadata
from ._models_py3 import GetQueriesResponse
+from ._models_py3 import GitHubAuthModel
from ._models_py3 import GitHubResourceInfo
from ._models_py3 import GraphQueries
+from ._models_py3 import GraphQuery
from ._models_py3 import GroupingConfiguration
from ._models_py3 import HostEntity
from ._models_py3 import HostEntityProperties
+from ._models_py3 import Hunt
+from ._models_py3 import HuntComment
+from ._models_py3 import HuntCommentList
+from ._models_py3 import HuntList
+from ._models_py3 import HuntOwner
+from ._models_py3 import HuntRelation
+from ._models_py3 import HuntRelationList
from ._models_py3 import HuntingBookmark
from ._models_py3 import HuntingBookmarkProperties
+from ._models_py3 import Identity
from ._models_py3 import Incident
from ._models_py3 import IncidentAdditionalData
from ._models_py3 import IncidentAlertList
@@ -202,6 +253,8 @@
from ._models_py3 import IncidentPropertiesAction
from ._models_py3 import IncidentTask
from ._models_py3 import IncidentTaskList
+from ._models_py3 import Indicator
+from ._models_py3 import IndicatorObservablesItem
from ._models_py3 import InsightQueryItem
from ._models_py3 import InsightQueryItemProperties
from ._models_py3 import InsightQueryItemPropertiesAdditionalQuery
@@ -213,9 +266,10 @@
from ._models_py3 import InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem
from ._models_py3 import InsightsTableResult
from ._models_py3 import InsightsTableResultColumnsItem
+from ._models_py3 import InstructionStep
+from ._models_py3 import InstructionStepDetails
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
@@ -223,7 +277,14 @@
from ._models_py3 import IoTDeviceEntityProperties
from ._models_py3 import IpEntity
from ._models_py3 import IpEntityProperties
+from ._models_py3 import Job
+from ._models_py3 import JobItem
+from ._models_py3 import JobList
+from ._models_py3 import JwtAuthModel
from ._models_py3 import LastDataReceivedDataType
+from ._models_py3 import ListActionsResponse
+from ._models_py3 import LockUserAction
+from ._models_py3 import Log
from ._models_py3 import MCASCheckRequirements
from ._models_py3 import MCASCheckRequirementsProperties
from ._models_py3 import MCASDataConnector
@@ -240,12 +301,12 @@
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 MTPDataConnectorDataTypesAlerts
from ._models_py3 import MTPDataConnectorDataTypesIncidents
from ._models_py3 import MTPDataConnectorProperties
from ._models_py3 import MailClusterEntity
@@ -265,17 +326,26 @@
from ._models_py3 import MetadataPatch
from ._models_py3 import MetadataSource
from ._models_py3 import MetadataSupport
+from ._models_py3 import MicrosoftPurviewInformationProtectionCheckRequirements
+from ._models_py3 import MicrosoftPurviewInformationProtectionCheckRequirementsProperties
+from ._models_py3 import MicrosoftPurviewInformationProtectionConnectorDataTypes
+from ._models_py3 import MicrosoftPurviewInformationProtectionConnectorDataTypesLogs
+from ._models_py3 import MicrosoftPurviewInformationProtectionDataConnector
+from ._models_py3 import MicrosoftPurviewInformationProtectionDataConnectorProperties
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 MtpFilteredProviders
from ._models_py3 import NicEntity
from ._models_py3 import NicEntityProperties
+from ._models_py3 import NoneAuthModel
from ._models_py3 import NrtAlertRule
from ._models_py3 import NrtAlertRuleTemplate
from ._models_py3 import NrtAlertRuleTemplateProperties
+from ._models_py3 import OAuthModel
from ._models_py3 import Office365ProjectCheckRequirements
from ._models_py3 import Office365ProjectCheckRequirementsProperties
from ._models_py3 import Office365ProjectConnectorDataTypes
@@ -307,36 +377,74 @@
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
from ._models_py3 import OperationsList
+from ._models_py3 import OracleAuthModel
+from ._models_py3 import PackageBaseProperties
+from ._models_py3 import PackageList
+from ._models_py3 import PackageModel
+from ._models_py3 import PackageProperties
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 ProductPackageAdditionalProperties
+from ._models_py3 import ProductPackageList
+from ._models_py3 import ProductPackageModel
+from ._models_py3 import ProductPackageProperties
+from ._models_py3 import ProductTemplateAdditionalProperties
+from ._models_py3 import ProductTemplateList
+from ._models_py3 import ProductTemplateModel
+from ._models_py3 import ProductTemplateProperties
from ._models_py3 import PropertyArrayChangedConditionProperties
from ._models_py3 import PropertyArrayConditionProperties
from ._models_py3 import PropertyChangedConditionProperties
from ._models_py3 import PropertyConditionProperties
+from ._models_py3 import PullRequest
+from ._models_py3 import Query
from ._models_py3 import QueryBasedAlertRuleTemplateProperties
+from ._models_py3 import QueryCondition
+from ._models_py3 import QuerySortBy
from ._models_py3 import Recommendation
from ._models_py3 import RecommendationList
from ._models_py3 import RecommendationPatch
-from ._models_py3 import RecommendedAction
+from ._models_py3 import RecommendationPatchProperties
+from ._models_py3 import RecommendedSuggestion
+from ._models_py3 import ReevaluateResponse
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 Relationship
+from ._models_py3 import RelationshipHint
from ._models_py3 import Repo
from ._models_py3 import RepoList
+from ._models_py3 import ReportActionStatusPayload
from ._models_py3 import Repository
+from ._models_py3 import RepositoryAccess
+from ._models_py3 import RepositoryAccessProperties
from ._models_py3 import RepositoryResourceInfo
from ._models_py3 import RequiredPermissions
from ._models_py3 import Resource
from ._models_py3 import ResourceProvider
+from ._models_py3 import ResourceProviderRequiredPermissions
from ._models_py3 import ResourceWithEtag
+from ._models_py3 import RestApiPollerDataConnector
+from ._models_py3 import RestApiPollerRequestConfig
+from ._models_py3 import RestApiPollerRequestPagingConfig
+from ._models_py3 import RestApiPollerRequestPagingCountBaseConfig
+from ._models_py3 import RestApiPollerRequestPagingLinkHeaderConfig
+from ._models_py3 import RestApiPollerRequestPagingNextPageUrlConfig
+from ._models_py3 import RestApiPollerRequestPagingOffsetConfig
+from ._models_py3 import RestApiPollerRequestPagingTokenConfig
+from ._models_py3 import RfcConnector
from ._models_py3 import SampleQueries
+from ._models_py3 import SapAgentConfiguration
+from ._models_py3 import SapControlConnector
+from ._models_py3 import SapSolutionUsageStatistic
+from ._models_py3 import SapSystemsConfiguration
from ._models_py3 import ScheduledAlertRule
from ._models_py3 import ScheduledAlertRuleCommonProperties
from ._models_py3 import ScheduledAlertRuleProperties
@@ -353,6 +461,8 @@
from ._models_py3 import SentinelEntityMapping
from ._models_py3 import SentinelOnboardingState
from ._models_py3 import SentinelOnboardingStatesList
+from ._models_py3 import ServicePrincipal
+from ._models_py3 import SessionAuthModel
from ._models_py3 import SettingList
from ._models_py3 import Settings
from ._models_py3 import SourceControl
@@ -360,19 +470,31 @@
from ._models_py3 import SubmissionMailEntity
from ._models_py3 import SubmissionMailEntityProperties
from ._models_py3 import SystemData
+from ._models_py3 import SystemResource
+from ._models_py3 import SystemsConfiguration
+from ._models_py3 import SystemsConfigurationConnector
+from ._models_py3 import SystemsList
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 TIObject
from ._models_py3 import TeamInformation
from ._models_py3 import TeamProperties
+from ._models_py3 import TemplateAdditionalProperties
+from ._models_py3 import TemplateBaseProperties
+from ._models_py3 import TemplateList
+from ._models_py3 import TemplateModel
+from ._models_py3 import TemplateProperties
+from ._models_py3 import ThreatActor
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 ThreatIntelligenceCount
from ._models_py3 import ThreatIntelligenceExternalReference
from ._models_py3 import ThreatIntelligenceFilteringCriteria
from ._models_py3 import ThreatIntelligenceGranularMarkingModel
@@ -381,6 +503,7 @@
from ._models_py3 import ThreatIntelligenceInformation
from ._models_py3 import ThreatIntelligenceInformationList
from ._models_py3 import ThreatIntelligenceKillChainPhase
+from ._models_py3 import ThreatIntelligenceList
from ._models_py3 import ThreatIntelligenceMetric
from ._models_py3 import ThreatIntelligenceMetricEntity
from ._models_py3 import ThreatIntelligenceMetrics
@@ -397,18 +520,34 @@
from ._models_py3 import TimelineAggregation
from ._models_py3 import TimelineError
from ._models_py3 import TimelineResultsMetadata
+from ._models_py3 import TriggeredAnalyticsRuleRun
+from ._models_py3 import TriggeredAnalyticsRuleRuns
from ._models_py3 import Ueba
+from ._models_py3 import UndoActionPayload
+from ._models_py3 import UnlockUserAction
from ._models_py3 import UrlEntity
from ._models_py3 import UrlEntityProperties
from ._models_py3 import UserInfo
from ._models_py3 import ValidationError
+from ._models_py3 import Warning
+from ._models_py3 import WarningBody
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 ._models_py3 import WorkspaceManagerAssignment
+from ._models_py3 import WorkspaceManagerAssignmentList
+from ._models_py3 import WorkspaceManagerConfiguration
+from ._models_py3 import WorkspaceManagerConfigurationList
+from ._models_py3 import WorkspaceManagerGroup
+from ._models_py3 import WorkspaceManagerGroupList
+from ._models_py3 import WorkspaceManagerMember
+from ._models_py3 import WorkspaceManagerMembersList
+from ._security_insights_enums import ActionStatus
from ._security_insights_enums import ActionType
+from ._security_insights_enums import AgentType
from ._security_insights_enums import AlertDetail
from ._security_insights_enums import AlertProperty
from ._security_insights_enums import AlertRuleKind
@@ -425,17 +564,20 @@
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 BillingStatisticKind
+from ._security_insights_enums import CcpAuthType
from ._security_insights_enums import ConditionType
from ._security_insights_enums import ConfidenceLevel
from ._security_insights_enums import ConfidenceScoreStatus
+from ._security_insights_enums import ConfigurationType
from ._security_insights_enums import ConnectAuthKind
+from ._security_insights_enums import Connective
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 DataConnectorDefinitionKind
from ._security_insights_enums import DataConnectorKind
from ._security_insights_enums import DataConnectorLicenseState
from ._security_insights_enums import DataTypeState
@@ -447,22 +589,25 @@
from ._security_insights_enums import DeploymentState
from ._security_insights_enums import DeviceImportance
from ._security_insights_enums import ElevationToken
+from ._security_insights_enums import EnrichmentType
from ._security_insights_enums import EntityItemQueryKind
-from ._security_insights_enums import EntityKind
+from ._security_insights_enums import EntityKindEnum
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 Flag
from ._security_insights_enums import GetInsightsError
+from ._security_insights_enums import HttpMethodVerb
+from ._security_insights_enums import HttpsConfigurationType
+from ._security_insights_enums import HypothesisStatus
from ._security_insights_enums import IncidentClassification
from ._security_insights_enums import IncidentClassificationReason
from ._security_insights_enums import IncidentLabelType
@@ -470,536 +615,720 @@
from ._security_insights_enums import IncidentStatus
from ._security_insights_enums import IncidentTaskStatus
from ._security_insights_enums import IngestionMode
+from ._security_insights_enums import IngestionType
+from ._security_insights_enums import KeyVaultAuthenticationMode
from ._security_insights_enums import KillChainIntent
from ._security_insights_enums import Kind
+from ._security_insights_enums import ListActionKind
+from ._security_insights_enums import LogStatusType
+from ._security_insights_enums import LogType
from ._security_insights_enums import MatchingMethod
from ._security_insights_enums import MicrosoftSecurityProductName
+from ._security_insights_enums import Mode
+from ._security_insights_enums import MtpProvider
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 PackageKind
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 ProviderPermissionsScope
+from ._security_insights_enums import ProvisioningState
from ._security_insights_enums import RegistryHive
from ._security_insights_enums import RegistryValueKind
from ._security_insights_enums import RepoType
+from ._security_insights_enums import RepositoryAccessKind
+from ._security_insights_enums import RestApiPollerRequestPagingKind
+from ._security_insights_enums import SapAuthenticationType
+from ._security_insights_enums import SecretSource
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 SortingDirection
from ._security_insights_enums import SourceKind
from ._security_insights_enums import SourceType
from ._security_insights_enums import State
+from ._security_insights_enums import Status
from ._security_insights_enums import SupportTier
+from ._security_insights_enums import SystemConfigurationConnectorType
+from ._security_insights_enums import SystemStatusType
+from ._security_insights_enums import TIObjectKind
from ._security_insights_enums import TemplateStatus
-from ._security_insights_enums import ThreatIntelligenceResourceKindEnum
-from ._security_insights_enums import ThreatIntelligenceSortingCriteriaEnum
+from ._security_insights_enums import ThreatIntelligenceResourceInnerKind
+from ._security_insights_enums import ThreatIntelligenceSortingOrder
+from ._security_insights_enums import TiType
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
+from ._security_insights_enums import WarningCode
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
-
__all__ = [
- "AADCheckRequirements",
- "AADCheckRequirementsProperties",
- "AADDataConnector",
- "AADDataConnectorProperties",
- "AATPCheckRequirements",
- "AATPCheckRequirementsProperties",
- "AATPDataConnector",
- "AATPDataConnectorProperties",
- "ASCCheckRequirements",
- "ASCDataConnector",
- "ASCDataConnectorProperties",
- "AccountEntity",
- "AccountEntityProperties",
- "ActionPropertiesBase",
- "ActionRequest",
- "ActionRequestProperties",
- "ActionResponse",
- "ActionResponseProperties",
- "ActionsList",
- "ActivityCustomEntityQuery",
- "ActivityEntityQueriesPropertiesQueryDefinitions",
- "ActivityEntityQuery",
- "ActivityEntityQueryTemplate",
- "ActivityEntityQueryTemplatePropertiesQueryDefinitions",
- "ActivityTimelineItem",
- "AddIncidentTaskActionProperties",
- "AlertDetailsOverride",
- "AlertPropertyMapping",
- "AlertRule",
- "AlertRuleTemplate",
- "AlertRuleTemplateDataSource",
- "AlertRuleTemplatePropertiesBase",
- "AlertRuleTemplateWithMitreProperties",
- "AlertRuleTemplatesList",
- "AlertRulesList",
- "AlertsDataTypeOfDataConnector",
- "Anomalies",
- "AnomalySecurityMLAnalyticsSettings",
- "AnomalyTimelineItem",
- "AutomationRule",
- "AutomationRuleAction",
- "AutomationRuleAddIncidentTaskAction",
- "AutomationRuleBooleanCondition",
- "AutomationRuleCondition",
- "AutomationRuleModifyPropertiesAction",
- "AutomationRulePropertyArrayChangedValuesCondition",
- "AutomationRulePropertyArrayValuesCondition",
- "AutomationRulePropertyValuesChangedCondition",
- "AutomationRulePropertyValuesCondition",
- "AutomationRuleRunPlaybookAction",
- "AutomationRuleTriggeringLogic",
- "AutomationRulesList",
- "Availability",
- "AwsCloudTrailCheckRequirements",
- "AwsCloudTrailDataConnector",
- "AwsCloudTrailDataConnectorDataTypes",
- "AwsCloudTrailDataConnectorDataTypesLogs",
- "AwsS3CheckRequirements",
- "AwsS3DataConnector",
- "AwsS3DataConnectorDataTypes",
- "AwsS3DataConnectorDataTypesLogs",
- "AzureDevOpsResourceInfo",
- "AzureResourceEntity",
- "AzureResourceEntityProperties",
- "Bookmark",
- "BookmarkEntityMappings",
- "BookmarkExpandParameters",
- "BookmarkExpandResponse",
- "BookmarkExpandResponseValue",
- "BookmarkList",
- "BookmarkTimelineItem",
- "BooleanConditionProperties",
- "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",
- "DataConnector",
- "DataConnectorConnectBody",
- "DataConnectorDataTypeCommon",
- "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",
- "EntityMapping",
- "EntityQuery",
- "EntityQueryItem",
- "EntityQueryItemProperties",
- "EntityQueryItemPropertiesDataTypesItem",
- "EntityQueryList",
- "EntityQueryTemplate",
- "EntityQueryTemplateList",
- "EntityTimelineItem",
- "EntityTimelineParameters",
- "EntityTimelineResponse",
- "EventGroupingSettings",
- "ExpansionEntityQuery",
- "ExpansionResultAggregation",
- "ExpansionResultsMetadata",
- "EyesOn",
- "FieldMapping",
- "FileEntity",
- "FileEntityProperties",
- "FileHashEntity",
- "FileHashEntityProperties",
- "FileImport",
- "FileImportList",
- "FileMetadata",
- "FusionAlertRule",
- "FusionAlertRuleTemplate",
- "FusionScenarioExclusionPattern",
- "FusionSourceSettings",
- "FusionSourceSubTypeSetting",
- "FusionSubTypeSeverityFilter",
- "FusionSubTypeSeverityFiltersItem",
- "FusionTemplateSourceSetting",
- "FusionTemplateSourceSubType",
- "FusionTemplateSubTypeSeverityFilter",
- "GeoLocation",
- "GetInsightsErrorKind",
- "GetInsightsResultsMetadata",
- "GetQueriesResponse",
- "GitHubResourceInfo",
- "GraphQueries",
- "GroupingConfiguration",
- "HostEntity",
- "HostEntityProperties",
- "HuntingBookmark",
- "HuntingBookmarkProperties",
- "Incident",
- "IncidentAdditionalData",
- "IncidentAlertList",
- "IncidentBookmarkList",
- "IncidentComment",
- "IncidentCommentList",
- "IncidentConfiguration",
- "IncidentEntitiesResponse",
- "IncidentEntitiesResultsMetadata",
- "IncidentInfo",
- "IncidentLabel",
- "IncidentList",
- "IncidentOwnerInfo",
- "IncidentPropertiesAction",
- "IncidentTask",
- "IncidentTaskList",
- "InsightQueryItem",
- "InsightQueryItemProperties",
- "InsightQueryItemPropertiesAdditionalQuery",
- "InsightQueryItemPropertiesDefaultTimeRange",
- "InsightQueryItemPropertiesReferenceTimeRange",
- "InsightQueryItemPropertiesTableQuery",
- "InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem",
- "InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem",
- "InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem",
- "InsightsTableResult",
- "InsightsTableResultColumnsItem",
- "InstructionSteps",
- "InstructionStepsInstructionsItem",
- "Instructions",
- "IoTCheckRequirements",
- "IoTDataConnector",
- "IoTDataConnectorProperties",
- "IoTDeviceEntity",
- "IoTDeviceEntityProperties",
- "IpEntity",
- "IpEntityProperties",
- "LastDataReceivedDataType",
- "MCASCheckRequirements",
- "MCASCheckRequirementsProperties",
- "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",
- "MailMessageEntityProperties",
- "MailboxEntity",
- "MailboxEntityProperties",
- "MalwareEntity",
- "MalwareEntityProperties",
- "ManualTriggerRequestBody",
- "MetadataAuthor",
- "MetadataCategories",
- "MetadataDependencies",
- "MetadataList",
- "MetadataModel",
- "MetadataPatch",
- "MetadataSource",
- "MetadataSupport",
- "MicrosoftSecurityIncidentCreationAlertRule",
- "MicrosoftSecurityIncidentCreationAlertRuleCommonProperties",
- "MicrosoftSecurityIncidentCreationAlertRuleProperties",
- "MicrosoftSecurityIncidentCreationAlertRuleTemplate",
- "MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties",
- "MtpCheckRequirements",
- "NicEntity",
- "NicEntityProperties",
- "NrtAlertRule",
- "NrtAlertRuleTemplate",
- "NrtAlertRuleTemplateProperties",
- "Office365ProjectCheckRequirements",
- "Office365ProjectCheckRequirementsProperties",
- "Office365ProjectConnectorDataTypes",
- "Office365ProjectConnectorDataTypesLogs",
- "Office365ProjectDataConnector",
- "Office365ProjectDataConnectorProperties",
- "OfficeATPCheckRequirements",
- "OfficeATPCheckRequirementsProperties",
- "OfficeATPDataConnector",
- "OfficeATPDataConnectorProperties",
- "OfficeConsent",
- "OfficeConsentList",
- "OfficeDataConnector",
- "OfficeDataConnectorDataTypes",
- "OfficeDataConnectorDataTypesExchange",
- "OfficeDataConnectorDataTypesSharePoint",
- "OfficeDataConnectorDataTypesTeams",
- "OfficeDataConnectorProperties",
- "OfficeIRMCheckRequirements",
- "OfficeIRMCheckRequirementsProperties",
- "OfficeIRMDataConnector",
- "OfficeIRMDataConnectorProperties",
- "OfficePowerBICheckRequirements",
- "OfficePowerBICheckRequirementsProperties",
- "OfficePowerBIConnectorDataTypes",
- "OfficePowerBIConnectorDataTypesLogs",
- "OfficePowerBIDataConnector",
- "OfficePowerBIDataConnectorProperties",
- "Operation",
- "OperationDisplay",
- "OperationsList",
- "Permissions",
- "PermissionsCustomsItem",
- "PermissionsResourceProviderItem",
- "PlaybookActionProperties",
- "ProcessEntity",
- "ProcessEntityProperties",
- "PropertyArrayChangedConditionProperties",
- "PropertyArrayConditionProperties",
- "PropertyChangedConditionProperties",
- "PropertyConditionProperties",
- "QueryBasedAlertRuleTemplateProperties",
- "Recommendation",
- "RecommendationList",
- "RecommendationPatch",
- "RecommendedAction",
- "RegistryKeyEntity",
- "RegistryKeyEntityProperties",
- "RegistryValueEntity",
- "RegistryValueEntityProperties",
- "Relation",
- "RelationList",
- "Repo",
- "RepoList",
- "Repository",
- "RepositoryResourceInfo",
- "RequiredPermissions",
- "Resource",
- "ResourceProvider",
- "ResourceWithEtag",
- "SampleQueries",
- "ScheduledAlertRule",
- "ScheduledAlertRuleCommonProperties",
- "ScheduledAlertRuleProperties",
- "ScheduledAlertRuleTemplate",
- "SecurityAlert",
- "SecurityAlertProperties",
- "SecurityAlertPropertiesConfidenceReasonsItem",
- "SecurityAlertTimelineItem",
- "SecurityGroupEntity",
- "SecurityGroupEntityProperties",
- "SecurityMLAnalyticsSetting",
- "SecurityMLAnalyticsSettingsDataSource",
- "SecurityMLAnalyticsSettingsList",
- "SentinelEntityMapping",
- "SentinelOnboardingState",
- "SentinelOnboardingStatesList",
- "SettingList",
- "Settings",
- "SourceControl",
- "SourceControlList",
- "SubmissionMailEntity",
- "SubmissionMailEntityProperties",
- "SystemData",
- "TICheckRequirements",
- "TICheckRequirementsProperties",
- "TIDataConnector",
- "TIDataConnectorDataTypes",
- "TIDataConnectorDataTypesIndicators",
- "TIDataConnectorProperties",
- "TeamInformation",
- "TeamProperties",
- "ThreatIntelligence",
- "ThreatIntelligenceAlertRule",
- "ThreatIntelligenceAlertRuleTemplate",
- "ThreatIntelligenceAlertRuleTemplateProperties",
- "ThreatIntelligenceAppendTags",
- "ThreatIntelligenceExternalReference",
- "ThreatIntelligenceFilteringCriteria",
- "ThreatIntelligenceGranularMarkingModel",
- "ThreatIntelligenceIndicatorModel",
- "ThreatIntelligenceIndicatorProperties",
- "ThreatIntelligenceInformation",
- "ThreatIntelligenceInformationList",
- "ThreatIntelligenceKillChainPhase",
- "ThreatIntelligenceMetric",
- "ThreatIntelligenceMetricEntity",
- "ThreatIntelligenceMetrics",
- "ThreatIntelligenceMetricsList",
- "ThreatIntelligenceParsedPattern",
- "ThreatIntelligenceParsedPatternTypeValue",
- "ThreatIntelligenceSortingCriteria",
- "TiTaxiiCheckRequirements",
- "TiTaxiiCheckRequirementsProperties",
- "TiTaxiiDataConnector",
- "TiTaxiiDataConnectorDataTypes",
- "TiTaxiiDataConnectorDataTypesTaxiiClient",
- "TiTaxiiDataConnectorProperties",
- "TimelineAggregation",
- "TimelineError",
- "TimelineResultsMetadata",
- "Ueba",
- "UrlEntity",
- "UrlEntityProperties",
- "UserInfo",
- "ValidationError",
- "Watchlist",
- "WatchlistItem",
- "WatchlistItemList",
- "WatchlistList",
- "Webhook",
- "ActionType",
- "AlertDetail",
- "AlertProperty",
- "AlertRuleKind",
- "AlertSeverity",
- "AlertStatus",
- "AntispamMailDirection",
- "AttackTactic",
- "AutomationRuleBooleanConditionSupportedOperator",
- "AutomationRulePropertyArrayChangedConditionSupportedArrayType",
- "AutomationRulePropertyArrayChangedConditionSupportedChangeType",
- "AutomationRulePropertyArrayConditionSupportedArrayConditionType",
- "AutomationRulePropertyArrayConditionSupportedArrayType",
- "AutomationRulePropertyChangedConditionSupportedChangedType",
- "AutomationRulePropertyChangedConditionSupportedPropertyType",
- "AutomationRulePropertyConditionSupportedOperator",
- "AutomationRulePropertyConditionSupportedProperty",
- "Category",
- "ConditionType",
- "ConfidenceLevel",
- "ConfidenceScoreStatus",
- "ConnectAuthKind",
- "ConnectivityType",
- "ContentType",
- "Context",
- "CreatedByType",
- "CustomEntityQueryKind",
- "DataConnectorAuthorizationState",
- "DataConnectorKind",
- "DataConnectorLicenseState",
- "DataTypeState",
- "DeleteStatus",
- "DeliveryAction",
- "DeliveryLocation",
- "DeploymentFetchStatus",
- "DeploymentResult",
- "DeploymentState",
- "DeviceImportance",
- "ElevationToken",
- "EntityItemQueryKind",
- "EntityKind",
- "EntityMappingType",
- "EntityProviders",
- "EntityQueryKind",
- "EntityQueryTemplateKind",
- "EntityTimelineKind",
- "EntityType",
- "Enum13",
- "Enum15",
- "EventGroupingAggregationKind",
- "FileFormat",
- "FileHashAlgorithm",
- "FileImportContentType",
- "FileImportState",
- "GetInsightsError",
- "IncidentClassification",
- "IncidentClassificationReason",
- "IncidentLabelType",
- "IncidentSeverity",
- "IncidentStatus",
- "IncidentTaskStatus",
- "IngestionMode",
- "KillChainIntent",
- "Kind",
- "MatchingMethod",
- "MicrosoftSecurityProductName",
- "OSFamily",
- "Operator",
- "OutputType",
- "OwnerType",
- "PermissionProviderScope",
- "PollingFrequency",
- "Priority",
- "ProviderName",
- "RegistryHive",
- "RegistryValueKind",
- "RepoType",
- "SecurityMLAnalyticsSettingsKind",
- "SettingKind",
- "SettingType",
- "SettingsStatus",
- "SourceKind",
- "SourceType",
- "State",
- "SupportTier",
- "TemplateStatus",
- "ThreatIntelligenceResourceKindEnum",
- "ThreatIntelligenceSortingCriteriaEnum",
- "TriggerOperator",
- "TriggersOn",
- "TriggersWhen",
- "UebaDataSources",
- "Version",
+ 'AADCheckRequirements',
+ 'AADCheckRequirementsProperties',
+ 'AADDataConnector',
+ 'AADDataConnectorProperties',
+ 'AATPCheckRequirements',
+ 'AATPCheckRequirementsProperties',
+ 'AATPDataConnector',
+ 'AATPDataConnectorProperties',
+ 'ASCCheckRequirements',
+ 'ASCDataConnector',
+ 'ASCDataConnectorProperties',
+ 'AWSAuthModel',
+ 'AccountEntity',
+ 'AccountEntityProperties',
+ 'Action',
+ 'ActionPropertiesBase',
+ 'ActionRequest',
+ 'ActionRequestProperties',
+ 'ActionResponse',
+ 'ActionResponseProperties',
+ 'ActionsList',
+ 'ActivityCustomEntityQuery',
+ 'ActivityEntityQueriesPropertiesQueryDefinitions',
+ 'ActivityEntityQuery',
+ 'ActivityEntityQueryTemplate',
+ 'ActivityEntityQueryTemplatePropertiesQueryDefinitions',
+ 'ActivityTimelineItem',
+ 'AddIncidentTaskActionProperties',
+ 'AgentConfiguration',
+ 'AgentSystem',
+ 'AlertDetailsOverride',
+ 'AlertPropertyMapping',
+ 'AlertRule',
+ 'AlertRuleTemplate',
+ 'AlertRuleTemplateDataSource',
+ 'AlertRuleTemplatePropertiesBase',
+ 'AlertRuleTemplateWithMitreProperties',
+ 'AlertRuleTemplatesList',
+ 'AlertRulesList',
+ 'AlertsDataTypeOfDataConnector',
+ 'AnalyticsRuleRunTrigger',
+ 'Anomalies',
+ 'AnomalySecurityMLAnalyticsSettings',
+ 'AnomalyTimelineItem',
+ 'ApiKeyAuthModel',
+ 'AssignmentItem',
+ 'AttackPattern',
+ 'AutomationRule',
+ 'AutomationRuleAction',
+ 'AutomationRuleAddIncidentTaskAction',
+ 'AutomationRuleBooleanCondition',
+ 'AutomationRuleCondition',
+ 'AutomationRuleModifyPropertiesAction',
+ 'AutomationRulePropertyArrayChangedValuesCondition',
+ 'AutomationRulePropertyArrayValuesCondition',
+ 'AutomationRulePropertyValuesChangedCondition',
+ 'AutomationRulePropertyValuesCondition',
+ 'AutomationRuleRunPlaybookAction',
+ 'AutomationRuleTriggeringLogic',
+ 'AutomationRulesList',
+ 'Availability',
+ 'AwsCloudTrailCheckRequirements',
+ 'AwsCloudTrailDataConnector',
+ 'AwsCloudTrailDataConnectorDataTypes',
+ 'AwsCloudTrailDataConnectorDataTypesLogs',
+ 'AwsS3CheckRequirements',
+ 'AwsS3DataConnector',
+ 'AwsS3DataConnectorDataTypes',
+ 'AwsS3DataConnectorDataTypesLogs',
+ 'AzureDevOpsResourceInfo',
+ 'AzureEntityResource',
+ 'AzureResourceEntity',
+ 'AzureResourceEntityProperties',
+ 'BasicAuthModel',
+ 'BillingStatistic',
+ 'BillingStatisticList',
+ 'Bookmark',
+ 'BookmarkEntityMappings',
+ 'BookmarkExpandParameters',
+ 'BookmarkExpandResponse',
+ 'BookmarkExpandResponseValue',
+ 'BookmarkList',
+ 'BookmarkTimelineItem',
+ 'BooleanConditionProperties',
+ 'BusinessApplicationAgentResource',
+ 'BusinessApplicationAgentsList',
+ 'CcpAuthConfig',
+ 'CcpResponseConfig',
+ 'ClientInfo',
+ 'CloudApplicationEntity',
+ 'CloudApplicationEntityProperties',
+ 'CloudErrorBody',
+ 'CodelessApiPollingDataConnector',
+ 'CodelessConnectorPollingAuthProperties',
+ 'CodelessConnectorPollingConfigProperties',
+ 'CodelessConnectorPollingPagingProperties',
+ 'CodelessConnectorPollingRequestProperties',
+ 'CodelessConnectorPollingResponseProperties',
+ 'CodelessUiConnectorConfigProperties',
+ 'CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem',
+ 'CodelessUiConnectorConfigPropertiesDataTypesItem',
+ 'CodelessUiConnectorConfigPropertiesGraphQueriesItem',
+ 'CodelessUiConnectorConfigPropertiesInstructionStepsItem',
+ 'CodelessUiConnectorConfigPropertiesSampleQueriesItem',
+ 'CodelessUiDataConnector',
+ 'ConditionClause',
+ 'ConditionProperties',
+ 'ConnectedEntity',
+ 'ConnectivityCriteria',
+ 'ConnectivityCriterion',
+ 'ConnectorDataType',
+ 'ConnectorDefinitionsAvailability',
+ 'ConnectorDefinitionsPermissions',
+ 'ConnectorDefinitionsResourceProvider',
+ 'ConnectorInstructionModelBase',
+ 'CountQuery',
+ 'CustomEntityQuery',
+ 'CustomPermissionDetails',
+ 'CustomizableConnectionsConfig',
+ 'CustomizableConnectorDefinition',
+ 'CustomizableConnectorUiConfig',
+ 'Customs',
+ 'CustomsPermission',
+ 'DCRConfiguration',
+ 'DataConnector',
+ 'DataConnectorConnectBody',
+ 'DataConnectorDataTypeCommon',
+ 'DataConnectorDefinition',
+ 'DataConnectorDefinitionArmCollectionWrapper',
+ 'DataConnectorList',
+ 'DataConnectorRequirementsState',
+ 'DataConnectorTenantId',
+ 'DataConnectorWithAlertsProperties',
+ 'DataConnectorsCheckRequirements',
+ 'DataTypeDefinitions',
+ 'Deployment',
+ 'DeploymentInfo',
+ 'DnsEntity',
+ 'DnsEntityProperties',
+ 'Dynamics365CheckRequirements',
+ 'Dynamics365CheckRequirementsProperties',
+ 'Dynamics365DataConnector',
+ 'Dynamics365DataConnectorDataTypes',
+ 'Dynamics365DataConnectorDataTypesDynamics365CdsActivities',
+ 'Dynamics365DataConnectorProperties',
+ 'EnrichmentDomainBody',
+ 'EnrichmentDomainWhois',
+ 'EnrichmentDomainWhoisContact',
+ 'EnrichmentDomainWhoisContacts',
+ 'EnrichmentDomainWhoisDetails',
+ 'EnrichmentDomainWhoisRegistrarDetails',
+ 'EnrichmentIpAddressBody',
+ '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',
+ 'Error',
+ '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',
+ 'GCPAuthProperties',
+ 'GCPDataConnector',
+ 'GCPRequestProperties',
+ 'GenericBlobSbsAuthModel',
+ 'GeoLocation',
+ 'GetInsightsErrorKind',
+ 'GetInsightsResultsMetadata',
+ 'GetQueriesResponse',
+ 'GitHubAuthModel',
+ 'GitHubResourceInfo',
+ 'GraphQueries',
+ 'GraphQuery',
+ 'GroupingConfiguration',
+ 'HostEntity',
+ 'HostEntityProperties',
+ 'Hunt',
+ 'HuntComment',
+ 'HuntCommentList',
+ 'HuntList',
+ 'HuntOwner',
+ 'HuntRelation',
+ 'HuntRelationList',
+ 'HuntingBookmark',
+ 'HuntingBookmarkProperties',
+ 'Identity',
+ 'Incident',
+ 'IncidentAdditionalData',
+ 'IncidentAlertList',
+ 'IncidentBookmarkList',
+ 'IncidentComment',
+ 'IncidentCommentList',
+ 'IncidentConfiguration',
+ 'IncidentEntitiesResponse',
+ 'IncidentEntitiesResultsMetadata',
+ 'IncidentInfo',
+ 'IncidentLabel',
+ 'IncidentList',
+ 'IncidentOwnerInfo',
+ 'IncidentPropertiesAction',
+ 'IncidentTask',
+ 'IncidentTaskList',
+ 'Indicator',
+ 'IndicatorObservablesItem',
+ 'InsightQueryItem',
+ 'InsightQueryItemProperties',
+ 'InsightQueryItemPropertiesAdditionalQuery',
+ 'InsightQueryItemPropertiesDefaultTimeRange',
+ 'InsightQueryItemPropertiesReferenceTimeRange',
+ 'InsightQueryItemPropertiesTableQuery',
+ 'InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem',
+ 'InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem',
+ 'InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem',
+ 'InsightsTableResult',
+ 'InsightsTableResultColumnsItem',
+ 'InstructionStep',
+ 'InstructionStepDetails',
+ 'InstructionSteps',
+ 'InstructionStepsInstructionsItem',
+ 'IoTCheckRequirements',
+ 'IoTDataConnector',
+ 'IoTDataConnectorProperties',
+ 'IoTDeviceEntity',
+ 'IoTDeviceEntityProperties',
+ 'IpEntity',
+ 'IpEntityProperties',
+ 'Job',
+ 'JobItem',
+ 'JobList',
+ 'JwtAuthModel',
+ 'LastDataReceivedDataType',
+ 'ListActionsResponse',
+ 'LockUserAction',
+ 'Log',
+ 'MCASCheckRequirements',
+ 'MCASCheckRequirementsProperties',
+ 'MCASDataConnector',
+ 'MCASDataConnectorDataTypes',
+ 'MCASDataConnectorProperties',
+ 'MDATPCheckRequirements',
+ 'MDATPCheckRequirementsProperties',
+ 'MDATPDataConnector',
+ 'MDATPDataConnectorProperties',
+ 'MLBehaviorAnalyticsAlertRule',
+ 'MLBehaviorAnalyticsAlertRuleTemplate',
+ 'MLBehaviorAnalyticsAlertRuleTemplateProperties',
+ 'MSTICheckRequirements',
+ 'MSTICheckRequirementsProperties',
+ 'MSTIDataConnector',
+ 'MSTIDataConnectorDataTypes',
+ 'MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed',
+ 'MSTIDataConnectorProperties',
+ 'MTPCheckRequirementsProperties',
+ 'MTPDataConnector',
+ 'MTPDataConnectorDataTypes',
+ 'MTPDataConnectorDataTypesAlerts',
+ 'MTPDataConnectorDataTypesIncidents',
+ 'MTPDataConnectorProperties',
+ 'MailClusterEntity',
+ 'MailClusterEntityProperties',
+ 'MailMessageEntity',
+ 'MailMessageEntityProperties',
+ 'MailboxEntity',
+ 'MailboxEntityProperties',
+ 'MalwareEntity',
+ 'MalwareEntityProperties',
+ 'ManualTriggerRequestBody',
+ 'MetadataAuthor',
+ 'MetadataCategories',
+ 'MetadataDependencies',
+ 'MetadataList',
+ 'MetadataModel',
+ 'MetadataPatch',
+ 'MetadataSource',
+ 'MetadataSupport',
+ 'MicrosoftPurviewInformationProtectionCheckRequirements',
+ 'MicrosoftPurviewInformationProtectionCheckRequirementsProperties',
+ 'MicrosoftPurviewInformationProtectionConnectorDataTypes',
+ 'MicrosoftPurviewInformationProtectionConnectorDataTypesLogs',
+ 'MicrosoftPurviewInformationProtectionDataConnector',
+ 'MicrosoftPurviewInformationProtectionDataConnectorProperties',
+ 'MicrosoftSecurityIncidentCreationAlertRule',
+ 'MicrosoftSecurityIncidentCreationAlertRuleCommonProperties',
+ 'MicrosoftSecurityIncidentCreationAlertRuleProperties',
+ 'MicrosoftSecurityIncidentCreationAlertRuleTemplate',
+ 'MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties',
+ 'MtpCheckRequirements',
+ 'MtpFilteredProviders',
+ 'NicEntity',
+ 'NicEntityProperties',
+ 'NoneAuthModel',
+ 'NrtAlertRule',
+ 'NrtAlertRuleTemplate',
+ 'NrtAlertRuleTemplateProperties',
+ 'OAuthModel',
+ 'Office365ProjectCheckRequirements',
+ 'Office365ProjectCheckRequirementsProperties',
+ 'Office365ProjectConnectorDataTypes',
+ 'Office365ProjectConnectorDataTypesLogs',
+ 'Office365ProjectDataConnector',
+ 'Office365ProjectDataConnectorProperties',
+ 'OfficeATPCheckRequirements',
+ 'OfficeATPCheckRequirementsProperties',
+ 'OfficeATPDataConnector',
+ 'OfficeATPDataConnectorProperties',
+ 'OfficeConsent',
+ 'OfficeConsentList',
+ 'OfficeDataConnector',
+ 'OfficeDataConnectorDataTypes',
+ 'OfficeDataConnectorDataTypesExchange',
+ 'OfficeDataConnectorDataTypesSharePoint',
+ 'OfficeDataConnectorDataTypesTeams',
+ 'OfficeDataConnectorProperties',
+ 'OfficeIRMCheckRequirements',
+ 'OfficeIRMCheckRequirementsProperties',
+ 'OfficeIRMDataConnector',
+ 'OfficeIRMDataConnectorProperties',
+ 'OfficePowerBICheckRequirements',
+ 'OfficePowerBICheckRequirementsProperties',
+ 'OfficePowerBIConnectorDataTypes',
+ 'OfficePowerBIConnectorDataTypesLogs',
+ 'OfficePowerBIDataConnector',
+ 'OfficePowerBIDataConnectorProperties',
+ 'Operation',
+ 'OperationDisplay',
+ 'OperationsList',
+ 'OracleAuthModel',
+ 'PackageBaseProperties',
+ 'PackageList',
+ 'PackageModel',
+ 'PackageProperties',
+ 'Permissions',
+ 'PermissionsCustomsItem',
+ 'PermissionsResourceProviderItem',
+ 'PlaybookActionProperties',
+ 'ProcessEntity',
+ 'ProcessEntityProperties',
+ 'ProductPackageAdditionalProperties',
+ 'ProductPackageList',
+ 'ProductPackageModel',
+ 'ProductPackageProperties',
+ 'ProductTemplateAdditionalProperties',
+ 'ProductTemplateList',
+ 'ProductTemplateModel',
+ 'ProductTemplateProperties',
+ 'PropertyArrayChangedConditionProperties',
+ 'PropertyArrayConditionProperties',
+ 'PropertyChangedConditionProperties',
+ 'PropertyConditionProperties',
+ 'PullRequest',
+ 'Query',
+ 'QueryBasedAlertRuleTemplateProperties',
+ 'QueryCondition',
+ 'QuerySortBy',
+ 'Recommendation',
+ 'RecommendationList',
+ 'RecommendationPatch',
+ 'RecommendationPatchProperties',
+ 'RecommendedSuggestion',
+ 'ReevaluateResponse',
+ 'RegistryKeyEntity',
+ 'RegistryKeyEntityProperties',
+ 'RegistryValueEntity',
+ 'RegistryValueEntityProperties',
+ 'Relation',
+ 'RelationList',
+ 'Relationship',
+ 'RelationshipHint',
+ 'Repo',
+ 'RepoList',
+ 'ReportActionStatusPayload',
+ 'Repository',
+ 'RepositoryAccess',
+ 'RepositoryAccessProperties',
+ 'RepositoryResourceInfo',
+ 'RequiredPermissions',
+ 'Resource',
+ 'ResourceProvider',
+ 'ResourceProviderRequiredPermissions',
+ 'ResourceWithEtag',
+ 'RestApiPollerDataConnector',
+ 'RestApiPollerRequestConfig',
+ 'RestApiPollerRequestPagingConfig',
+ 'RestApiPollerRequestPagingCountBaseConfig',
+ 'RestApiPollerRequestPagingLinkHeaderConfig',
+ 'RestApiPollerRequestPagingNextPageUrlConfig',
+ 'RestApiPollerRequestPagingOffsetConfig',
+ 'RestApiPollerRequestPagingTokenConfig',
+ 'RfcConnector',
+ 'SampleQueries',
+ 'SapAgentConfiguration',
+ 'SapControlConnector',
+ 'SapSolutionUsageStatistic',
+ 'SapSystemsConfiguration',
+ 'ScheduledAlertRule',
+ 'ScheduledAlertRuleCommonProperties',
+ 'ScheduledAlertRuleProperties',
+ 'ScheduledAlertRuleTemplate',
+ 'SecurityAlert',
+ 'SecurityAlertProperties',
+ 'SecurityAlertPropertiesConfidenceReasonsItem',
+ 'SecurityAlertTimelineItem',
+ 'SecurityGroupEntity',
+ 'SecurityGroupEntityProperties',
+ 'SecurityMLAnalyticsSetting',
+ 'SecurityMLAnalyticsSettingsDataSource',
+ 'SecurityMLAnalyticsSettingsList',
+ 'SentinelEntityMapping',
+ 'SentinelOnboardingState',
+ 'SentinelOnboardingStatesList',
+ 'ServicePrincipal',
+ 'SessionAuthModel',
+ 'SettingList',
+ 'Settings',
+ 'SourceControl',
+ 'SourceControlList',
+ 'SubmissionMailEntity',
+ 'SubmissionMailEntityProperties',
+ 'SystemData',
+ 'SystemResource',
+ 'SystemsConfiguration',
+ 'SystemsConfigurationConnector',
+ 'SystemsList',
+ 'TICheckRequirements',
+ 'TICheckRequirementsProperties',
+ 'TIDataConnector',
+ 'TIDataConnectorDataTypes',
+ 'TIDataConnectorDataTypesIndicators',
+ 'TIDataConnectorProperties',
+ 'TIObject',
+ 'TeamInformation',
+ 'TeamProperties',
+ 'TemplateAdditionalProperties',
+ 'TemplateBaseProperties',
+ 'TemplateList',
+ 'TemplateModel',
+ 'TemplateProperties',
+ 'ThreatActor',
+ 'ThreatIntelligence',
+ 'ThreatIntelligenceAlertRule',
+ 'ThreatIntelligenceAlertRuleTemplate',
+ 'ThreatIntelligenceAlertRuleTemplateProperties',
+ 'ThreatIntelligenceAppendTags',
+ 'ThreatIntelligenceCount',
+ 'ThreatIntelligenceExternalReference',
+ 'ThreatIntelligenceFilteringCriteria',
+ 'ThreatIntelligenceGranularMarkingModel',
+ 'ThreatIntelligenceIndicatorModel',
+ 'ThreatIntelligenceIndicatorProperties',
+ 'ThreatIntelligenceInformation',
+ 'ThreatIntelligenceInformationList',
+ 'ThreatIntelligenceKillChainPhase',
+ 'ThreatIntelligenceList',
+ 'ThreatIntelligenceMetric',
+ 'ThreatIntelligenceMetricEntity',
+ 'ThreatIntelligenceMetrics',
+ 'ThreatIntelligenceMetricsList',
+ 'ThreatIntelligenceParsedPattern',
+ 'ThreatIntelligenceParsedPatternTypeValue',
+ 'ThreatIntelligenceSortingCriteria',
+ 'TiTaxiiCheckRequirements',
+ 'TiTaxiiCheckRequirementsProperties',
+ 'TiTaxiiDataConnector',
+ 'TiTaxiiDataConnectorDataTypes',
+ 'TiTaxiiDataConnectorDataTypesTaxiiClient',
+ 'TiTaxiiDataConnectorProperties',
+ 'TimelineAggregation',
+ 'TimelineError',
+ 'TimelineResultsMetadata',
+ 'TriggeredAnalyticsRuleRun',
+ 'TriggeredAnalyticsRuleRuns',
+ 'Ueba',
+ 'UndoActionPayload',
+ 'UnlockUserAction',
+ 'UrlEntity',
+ 'UrlEntityProperties',
+ 'UserInfo',
+ 'ValidationError',
+ 'Warning',
+ 'WarningBody',
+ 'Watchlist',
+ 'WatchlistItem',
+ 'WatchlistItemList',
+ 'WatchlistList',
+ 'Webhook',
+ 'WorkspaceManagerAssignment',
+ 'WorkspaceManagerAssignmentList',
+ 'WorkspaceManagerConfiguration',
+ 'WorkspaceManagerConfigurationList',
+ 'WorkspaceManagerGroup',
+ 'WorkspaceManagerGroupList',
+ 'WorkspaceManagerMember',
+ 'WorkspaceManagerMembersList',
+ 'ActionStatus',
+ 'ActionType',
+ 'AgentType',
+ 'AlertDetail',
+ 'AlertProperty',
+ 'AlertRuleKind',
+ 'AlertSeverity',
+ 'AlertStatus',
+ 'AntispamMailDirection',
+ 'AttackTactic',
+ 'AutomationRuleBooleanConditionSupportedOperator',
+ 'AutomationRulePropertyArrayChangedConditionSupportedArrayType',
+ 'AutomationRulePropertyArrayChangedConditionSupportedChangeType',
+ 'AutomationRulePropertyArrayConditionSupportedArrayConditionType',
+ 'AutomationRulePropertyArrayConditionSupportedArrayType',
+ 'AutomationRulePropertyChangedConditionSupportedChangedType',
+ 'AutomationRulePropertyChangedConditionSupportedPropertyType',
+ 'AutomationRulePropertyConditionSupportedOperator',
+ 'AutomationRulePropertyConditionSupportedProperty',
+ 'BillingStatisticKind',
+ 'CcpAuthType',
+ 'ConditionType',
+ 'ConfidenceLevel',
+ 'ConfidenceScoreStatus',
+ 'ConfigurationType',
+ 'ConnectAuthKind',
+ 'Connective',
+ 'ConnectivityType',
+ 'ContentType',
+ 'CreatedByType',
+ 'CustomEntityQueryKind',
+ 'DataConnectorAuthorizationState',
+ 'DataConnectorDefinitionKind',
+ 'DataConnectorKind',
+ 'DataConnectorLicenseState',
+ 'DataTypeState',
+ 'DeleteStatus',
+ 'DeliveryAction',
+ 'DeliveryLocation',
+ 'DeploymentFetchStatus',
+ 'DeploymentResult',
+ 'DeploymentState',
+ 'DeviceImportance',
+ 'ElevationToken',
+ 'EnrichmentType',
+ 'EntityItemQueryKind',
+ 'EntityKindEnum',
+ 'EntityMappingType',
+ 'EntityProviders',
+ 'EntityQueryKind',
+ 'EntityQueryTemplateKind',
+ 'EntityTimelineKind',
+ 'EntityType',
+ 'EventGroupingAggregationKind',
+ 'FileFormat',
+ 'FileHashAlgorithm',
+ 'FileImportContentType',
+ 'FileImportState',
+ 'Flag',
+ 'GetInsightsError',
+ 'HttpMethodVerb',
+ 'HttpsConfigurationType',
+ 'HypothesisStatus',
+ 'IncidentClassification',
+ 'IncidentClassificationReason',
+ 'IncidentLabelType',
+ 'IncidentSeverity',
+ 'IncidentStatus',
+ 'IncidentTaskStatus',
+ 'IngestionMode',
+ 'IngestionType',
+ 'KeyVaultAuthenticationMode',
+ 'KillChainIntent',
+ 'Kind',
+ 'ListActionKind',
+ 'LogStatusType',
+ 'LogType',
+ 'MatchingMethod',
+ 'MicrosoftSecurityProductName',
+ 'Mode',
+ 'MtpProvider',
+ 'OSFamily',
+ 'Operator',
+ 'OutputType',
+ 'OwnerType',
+ 'PackageKind',
+ 'PermissionProviderScope',
+ 'PollingFrequency',
+ 'ProviderName',
+ 'ProviderPermissionsScope',
+ 'ProvisioningState',
+ 'RegistryHive',
+ 'RegistryValueKind',
+ 'RepoType',
+ 'RepositoryAccessKind',
+ 'RestApiPollerRequestPagingKind',
+ 'SapAuthenticationType',
+ 'SecretSource',
+ 'SecurityMLAnalyticsSettingsKind',
+ 'SettingKind',
+ 'SettingType',
+ 'SettingsStatus',
+ 'SortingDirection',
+ 'SourceKind',
+ 'SourceType',
+ 'State',
+ 'Status',
+ 'SupportTier',
+ 'SystemConfigurationConnectorType',
+ 'SystemStatusType',
+ 'TIObjectKind',
+ 'TemplateStatus',
+ 'ThreatIntelligenceResourceInnerKind',
+ 'ThreatIntelligenceSortingOrder',
+ 'TiType',
+ 'TriggerOperator',
+ 'TriggersOn',
+ 'TriggersWhen',
+ 'UebaDataSources',
+ 'Version',
+ 'WarningCode',
]
__all__.extend([p for p in _patch_all if p not in __all__])
_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..9f62474ae945 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
@@ -9,7 +9,7 @@
import datetime
import sys
-from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
+from typing import Any, Dict, List, Literal, Optional, TYPE_CHECKING, Union
from .. import _serialization
@@ -17,16 +17,11 @@
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
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
-JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
-
+JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
class DataConnectorsCheckRequirements(_serialization.Model):
"""Data connector requirements properties.
@@ -34,25 +29,26 @@ class DataConnectorsCheckRequirements(_serialization.Model):
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,
+ IoTCheckRequirements, MCASCheckRequirements, MDATPCheckRequirements,
+ MicrosoftPurviewInformationProtectionCheckRequirements, MSTICheckRequirements,
MtpCheckRequirements, Office365ProjectCheckRequirements, OfficeATPCheckRequirements,
OfficeIRMCheckRequirements, OfficePowerBICheckRequirements, TICheckRequirements,
TiTaxiiCheckRequirements
- 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".
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
"""
_validation = {
- "kind": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -60,52 +56,37 @@ class DataConnectorsCheckRequirements(_serialization.Model):
}
_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
+ 'kind': {'AmazonWebServicesCloudTrail': 'AwsCloudTrailCheckRequirements', 'AmazonWebServicesS3': 'AwsS3CheckRequirements', 'AzureActiveDirectory': 'AADCheckRequirements', 'AzureAdvancedThreatProtection': 'AATPCheckRequirements', 'AzureSecurityCenter': 'ASCCheckRequirements', 'Dynamics365': 'Dynamics365CheckRequirements', 'IOT': 'IoTCheckRequirements', 'MicrosoftCloudAppSecurity': 'MCASCheckRequirements', 'MicrosoftDefenderAdvancedThreatProtection': 'MDATPCheckRequirements', 'MicrosoftPurviewInformationProtection': 'MicrosoftPurviewInformationProtectionCheckRequirements', 'MicrosoftThreatIntelligence': 'MSTICheckRequirements', 'MicrosoftThreatProtection': 'MtpCheckRequirements', 'Office365Project': 'Office365ProjectCheckRequirements', 'OfficeATP': 'OfficeATPCheckRequirements', 'OfficeIRM': 'OfficeIRMCheckRequirements', 'OfficePowerBI': 'OfficePowerBICheckRequirements', 'ThreatIntelligence': 'TICheckRequirements', 'ThreatIntelligenceTaxii': 'TiTaxiiCheckRequirements'}
+ }
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.kind: Optional[str] = None
class AADCheckRequirements(DataConnectorsCheckRequirements):
- """Represents AAD (Azure Active Directory) requirements check request.
+ """Represents AADIP (Azure Active Directory Identity Protection) requirements check 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".
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
"""
_validation = {
- "kind": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -113,34 +94,43 @@ class AADCheckRequirements(DataConnectorsCheckRequirements):
"tenant_id": {"key": "properties.tenantId", "type": "str"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ tenant_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
: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.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.
+ 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
"""
_validation = {
- "tenant_id": {"required": True},
+ 'tenant_id': {'required': True},
}
_attribute_map = {
"tenant_id": {"key": "tenantId", "type": "str"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ tenant_id: str,
+ **kwargs: Any
+ ) -> None:
"""
:keyword tenant_id: The tenant id to connect to, and get the data from. Required.
:paramtype tenant_id: str
@@ -148,39 +138,22 @@ def __init__(self, *, tenant_id: str, **kwargs):
super().__init__(**kwargs)
self.tenant_id = tenant_id
-
class AADCheckRequirementsProperties(DataConnectorTenantId):
- """AAD (Azure Active Directory) requirements check properties.
+ """AADIP (Azure Active Directory Identity Protection) requirements check 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.
: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
@@ -193,10 +166,10 @@ class Resource(_serialization.Model):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
@@ -206,22 +179,25 @@ 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
self.name = None
self.type = None
self.system_data = None
-
class ResourceWithEtag(Resource):
"""An azure resource object with an Etag property.
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
@@ -236,10 +212,10 @@ class ResourceWithEtag(Resource):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
@@ -250,7 +226,12 @@ 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
@@ -258,24 +239,24 @@ def __init__(self, *, etag: Optional[str] = None, **kwargs):
super().__init__(**kwargs)
self.etag = etag
-
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
+ GCPDataConnector, CodelessUiDataConnector, IoTDataConnector, MCASDataConnector,
+ MDATPDataConnector, MicrosoftPurviewInformationProtectionDataConnector, MSTIDataConnector,
+ MTPDataConnector, OfficeDataConnector, Office365ProjectDataConnector, OfficeATPDataConnector,
+ OfficeIRMDataConnector, OfficePowerBIDataConnector, RestApiPollerDataConnector,
+ TIDataConnector, TiTaxiiDataConnector
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
@@ -290,19 +271,19 @@ class DataConnector(ResourceWithEtag):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -315,48 +296,31 @@ 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",
- "ThreatIntelligence": "TIDataConnector",
- "ThreatIntelligenceTaxii": "TiTaxiiDataConnector",
- }
- }
-
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ 'kind': {'APIPolling': 'CodelessApiPollingDataConnector', 'AmazonWebServicesCloudTrail': 'AwsCloudTrailDataConnector', 'AmazonWebServicesS3': 'AwsS3DataConnector', 'AzureActiveDirectory': 'AADDataConnector', 'AzureAdvancedThreatProtection': 'AATPDataConnector', 'AzureSecurityCenter': 'ASCDataConnector', 'Dynamics365': 'Dynamics365DataConnector', 'GCP': 'GCPDataConnector', 'GenericUI': 'CodelessUiDataConnector', 'IOT': 'IoTDataConnector', 'MicrosoftCloudAppSecurity': 'MCASDataConnector', 'MicrosoftDefenderAdvancedThreatProtection': 'MDATPDataConnector', 'MicrosoftPurviewInformationProtection': 'MicrosoftPurviewInformationProtectionDataConnector', 'MicrosoftThreatIntelligence': 'MSTIDataConnector', 'MicrosoftThreatProtection': 'MTPDataConnector', 'Office365': 'OfficeDataConnector', 'Office365Project': 'Office365ProjectDataConnector', 'OfficeATP': 'OfficeATPDataConnector', 'OfficeIRM': 'OfficeIRMDataConnector', 'OfficePowerBI': 'OfficePowerBIDataConnector', 'RestApiPoller': 'RestApiPollerDataConnector', 'ThreatIntelligence': 'TIDataConnector', 'ThreatIntelligenceTaxii': 'TiTaxiiDataConnector'}
+ }
+
+ 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
-
+ self.kind: Optional[str] = None
class AADDataConnector(DataConnector):
- """Represents AAD (Azure Active Directory) data connector.
+ """Represents AADIP (Azure Active Directory Identity 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
@@ -371,10 +335,10 @@ class AADDataConnector(DataConnector):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
@@ -383,11 +347,11 @@ class AADDataConnector(DataConnector):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -407,8 +371,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
@@ -418,11 +382,10 @@ def __init__(
:paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "AzureActiveDirectory"
+ self.kind: str = 'AzureActiveDirectory'
self.tenant_id = tenant_id
self.data_types = data_types
-
class DataConnectorWithAlertsProperties(_serialization.Model):
"""Data connector properties.
@@ -434,7 +397,12 @@ class DataConnectorWithAlertsProperties(_serialization.Model):
"data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
}
- def __init__(self, *, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs):
+ 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
@@ -442,11 +410,10 @@ def __init__(self, *, data_types: Optional["_models.AlertsDataTypeOfDataConnecto
super().__init__(**kwargs)
self.data_types = data_types
-
class AADDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsProperties):
- """AAD (Azure Active Directory) data connector properties.
+ """AADIP (Azure Active Directory Identity Protection) 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 data_types: The available data types for the connector.
:vartype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
@@ -455,7 +422,7 @@ class AADDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsP
"""
_validation = {
- "tenant_id": {"required": True},
+ 'tenant_id': {'required': True},
}
_attribute_map = {
@@ -464,8 +431,12 @@ class AADDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsP
}
def __init__(
- self, *, tenant_id: str, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs
- ):
+ self,
+ *,
+ tenant_id: str,
+ 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
@@ -476,26 +447,25 @@ def __init__(
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.
+ 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".
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
"""
_validation = {
- "kind": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -503,50 +473,38 @@ class AATPCheckRequirements(DataConnectorsCheckRequirements):
"tenant_id": {"key": "properties.tenantId", "type": "str"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ tenant_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
: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.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.
+ 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
"""
- _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
@@ -561,10 +519,10 @@ class AATPDataConnector(DataConnector):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
@@ -573,11 +531,11 @@ class AATPDataConnector(DataConnector):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -597,8 +555,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
@@ -608,15 +566,14 @@ def __init__(
:paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "AzureAdvancedThreatProtection"
+ self.kind: str = 'AzureAdvancedThreatProtection'
self.tenant_id = tenant_id
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.
+ 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
@@ -625,7 +582,7 @@ class AATPDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlerts
"""
_validation = {
- "tenant_id": {"required": True},
+ 'tenant_id': {'required': True},
}
_attribute_map = {
@@ -634,8 +591,12 @@ class AATPDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlerts
}
def __init__(
- self, *, tenant_id: str, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs
- ):
+ self,
+ *,
+ tenant_id: str,
+ 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
@@ -646,7 +607,6 @@ def __init__(
self.data_types = data_types
self.tenant_id = tenant_id
-
class Entity(Resource):
"""Specific entity.
@@ -658,10 +618,10 @@ class Entity(Resource):
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
@@ -675,15 +635,15 @@ class Entity(Resource):
"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
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityKindEnum
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -695,47 +655,27 @@ class Entity(Resource):
}
_subtype_map = {
- "kind": {
- "Account": "AccountEntity",
- "AzureResource": "AzureResourceEntity",
- "Bookmark": "HuntingBookmark",
- "CloudApplication": "CloudApplicationEntity",
- "DnsResolution": "DnsEntity",
- "File": "FileEntity",
- "FileHash": "FileHashEntity",
- "Host": "HostEntity",
- "IoTDevice": "IoTDeviceEntity",
- "Ip": "IpEntity",
- "MailCluster": "MailClusterEntity",
- "MailMessage": "MailMessageEntity",
- "Mailbox": "MailboxEntity",
- "Malware": "MalwareEntity",
- "Nic": "NicEntity",
- "Process": "ProcessEntity",
- "RegistryKey": "RegistryKeyEntity",
- "RegistryValue": "RegistryValueEntity",
- "SecurityAlert": "SecurityAlert",
- "SecurityGroup": "SecurityGroupEntity",
- "SubmissionMail": "SubmissionMailEntity",
- "Url": "UrlEntity",
- }
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: Optional[str] = None
+ 'kind': {'Account': 'AccountEntity', 'AzureResource': 'AzureResourceEntity', 'Bookmark': 'HuntingBookmark', 'CloudApplication': 'CloudApplicationEntity', 'DnsResolution': 'DnsEntity', 'File': 'FileEntity', 'FileHash': 'FileHashEntity', 'Host': 'HostEntity', 'IoTDevice': 'IoTDeviceEntity', 'Ip': 'IpEntity', 'MailCluster': 'MailClusterEntity', 'MailMessage': 'MailMessageEntity', 'Mailbox': 'MailboxEntity', 'Malware': 'MalwareEntity', 'Nic': 'NicEntity', 'Process': 'ProcessEntity', 'RegistryKey': 'RegistryKeyEntity', 'RegistryValue': 'RegistryValueEntity', 'SecurityAlert': 'SecurityAlert', 'SecurityGroup': 'SecurityGroupEntity', 'SubmissionMail': 'SubmissionMailEntity', 'Url': 'UrlEntity'}
+ }
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.kind: Optional[str] = None
class AccountEntity(Entity): # pylint: disable=too-many-instance-attributes
"""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
@@ -749,7 +689,7 @@ class AccountEntity(Entity): # pylint: disable=too-many-instance-attributes
"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
+ :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]
@@ -788,25 +728,25 @@ class AccountEntity(Entity): # pylint: disable=too-many-instance-attributes
"""
_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},
- "aad_tenant_id": {"readonly": True},
- "aad_user_id": {"readonly": True},
- "account_name": {"readonly": True},
- "display_name": {"readonly": True},
- "host_entity_id": {"readonly": True},
- "is_domain_joined": {"readonly": True},
- "nt_domain": {"readonly": True},
- "object_guid": {"readonly": True},
- "puid": {"readonly": True},
- "sid": {"readonly": True},
- "upn_suffix": {"readonly": True},
- "dns_domain": {"readonly": 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},
+ 'aad_tenant_id': {'readonly': True},
+ 'aad_user_id': {'readonly': True},
+ 'account_name': {'readonly': True},
+ 'display_name': {'readonly': True},
+ 'host_entity_id': {'readonly': True},
+ 'is_domain_joined': {'readonly': True},
+ 'nt_domain': {'readonly': True},
+ 'object_guid': {'readonly': True},
+ 'puid': {'readonly': True},
+ 'sid': {'readonly': True},
+ 'upn_suffix': {'readonly': True},
+ 'dns_domain': {'readonly': True},
}
_attribute_map = {
@@ -831,10 +771,14 @@ 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"
+ self.kind: str = 'Account'
self.additional_data = None
self.friendly_name = None
self.aad_tenant_id = None
@@ -850,7 +794,6 @@ def __init__(self, **kwargs):
self.upn_suffix = None
self.dns_domain = None
-
class EntityCommonProperties(_serialization.Model):
"""Entity common property bag.
@@ -865,8 +808,8 @@ class EntityCommonProperties(_serialization.Model):
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
}
_attribute_map = {
@@ -874,13 +817,16 @@ 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
"""Account entity property bag.
@@ -924,20 +870,20 @@ class AccountEntityProperties(EntityCommonProperties): # pylint: disable=too-ma
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "aad_tenant_id": {"readonly": True},
- "aad_user_id": {"readonly": True},
- "account_name": {"readonly": True},
- "display_name": {"readonly": True},
- "host_entity_id": {"readonly": True},
- "is_domain_joined": {"readonly": True},
- "nt_domain": {"readonly": True},
- "object_guid": {"readonly": True},
- "puid": {"readonly": True},
- "sid": {"readonly": True},
- "upn_suffix": {"readonly": True},
- "dns_domain": {"readonly": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'aad_tenant_id': {'readonly': True},
+ 'aad_user_id': {'readonly': True},
+ 'account_name': {'readonly': True},
+ 'display_name': {'readonly': True},
+ 'host_entity_id': {'readonly': True},
+ 'is_domain_joined': {'readonly': True},
+ 'nt_domain': {'readonly': True},
+ 'object_guid': {'readonly': True},
+ 'puid': {'readonly': True},
+ 'sid': {'readonly': True},
+ 'upn_suffix': {'readonly': True},
+ 'dns_domain': {'readonly': True},
}
_attribute_map = {
@@ -957,8 +903,12 @@ 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
self.aad_user_id = None
@@ -973,44 +923,80 @@ def __init__(self, **kwargs):
self.upn_suffix = None
self.dns_domain = None
+class Action(_serialization.Model):
+ """Represents an action to perform on a specific system.
+
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ LockUserAction, UnlockUserAction
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar kind: The actions kind. Required. Known values are: "LockUser" and "UnlockUser".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.ListActionKind
+ """
+
+ _validation = {
+ 'kind': {'required': True},
+ }
+
+ _attribute_map = {
+ "kind": {"key": "kind", "type": "str"},
+ }
+
+ _subtype_map = {
+ 'kind': {'LockUser': 'LockUserAction', 'UnlockUser': 'UnlockUserAction'}
+ }
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.kind: Optional[str] = None
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
"""
_validation = {
- "logic_app_resource_id": {"required": True},
+ 'logic_app_resource_id': {'required': True},
}
_attribute_map = {
"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
"""
super().__init__(**kwargs)
self.logic_app_resource_id = logic_app_resource_id
-
class ActionRequest(ResourceWithEtag):
"""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
@@ -1023,17 +1009,17 @@ 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
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
@@ -1052,13 +1038,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
@@ -1067,14 +1053,13 @@ def __init__(
self.logic_app_resource_id = logic_app_resource_id
self.trigger_uri = trigger_uri
-
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.
@@ -1082,8 +1067,8 @@ class ActionRequestProperties(ActionPropertiesBase):
"""
_validation = {
- "logic_app_resource_id": {"required": True},
- "trigger_uri": {"required": True},
+ 'logic_app_resource_id': {'required': True},
+ 'trigger_uri': {'required': True},
}
_attribute_map = {
@@ -1091,10 +1076,16 @@ 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.
@@ -1103,14 +1094,13 @@ def __init__(self, *, logic_app_resource_id: str, trigger_uri: str, **kwargs):
super().__init__(logic_app_resource_id=logic_app_resource_id, **kwargs)
self.trigger_uri = trigger_uri
-
class ActionResponse(ResourceWithEtag):
"""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
@@ -1123,17 +1113,17 @@ class ActionResponse(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 workflow_id: The name of the logic app's workflow.
:vartype workflow_id: str
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
@@ -1152,13 +1142,13 @@ 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.
: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
@@ -1167,14 +1157,13 @@ def __init__(
self.logic_app_resource_id = logic_app_resource_id
self.workflow_id = workflow_id
-
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.
@@ -1182,7 +1171,7 @@ class ActionResponseProperties(ActionPropertiesBase):
"""
_validation = {
- "logic_app_resource_id": {"required": True},
+ 'logic_app_resource_id': {'required': True},
}
_attribute_map = {
@@ -1190,10 +1179,16 @@ 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.
@@ -1202,13 +1197,12 @@ def __init__(self, *, logic_app_resource_id: str, workflow_id: Optional[str] = N
super().__init__(logic_app_resource_id=logic_app_resource_id, **kwargs)
self.workflow_id = workflow_id
-
class ActionsList(_serialization.Model):
"""List all the actions.
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
@@ -1217,8 +1211,8 @@ class ActionsList(_serialization.Model):
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
@@ -1226,7 +1220,12 @@ 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]
@@ -1235,7 +1234,6 @@ def __init__(self, *, value: List["_models.ActionResponse"], **kwargs):
self.next_link = None
self.value = value
-
class CustomEntityQuery(ResourceWithEtag):
"""Specific entity query that supports put requests.
@@ -1244,10 +1242,10 @@ class CustomEntityQuery(ResourceWithEtag):
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
@@ -1264,11 +1262,11 @@ class CustomEntityQuery(ResourceWithEtag):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -1280,26 +1278,32 @@ class CustomEntityQuery(ResourceWithEtag):
"kind": {"key": "kind", "type": "str"},
}
- _subtype_map = {"kind": {"Activity": "ActivityCustomEntityQuery"}}
+ _subtype_map = {
+ 'kind': {'Activity': 'ActivityCustomEntityQuery'}
+ }
- 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
"""
super().__init__(etag=etag, **kwargs)
- self.kind: Optional[str] = None
-
+ self.kind: Optional[str] = None
class ActivityCustomEntityQuery(CustomEntityQuery): # 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.
+ 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
@@ -1344,13 +1348,13 @@ class ActivityCustomEntityQuery(CustomEntityQuery): # pylint: disable=too-many-
"""
_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},
+ '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 = {
@@ -1363,10 +1367,7 @@ class ActivityCustomEntityQuery(CustomEntityQuery): # pylint: disable=too-many-
"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",
- },
+ "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]}"},
@@ -1389,8 +1390,8 @@ def __init__(
entities_filter: Optional[Dict[str, List[str]]] = None,
template_name: Optional[str] = None,
enabled: Optional[bool] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -1420,7 +1421,7 @@ def __init__(
:paramtype enabled: bool
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "Activity"
+ self.kind: str = 'Activity'
self.title = title
self.content = content
self.description = description
@@ -1433,8 +1434,7 @@ def __init__(
self.created_time_utc = None
self.last_modified_time_utc = None
-
-class ActivityEntityQueriesPropertiesQueryDefinitions(_serialization.Model):
+class ActivityEntityQueriesPropertiesQueryDefinitions(_serialization.Model): # pylint: disable=name-too-long
"""The Activity query definitions.
:ivar query: The Activity query to run on a given entity.
@@ -1445,7 +1445,12 @@ class ActivityEntityQueriesPropertiesQueryDefinitions(_serialization.Model):
"query": {"key": "query", "type": "str"},
}
- def __init__(self, *, query: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ query: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword query: The Activity query to run on a given entity.
:paramtype query: str
@@ -1453,7 +1458,6 @@ def __init__(self, *, query: Optional[str] = None, **kwargs):
super().__init__(**kwargs)
self.query = query
-
class EntityQuery(ResourceWithEtag):
"""Specific entity query.
@@ -1462,10 +1466,10 @@ class EntityQuery(ResourceWithEtag):
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
@@ -1483,11 +1487,11 @@ class EntityQuery(ResourceWithEtag):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -1499,26 +1503,32 @@ class EntityQuery(ResourceWithEtag):
"kind": {"key": "kind", "type": "str"},
}
- _subtype_map = {"kind": {"Activity": "ActivityEntityQuery", "Expansion": "ExpansionEntityQuery"}}
+ _subtype_map = {
+ 'kind': {'Activity': 'ActivityEntityQuery', 'Expansion': 'ExpansionEntityQuery'}
+ }
- 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
"""
super().__init__(etag=etag, **kwargs)
- self.kind: Optional[str] = None
-
+ self.kind: Optional[str] = None
class ActivityEntityQuery(EntityQuery): # 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.
+ 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
@@ -1564,13 +1574,13 @@ class ActivityEntityQuery(EntityQuery): # pylint: disable=too-many-instance-att
"""
_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},
+ '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 = {
@@ -1583,10 +1593,7 @@ class ActivityEntityQuery(EntityQuery): # pylint: disable=too-many-instance-att
"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",
- },
+ "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]}"},
@@ -1609,8 +1616,8 @@ def __init__(
entities_filter: Optional[Dict[str, List[str]]] = None,
template_name: Optional[str] = None,
enabled: Optional[bool] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -1640,7 +1647,7 @@ def __init__(
:paramtype enabled: bool
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "Activity"
+ self.kind: str = 'Activity'
self.title = title
self.content = content
self.description = description
@@ -1653,7 +1660,6 @@ def __init__(
self.created_time_utc = None
self.last_modified_time_utc = None
-
class EntityQueryTemplate(Resource):
"""Specific entity query template.
@@ -1662,10 +1668,10 @@ class EntityQueryTemplate(Resource):
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,16 +1681,17 @@ 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"
+ :ivar kind: the entity query template kind. Required. Known values are: "Activity", "Insight",
+ "SecurityAlert", "Bookmark", "Expansion", "GuidedInsight", and "Anomaly".
:vartype kind: str or ~azure.mgmt.securityinsight.models.EntityQueryTemplateKind
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -1695,23 +1702,28 @@ class EntityQueryTemplate(Resource):
"kind": {"key": "kind", "type": "str"},
}
- _subtype_map = {"kind": {"Activity": "ActivityEntityQueryTemplate"}}
+ _subtype_map = {
+ 'kind': {'Activity': 'ActivityEntityQueryTemplate'}
+ }
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
super().__init__(**kwargs)
- self.kind: Optional[str] = None
-
+ 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.
+ 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
@@ -1721,7 +1733,8 @@ class ActivityEntityQueryTemplate(EntityQueryTemplate): # pylint: disable=too-m
: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"
+ :ivar kind: the entity query template kind. Required. Known values are: "Activity", "Insight",
+ "SecurityAlert", "Bookmark", "Expansion", "GuidedInsight", and "Anomaly".
:vartype kind: str or ~azure.mgmt.securityinsight.models.EntityQueryTemplateKind
:ivar title: The entity query title.
:vartype title: str
@@ -1748,11 +1761,11 @@ class ActivityEntityQueryTemplate(EntityQueryTemplate): # pylint: disable=too-m
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -1764,10 +1777,7 @@ class ActivityEntityQueryTemplate(EntityQueryTemplate): # pylint: disable=too-m
"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",
- },
+ "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]]"},
@@ -1785,8 +1795,8 @@ def __init__(
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
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword title: The entity query title.
:paramtype title: str
@@ -1812,7 +1822,7 @@ def __init__(
:paramtype entities_filter: dict[str, list[str]]
"""
super().__init__(**kwargs)
- self.kind: str = "Activity"
+ self.kind: str = 'Activity'
self.title = title
self.content = content
self.description = description
@@ -1822,8 +1832,7 @@ def __init__(
self.required_input_fields_sets = required_input_fields_sets
self.entities_filter = entities_filter
-
-class ActivityEntityQueryTemplatePropertiesQueryDefinitions(_serialization.Model):
+class ActivityEntityQueryTemplatePropertiesQueryDefinitions(_serialization.Model): # pylint: disable=name-too-long
"""The Activity query definitions.
:ivar query: The Activity query to run on a given entity.
@@ -1838,7 +1847,13 @@ class ActivityEntityQueryTemplatePropertiesQueryDefinitions(_serialization.Model
"summarize_by": {"key": "summarizeBy", "type": "str"},
}
- def __init__(self, *, query: Optional[str] = None, summarize_by: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ query: Optional[str] = None,
+ summarize_by: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword query: The Activity query to run on a given entity.
:paramtype query: str
@@ -1850,14 +1865,13 @@ def __init__(self, *, query: Optional[str] = None, summarize_by: Optional[str] =
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.
+ 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".
@@ -1865,7 +1879,7 @@ class EntityTimelineItem(_serialization.Model):
"""
_validation = {
- "kind": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -1873,24 +1887,22 @@ class EntityTimelineItem(_serialization.Model):
}
_subtype_map = {
- "kind": {
- "Activity": "ActivityTimelineItem",
- "Anomaly": "AnomalyTimelineItem",
- "Bookmark": "BookmarkTimelineItem",
- "SecurityAlert": "SecurityAlertTimelineItem",
- }
+ 'kind': {'Activity': 'ActivityTimelineItem', 'Anomaly': 'AnomalyTimelineItem', 'Bookmark': 'BookmarkTimelineItem', 'SecurityAlert': 'SecurityAlertTimelineItem'}
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
super().__init__(**kwargs)
- self.kind: Optional[str] = None
-
+ self.kind: Optional[str] = None
class ActivityTimelineItem(EntityTimelineItem):
"""Represents Activity timeline item.
- 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".
@@ -1912,14 +1924,14 @@ class ActivityTimelineItem(EntityTimelineItem):
"""
_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},
+ '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 = {
@@ -1943,8 +1955,8 @@ def __init__(
last_activity_time_utc: datetime.datetime,
content: str,
title: str,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword query_id: The activity query id. Required.
:paramtype query_id: str
@@ -1964,7 +1976,7 @@ def __init__(
:paramtype title: str
"""
super().__init__(**kwargs)
- self.kind: str = "Activity"
+ 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
@@ -1973,11 +1985,10 @@ def __init__(
self.content = content
self.title = title
-
class AddIncidentTaskActionProperties(_serialization.Model):
"""AddIncidentTaskActionProperties.
- 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
@@ -1986,7 +1997,7 @@ class AddIncidentTaskActionProperties(_serialization.Model):
"""
_validation = {
- "title": {"required": True},
+ 'title': {'required': True},
}
_attribute_map = {
@@ -1994,7 +2005,13 @@ class AddIncidentTaskActionProperties(_serialization.Model):
"description": {"key": "description", "type": "str"},
}
- def __init__(self, *, title: str, description: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ title: str,
+ description: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword title: The title of the task. Required.
:paramtype title: str
@@ -2005,6 +2022,69 @@ def __init__(self, *, title: str, description: Optional[str] = None, **kwargs):
self.title = title
self.description = description
+class AgentConfiguration(_serialization.Model):
+ """Describes the configuration of a Business Application Agent.
+
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ SapAgentConfiguration
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar type: Type of the agent. Required. "SAP"
+ :vartype type: str or ~azure.mgmt.securityinsight.models.AgentType
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ }
+
+ _subtype_map = {
+ 'type': {'SAP': 'SapAgentConfiguration'}
+ }
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.type: Optional[str] = None
+
+class AgentSystem(_serialization.Model):
+ """Describes the configuration of a system inside the agent.
+
+ :ivar system_resource_name:
+ :vartype system_resource_name: str
+ :ivar system_display_name:
+ :vartype system_display_name: str
+ """
+
+ _attribute_map = {
+ "system_resource_name": {"key": "systemResourceName", "type": "str"},
+ "system_display_name": {"key": "systemDisplayName", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ system_resource_name: Optional[str] = None,
+ system_display_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword system_resource_name:
+ :paramtype system_resource_name: str
+ :keyword system_display_name:
+ :paramtype system_display_name: str
+ """
+ super().__init__(**kwargs)
+ self.system_resource_name = system_resource_name
+ self.system_display_name = system_display_name
class AlertDetailsOverride(_serialization.Model):
"""Settings for how to dynamically override alert static details.
@@ -2040,8 +2120,8 @@ def __init__(
alert_tactics_column_name: Optional[str] = None,
alert_severity_column_name: Optional[str] = None,
alert_dynamic_properties: Optional[List["_models.AlertPropertyMapping"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword alert_display_name_format: the format containing columns name(s) to override the alert
name.
@@ -2064,13 +2144,12 @@ def __init__(
self.alert_severity_column_name = alert_severity_column_name
self.alert_dynamic_properties = alert_dynamic_properties
-
class AlertPropertyMapping(_serialization.Model):
"""A single alert property mapping to override.
:ivar alert_property: The V3 alert property. Known values are: "AlertLink", "ConfidenceLevel",
"ConfidenceScore", "ExtendedLinks", "ProductName", "ProviderName", "ProductComponentName",
- "RemediationSteps", and "Techniques".
+ "RemediationSteps", "Techniques", and "SubTechniques".
:vartype alert_property: str or ~azure.mgmt.securityinsight.models.AlertProperty
:ivar value: the column name to use to override this property.
:vartype value: str
@@ -2086,12 +2165,12 @@ def __init__(
*,
alert_property: Optional[Union[str, "_models.AlertProperty"]] = None,
value: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword alert_property: The V3 alert property. Known values are: "AlertLink",
"ConfidenceLevel", "ConfidenceScore", "ExtendedLinks", "ProductName", "ProviderName",
- "ProductComponentName", "RemediationSteps", and "Techniques".
+ "ProductComponentName", "RemediationSteps", "Techniques", and "SubTechniques".
:paramtype alert_property: str or ~azure.mgmt.securityinsight.models.AlertProperty
:keyword value: the column name to use to override this property.
:paramtype value: str
@@ -2100,7 +2179,6 @@ def __init__(
self.alert_property = alert_property
self.value = value
-
class AlertRule(ResourceWithEtag):
"""Alert rule.
@@ -2110,10 +2188,10 @@ class AlertRule(ResourceWithEtag):
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
@@ -2132,11 +2210,11 @@ class AlertRule(ResourceWithEtag):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -2149,31 +2227,28 @@ class AlertRule(ResourceWithEtag):
}
_subtype_map = {
- "kind": {
- "Fusion": "FusionAlertRule",
- "MLBehaviorAnalytics": "MLBehaviorAnalyticsAlertRule",
- "MicrosoftSecurityIncidentCreation": "MicrosoftSecurityIncidentCreationAlertRule",
- "NRT": "NrtAlertRule",
- "Scheduled": "ScheduledAlertRule",
- "ThreatIntelligence": "ThreatIntelligenceAlertRule",
- }
+ 'kind': {'Fusion': 'FusionAlertRule', 'MLBehaviorAnalytics': 'MLBehaviorAnalyticsAlertRule', 'MicrosoftSecurityIncidentCreation': 'MicrosoftSecurityIncidentCreationAlertRule', 'NRT': 'NrtAlertRule', 'Scheduled': 'ScheduledAlertRule', 'ThreatIntelligence': 'ThreatIntelligenceAlertRule'}
}
- 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
"""
super().__init__(etag=etag, **kwargs)
- self.kind: Optional[str] = None
-
+ 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.
+ All required parameters must be populated in order to send to server.
:ivar next_link: URL to fetch the next set of alert rules.
:vartype next_link: str
@@ -2182,8 +2257,8 @@ class AlertRulesList(_serialization.Model):
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
@@ -2191,7 +2266,12 @@ class AlertRulesList(_serialization.Model):
"value": {"key": "value", "type": "[AlertRule]"},
}
- def __init__(self, *, value: List["_models.AlertRule"], **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.AlertRule"],
+ **kwargs: Any
+ ) -> None:
"""
:keyword value: Array of alert rules. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.AlertRule]
@@ -2200,7 +2280,6 @@ def __init__(self, *, value: List["_models.AlertRule"], **kwargs):
self.next_link = None
self.value = value
-
class AlertRuleTemplate(Resource):
"""Alert rule template.
@@ -2211,10 +2290,10 @@ class AlertRuleTemplate(Resource):
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
@@ -2231,11 +2310,11 @@ class AlertRuleTemplate(Resource):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -2247,21 +2326,17 @@ class AlertRuleTemplate(Resource):
}
_subtype_map = {
- "kind": {
- "Fusion": "FusionAlertRuleTemplate",
- "MLBehaviorAnalytics": "MLBehaviorAnalyticsAlertRuleTemplate",
- "MicrosoftSecurityIncidentCreation": "MicrosoftSecurityIncidentCreationAlertRuleTemplate",
- "NRT": "NrtAlertRuleTemplate",
- "Scheduled": "ScheduledAlertRuleTemplate",
- "ThreatIntelligence": "ThreatIntelligenceAlertRuleTemplate",
- }
+ 'kind': {'Fusion': 'FusionAlertRuleTemplate', 'MLBehaviorAnalytics': 'MLBehaviorAnalyticsAlertRuleTemplate', 'MicrosoftSecurityIncidentCreation': 'MicrosoftSecurityIncidentCreationAlertRuleTemplate', 'NRT': 'NrtAlertRuleTemplate', 'Scheduled': 'ScheduledAlertRuleTemplate', 'ThreatIntelligence': 'ThreatIntelligenceAlertRuleTemplate'}
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
super().__init__(**kwargs)
- self.kind: Optional[str] = None
-
+ self.kind: Optional[str] = None
class AlertRuleTemplateDataSource(_serialization.Model):
"""alert rule template data sources.
@@ -2277,7 +2352,13 @@ class AlertRuleTemplateDataSource(_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
@@ -2288,7 +2369,6 @@ def __init__(self, *, connector_id: Optional[str] = None, data_types: Optional[L
self.connector_id = connector_id
self.data_types = data_types
-
class AlertRuleTemplatePropertiesBase(_serialization.Model):
"""Base alert rule template property bag.
@@ -2314,8 +2394,8 @@ class AlertRuleTemplatePropertiesBase(_serialization.Model):
"""
_validation = {
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
+ 'last_updated_date_utc': {'readonly': True},
+ 'created_date_utc': {'readonly': True},
}
_attribute_map = {
@@ -2336,8 +2416,8 @@ def __init__(
display_name: Optional[str] = None,
required_data_connectors: Optional[List["_models.AlertRuleTemplateDataSource"]] = None,
status: Optional[Union[str, "_models.TemplateStatus"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword alert_rules_created_by_template_count: the number of alert rules that were created by
this template.
@@ -2362,13 +2442,12 @@ def __init__(
self.required_data_connectors = required_data_connectors
self.status = status
-
class AlertRuleTemplatesList(_serialization.Model):
"""List all the alert rule 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.
+ 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
@@ -2377,8 +2456,8 @@ class AlertRuleTemplatesList(_serialization.Model):
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
@@ -2386,7 +2465,12 @@ class AlertRuleTemplatesList(_serialization.Model):
"value": {"key": "value", "type": "[AlertRuleTemplate]"},
}
- def __init__(self, *, value: List["_models.AlertRuleTemplate"], **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.AlertRuleTemplate"],
+ **kwargs: Any
+ ) -> None:
"""
:keyword value: Array of alert rule templates. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.AlertRuleTemplate]
@@ -2395,7 +2479,6 @@ def __init__(self, *, value: List["_models.AlertRuleTemplate"], **kwargs):
self.next_link = None
self.value = value
-
class AlertRuleTemplateWithMitreProperties(AlertRuleTemplatePropertiesBase):
"""Alert rule template with MITRE property bag.
@@ -2425,8 +2508,8 @@ class AlertRuleTemplateWithMitreProperties(AlertRuleTemplatePropertiesBase):
"""
_validation = {
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
+ 'last_updated_date_utc': {'readonly': True},
+ 'created_date_utc': {'readonly': True},
}
_attribute_map = {
@@ -2451,8 +2534,8 @@ def __init__(
status: Optional[Union[str, "_models.TemplateStatus"]] = None,
tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
techniques: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword alert_rules_created_by_template_count: the number of alert rules that were created by
this template.
@@ -2472,36 +2555,33 @@ def __init__(
: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
- )
+ 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.
+ All required parameters must be populated in order to send to server.
:ivar alerts: Alerts data type connection. Required.
:vartype alerts: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
"""
_validation = {
- "alerts": {"required": True},
+ 'alerts': {'required': True},
}
_attribute_map = {
"alerts": {"key": "alerts", "type": "DataConnectorDataTypeCommon"},
}
- def __init__(self, *, alerts: "_models.DataConnectorDataTypeCommon", **kwargs):
+ def __init__(
+ self,
+ *,
+ alerts: "_models.DataConnectorDataTypeCommon",
+ **kwargs: Any
+ ) -> None:
"""
:keyword alerts: Alerts data type connection. Required.
:paramtype alerts: ~azure.mgmt.securityinsight.models.DataConnectorDataTypeCommon
@@ -2509,19 +2589,48 @@ def __init__(self, *, alerts: "_models.DataConnectorDataTypeCommon", **kwargs):
super().__init__(**kwargs)
self.alerts = alerts
+class AnalyticsRuleRunTrigger(_serialization.Model):
+ """Analytics Rule Run Trigger request.
-class Settings(ResourceWithEtag):
- """The Setting.
+ All required parameters must be populated in order to send to server.
+
+ :ivar execution_time_utc: Required.
+ :vartype execution_time_utc: ~datetime.datetime
+ """
+
+ _validation = {
+ 'execution_time_utc': {'required': True},
+ }
+
+ _attribute_map = {
+ "execution_time_utc": {"key": "properties.executionTimeUtc", "type": "iso-8601"},
+ }
+
+ def __init__(
+ self,
+ *,
+ execution_time_utc: datetime.datetime,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword execution_time_utc: Required.
+ :paramtype execution_time_utc: ~datetime.datetime
+ """
+ super().__init__(**kwargs)
+ self.execution_time_utc = execution_time_utc
+
+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
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
@@ -2539,11 +2648,11 @@ class Settings(ResourceWithEtag):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -2556,27 +2665,31 @@ class Settings(ResourceWithEtag):
}
_subtype_map = {
- "kind": {"Anomalies": "Anomalies", "EntityAnalytics": "EntityAnalytics", "EyesOn": "EyesOn", "Ueba": "Ueba"}
+ 'kind': {'Anomalies': 'Anomalies', 'EntityAnalytics': 'EntityAnalytics', 'EyesOn': 'EyesOn', 'Ueba': 'Ueba'}
}
- 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
"""
super().__init__(etag=etag, **kwargs)
- self.kind: Optional[str] = None
-
+ self.kind: Optional[str] = None
class Anomalies(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.
+ 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
@@ -2596,12 +2709,12 @@ class Anomalies(Settings):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "is_enabled": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'is_enabled': {'readonly': True},
}
_attribute_map = {
@@ -2614,16 +2727,20 @@ class Anomalies(Settings):
"is_enabled": {"key": "properties.isEnabled", "type": "bool"},
}
- 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
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "Anomalies"
+ self.kind: str = 'Anomalies'
self.is_enabled = None
-
class SecurityMLAnalyticsSetting(ResourceWithEtag):
"""Security ML Analytics Setting.
@@ -2632,10 +2749,10 @@ class SecurityMLAnalyticsSetting(ResourceWithEtag):
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
@@ -2652,11 +2769,11 @@ class SecurityMLAnalyticsSetting(ResourceWithEtag):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -2668,26 +2785,32 @@ class SecurityMLAnalyticsSetting(ResourceWithEtag):
"kind": {"key": "kind", "type": "str"},
}
- _subtype_map = {"kind": {"Anomaly": "AnomalySecurityMLAnalyticsSettings"}}
+ _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
"""
super().__init__(etag=etag, **kwargs)
- self.kind: Optional[str] = None
-
+ self.kind: Optional[str] = None
class AnomalySecurityMLAnalyticsSettings(SecurityMLAnalyticsSetting): # pylint: disable=too-many-instance-attributes
"""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
@@ -2737,12 +2860,12 @@ class AnomalySecurityMLAnalyticsSettings(SecurityMLAnalyticsSetting): # pylint:
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "last_modified_utc": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'last_modified_utc': {'readonly': True},
}
_attribute_map = {
@@ -2756,10 +2879,7 @@ class AnomalySecurityMLAnalyticsSettings(SecurityMLAnalyticsSetting): # pylint:
"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]",
- },
+ "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"},
@@ -2788,8 +2908,8 @@ def __init__(
is_default_settings: Optional[bool] = None,
anomaly_settings_version: Optional[int] = None,
settings_definition_id: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -2828,7 +2948,7 @@ def __init__(
:paramtype settings_definition_id: str
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "Anomaly"
+ self.kind: str = 'Anomaly'
self.description = description
self.display_name = display_name
self.enabled = enabled
@@ -2844,11 +2964,10 @@ def __init__(
self.anomaly_settings_version = anomaly_settings_version
self.settings_definition_id = settings_definition_id
-
class AnomalyTimelineItem(EntityTimelineItem): # pylint: disable=too-many-instance-attributes
"""Represents anomaly timeline item.
- 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".
@@ -2878,12 +2997,12 @@ class AnomalyTimelineItem(EntityTimelineItem): # pylint: disable=too-many-insta
"""
_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},
+ '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},
}
_attribute_map = {
@@ -2915,8 +3034,8 @@ def __init__(
intent: Optional[str] = None,
techniques: Optional[List[str]] = None,
reasons: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword azure_resource_id: The anomaly azure resource id. Required.
:paramtype azure_resource_id: str
@@ -2942,7 +3061,7 @@ def __init__(
:paramtype reasons: list[str]
"""
super().__init__(**kwargs)
- self.kind: str = "Anomaly"
+ self.kind: str = 'Anomaly'
self.azure_resource_id = azure_resource_id
self.product_name = product_name
self.description = description
@@ -2955,26 +3074,120 @@ def __init__(
self.techniques = techniques
self.reasons = reasons
+class CcpAuthConfig(_serialization.Model):
+ """Base Model for API authentication.
+
+ 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 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
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ }
+
+ _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.type: Optional[str] = None
+
+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.
+
+ 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 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 = {
+ 'type': {'required': True},
+ 'api_key': {'required': True},
+ 'api_key_name': {'required': True},
+ }
+
+ _attribute_map = {
+ "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,
+ *,
+ 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 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.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 ASCCheckRequirements(DataConnectorsCheckRequirements):
"""Represents ASC (Azure Security Center) requirements check 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".
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", and "RestApiPoller".
: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},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -2982,25 +3195,29 @@ class ASCCheckRequirements(DataConnectorsCheckRequirements):
"subscription_id": {"key": "properties.subscriptionId", "type": "str"},
}
- def __init__(self, *, subscription_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ subscription_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword subscription_id: The subscription id to connect to, and get the data from.
:paramtype subscription_id: str
"""
super().__init__(**kwargs)
- self.kind: str = "AzureSecurityCenter"
+ self.kind: str = 'AzureSecurityCenter'
self.subscription_id = subscription_id
-
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
@@ -3015,10 +3232,10 @@ class ASCDataConnector(DataConnector):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
@@ -3027,11 +3244,11 @@ class ASCDataConnector(DataConnector):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -3051,8 +3268,8 @@ def __init__(
etag: Optional[str] = None,
data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
subscription_id: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -3062,11 +3279,10 @@ def __init__(
:paramtype subscription_id: str
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "AzureSecurityCenter"
+ self.kind: str = 'AzureSecurityCenter'
self.data_types = data_types
self.subscription_id = subscription_id
-
class ASCDataConnectorProperties(DataConnectorWithAlertsProperties):
"""ASC (Azure Security Center) data connector properties.
@@ -3086,8 +3302,8 @@ def __init__(
*,
data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
subscription_id: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword data_types: The available data types for the connector.
:paramtype data_types: ~azure.mgmt.securityinsight.models.AlertsDataTypeOfDataConnector
@@ -3097,16 +3313,242 @@ def __init__(
super().__init__(data_types=data_types, **kwargs)
self.subscription_id = subscription_id
+class AssignmentItem(_serialization.Model):
+ """An entity describing a content item.
+
+ :ivar resource_id: The resource id of the content item.
+ :vartype resource_id: str
+ """
+
+ _attribute_map = {
+ "resource_id": {"key": "resourceId", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ resource_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource_id: The resource id of the content item.
+ :paramtype resource_id: str
+ """
+ super().__init__(**kwargs)
+ self.resource_id = resource_id
+
+class TIObject(Resource): # pylint: disable=too-many-instance-attributes
+ """Represents a threat intelligence object in Azure Security Insights.
+
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ AttackPattern, Identity, Indicator, Relationship, ThreatActor
+
+ 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 kind: The kind of the TI object. Required. Known values are: "AttackPattern", "Identity",
+ "Indicator", "Relationship", and "ThreatActor".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.TIObjectKind
+ :ivar data: The core STIX object that this TI object represents.
+ :vartype data: dict[str, any]
+ :ivar created_by: The UserInfo of the user/entity which originally created this TI object.
+ :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar source: The source name for this TI object.
+ :vartype source: str
+ :ivar first_ingested_time_utc: The timestamp for the first time this object was ingested.
+ :vartype first_ingested_time_utc: ~datetime.datetime
+ :ivar last_ingested_time_utc: The timestamp for the last time this object was ingested.
+ :vartype last_ingested_time_utc: ~datetime.datetime
+ :ivar ingestion_rules_version: The ID of the rules version that was active when this TI object
+ was last ingested.
+ :vartype ingestion_rules_version: str
+ :ivar last_update_method: The name of the method/application that initiated the last write to
+ this TI object.
+ :vartype last_update_method: str
+ :ivar last_modified_by: The UserInfo of the user/entity which last modified this TI object.
+ :vartype last_modified_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar last_updated_date_time_utc: The timestamp for the last time this TI object was updated.
+ :vartype last_updated_date_time_utc: ~datetime.datetime
+ :ivar relationship_hints: A dictionary used to help follow relationships from this object to
+ other STIX objects. The keys are field names from the STIX object (in the 'data' field), and
+ the values are lists of sources that can be prepended to the object ID in order to efficiently
+ locate the target TI object.
+ :vartype relationship_hints: list[~azure.mgmt.securityinsight.models.RelationshipHint]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'data': {'readonly': True},
+ 'created_by': {'readonly': True},
+ 'source': {'readonly': True},
+ 'first_ingested_time_utc': {'readonly': True},
+ 'last_ingested_time_utc': {'readonly': True},
+ 'ingestion_rules_version': {'readonly': True},
+ 'last_update_method': {'readonly': True},
+ 'last_modified_by': {'readonly': True},
+ 'last_updated_date_time_utc': {'readonly': True},
+ 'relationship_hints': {'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"},
+ "data": {"key": "properties.data", "type": "{object}"},
+ "created_by": {"key": "properties.createdBy", "type": "UserInfo"},
+ "source": {"key": "properties.source", "type": "str"},
+ "first_ingested_time_utc": {"key": "properties.firstIngestedTimeUtc", "type": "iso-8601"},
+ "last_ingested_time_utc": {"key": "properties.lastIngestedTimeUtc", "type": "iso-8601"},
+ "ingestion_rules_version": {"key": "properties.ingestionRulesVersion", "type": "str"},
+ "last_update_method": {"key": "properties.lastUpdateMethod", "type": "str"},
+ "last_modified_by": {"key": "properties.lastModifiedBy", "type": "UserInfo"},
+ "last_updated_date_time_utc": {"key": "properties.lastUpdatedDateTimeUtc", "type": "iso-8601"},
+ "relationship_hints": {"key": "properties.relationshipHints", "type": "[RelationshipHint]"},
+ }
+
+ _subtype_map = {
+ 'kind': {'AttackPattern': 'AttackPattern', 'Identity': 'Identity', 'Indicator': 'Indicator', 'Relationship': 'Relationship', 'ThreatActor': 'ThreatActor'}
+ }
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.kind: Optional[str] = None
+ self.data = None
+ self.created_by = None
+ self.source = None
+ self.first_ingested_time_utc = None
+ self.last_ingested_time_utc = None
+ self.ingestion_rules_version = None
+ self.last_update_method = None
+ self.last_modified_by = None
+ self.last_updated_date_time_utc = None
+ self.relationship_hints = None
+
+class AttackPattern(TIObject): # pylint: disable=too-many-instance-attributes
+ """Represents an attack pattern 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 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 TI object. Required. Known values are: "AttackPattern", "Identity",
+ "Indicator", "Relationship", and "ThreatActor".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.TIObjectKind
+ :ivar data: The core STIX object that this TI object represents.
+ :vartype data: dict[str, any]
+ :ivar created_by: The UserInfo of the user/entity which originally created this TI object.
+ :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar source: The source name for this TI object.
+ :vartype source: str
+ :ivar first_ingested_time_utc: The timestamp for the first time this object was ingested.
+ :vartype first_ingested_time_utc: ~datetime.datetime
+ :ivar last_ingested_time_utc: The timestamp for the last time this object was ingested.
+ :vartype last_ingested_time_utc: ~datetime.datetime
+ :ivar ingestion_rules_version: The ID of the rules version that was active when this TI object
+ was last ingested.
+ :vartype ingestion_rules_version: str
+ :ivar last_update_method: The name of the method/application that initiated the last write to
+ this TI object.
+ :vartype last_update_method: str
+ :ivar last_modified_by: The UserInfo of the user/entity which last modified this TI object.
+ :vartype last_modified_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar last_updated_date_time_utc: The timestamp for the last time this TI object was updated.
+ :vartype last_updated_date_time_utc: ~datetime.datetime
+ :ivar relationship_hints: A dictionary used to help follow relationships from this object to
+ other STIX objects. The keys are field names from the STIX object (in the 'data' field), and
+ the values are lists of sources that can be prepended to the object ID in order to efficiently
+ locate the target TI object.
+ :vartype relationship_hints: list[~azure.mgmt.securityinsight.models.RelationshipHint]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'data': {'readonly': True},
+ 'created_by': {'readonly': True},
+ 'source': {'readonly': True},
+ 'first_ingested_time_utc': {'readonly': True},
+ 'last_ingested_time_utc': {'readonly': True},
+ 'ingestion_rules_version': {'readonly': True},
+ 'last_update_method': {'readonly': True},
+ 'last_modified_by': {'readonly': True},
+ 'last_updated_date_time_utc': {'readonly': True},
+ 'relationship_hints': {'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"},
+ "data": {"key": "properties.data", "type": "{object}"},
+ "created_by": {"key": "properties.createdBy", "type": "UserInfo"},
+ "source": {"key": "properties.source", "type": "str"},
+ "first_ingested_time_utc": {"key": "properties.firstIngestedTimeUtc", "type": "iso-8601"},
+ "last_ingested_time_utc": {"key": "properties.lastIngestedTimeUtc", "type": "iso-8601"},
+ "ingestion_rules_version": {"key": "properties.ingestionRulesVersion", "type": "str"},
+ "last_update_method": {"key": "properties.lastUpdateMethod", "type": "str"},
+ "last_modified_by": {"key": "properties.lastModifiedBy", "type": "UserInfo"},
+ "last_updated_date_time_utc": {"key": "properties.lastUpdatedDateTimeUtc", "type": "iso-8601"},
+ "relationship_hints": {"key": "properties.relationshipHints", "type": "[RelationshipHint]"},
+ }
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.kind: str = 'AttackPattern'
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.
+ 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
@@ -3137,18 +3579,18 @@ class AutomationRule(ResourceWithEtag): # pylint: disable=too-many-instance-att
"""
_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},
+ '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 = {
@@ -3175,8 +3617,8 @@ def __init__(
triggering_logic: "_models.AutomationRuleTriggeringLogic",
actions: List["_models.AutomationRuleAction"],
etag: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -3199,7 +3641,6 @@ def __init__(
self.last_modified_by = None
self.created_by = None
-
class AutomationRuleAction(_serialization.Model):
"""Describes an automation rule action.
@@ -3207,7 +3648,7 @@ class AutomationRuleAction(_serialization.Model):
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 order: Required.
:vartype order: int
@@ -3217,8 +3658,8 @@ class AutomationRuleAction(_serialization.Model):
"""
_validation = {
- "order": {"required": True},
- "action_type": {"required": True},
+ 'order': {'required': True},
+ 'action_type': {'required': True},
}
_attribute_map = {
@@ -3227,27 +3668,27 @@ class AutomationRuleAction(_serialization.Model):
}
_subtype_map = {
- "action_type": {
- "AddIncidentTask": "AutomationRuleAddIncidentTaskAction",
- "ModifyProperties": "AutomationRuleModifyPropertiesAction",
- "RunPlaybook": "AutomationRuleRunPlaybookAction",
- }
+ 'action_type': {'AddIncidentTask': 'AutomationRuleAddIncidentTaskAction', 'ModifyProperties': 'AutomationRuleModifyPropertiesAction', 'RunPlaybook': 'AutomationRuleRunPlaybookAction'}
}
- def __init__(self, *, order: int, **kwargs):
+ def __init__(
+ self,
+ *,
+ order: int,
+ **kwargs: Any
+ ) -> None:
"""
:keyword order: Required.
:paramtype order: int
"""
super().__init__(**kwargs)
self.order = order
- self.action_type: Optional[str] = None
-
+ self.action_type: Optional[str] = None
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 order: Required.
:vartype order: int
@@ -3260,8 +3701,8 @@ class AutomationRuleAddIncidentTaskAction(AutomationRuleAction):
"""
_validation = {
- "order": {"required": True},
- "action_type": {"required": True},
+ 'order': {'required': True},
+ 'action_type': {'required': True},
}
_attribute_map = {
@@ -3271,8 +3712,12 @@ class AutomationRuleAddIncidentTaskAction(AutomationRuleAction):
}
def __init__(
- self, *, order: int, action_configuration: Optional["_models.AddIncidentTaskActionProperties"] = None, **kwargs
- ):
+ self,
+ *,
+ order: int,
+ action_configuration: Optional["_models.AddIncidentTaskActionProperties"] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword order: Required.
:paramtype order: int
@@ -3281,14 +3726,13 @@ def __init__(
~azure.mgmt.securityinsight.models.AddIncidentTaskActionProperties
"""
super().__init__(order=order, **kwargs)
- self.action_type: str = "AddIncidentTask"
+ self.action_type: str = 'AddIncidentTask'
self.action_configuration = action_configuration
-
class AutomationRuleBooleanCondition(_serialization.Model):
"""AutomationRuleBooleanCondition.
- :ivar operator: Known values are: "And" and "Or".
+ :ivar operator: Known values are: "And", "Or", "And", and "Or".
:vartype operator: str or
~azure.mgmt.securityinsight.models.AutomationRuleBooleanConditionSupportedOperator
:ivar inner_conditions:
@@ -3296,7 +3740,7 @@ class AutomationRuleBooleanCondition(_serialization.Model):
"""
_validation = {
- "inner_conditions": {"max_items": 10, "min_items": 2},
+ 'inner_conditions': {'max_items': 10, 'min_items': 2},
}
_attribute_map = {
@@ -3309,10 +3753,10 @@ def __init__(
*,
operator: Optional[Union[str, "_models.AutomationRuleBooleanConditionSupportedOperator"]] = None,
inner_conditions: Optional[List["_models.AutomationRuleCondition"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
- :keyword operator: Known values are: "And" and "Or".
+ :keyword operator: Known values are: "And", "Or", "And", and "Or".
:paramtype operator: str or
~azure.mgmt.securityinsight.models.AutomationRuleBooleanConditionSupportedOperator
:keyword inner_conditions:
@@ -3322,7 +3766,6 @@ def __init__(
self.operator = operator
self.inner_conditions = inner_conditions
-
class AutomationRuleCondition(_serialization.Model):
"""Describes an automation rule condition.
@@ -3330,7 +3773,7 @@ class AutomationRuleCondition(_serialization.Model):
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 condition_type: Required. Known values are: "Property", "PropertyArray",
"PropertyChanged", "PropertyArrayChanged", and "Boolean".
@@ -3338,7 +3781,7 @@ class AutomationRuleCondition(_serialization.Model):
"""
_validation = {
- "condition_type": {"required": True},
+ 'condition_type': {'required': True},
}
_attribute_map = {
@@ -3346,25 +3789,22 @@ class AutomationRuleCondition(_serialization.Model):
}
_subtype_map = {
- "condition_type": {
- "Boolean": "BooleanConditionProperties",
- "Property": "PropertyConditionProperties",
- "PropertyArray": "PropertyArrayConditionProperties",
- "PropertyArrayChanged": "PropertyArrayChangedConditionProperties",
- "PropertyChanged": "PropertyChangedConditionProperties",
- }
+ 'condition_type': {'Boolean': 'BooleanConditionProperties', 'Property': 'PropertyConditionProperties', 'PropertyArray': 'PropertyArrayConditionProperties', 'PropertyArrayChanged': 'PropertyArrayChangedConditionProperties', 'PropertyChanged': 'PropertyChangedConditionProperties'}
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
super().__init__(**kwargs)
- self.condition_type: Optional[str] = None
-
+ 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.
+ All required parameters must be populated in order to send to server.
:ivar order: Required.
:vartype order: int
@@ -3376,8 +3816,8 @@ class AutomationRuleModifyPropertiesAction(AutomationRuleAction):
"""
_validation = {
- "order": {"required": True},
- "action_type": {"required": True},
+ 'order': {'required': True},
+ 'action_type': {'required': True},
}
_attribute_map = {
@@ -3387,8 +3827,12 @@ class AutomationRuleModifyPropertiesAction(AutomationRuleAction):
}
def __init__(
- self, *, order: int, action_configuration: Optional["_models.IncidentPropertiesAction"] = None, **kwargs
- ):
+ self,
+ *,
+ order: int,
+ action_configuration: Optional["_models.IncidentPropertiesAction"] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword order: Required.
:paramtype order: int
@@ -3396,11 +3840,10 @@ def __init__(
:paramtype action_configuration: ~azure.mgmt.securityinsight.models.IncidentPropertiesAction
"""
super().__init__(order=order, **kwargs)
- self.action_type: str = "ModifyProperties"
+ self.action_type: str = 'ModifyProperties'
self.action_configuration = action_configuration
-
-class AutomationRulePropertyArrayChangedValuesCondition(_serialization.Model):
+class AutomationRulePropertyArrayChangedValuesCondition(_serialization.Model): # pylint: disable=name-too-long
"""AutomationRulePropertyArrayChangedValuesCondition.
:ivar array_type: Known values are: "Alerts", "Labels", "Tactics", and "Comments".
@@ -3419,14 +3862,10 @@ class AutomationRulePropertyArrayChangedValuesCondition(_serialization.Model):
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
@@ -3439,14 +3878,14 @@ def __init__(
self.array_type = array_type
self.change_type = change_type
-
-class AutomationRulePropertyArrayValuesCondition(_serialization.Model):
+class AutomationRulePropertyArrayValuesCondition(_serialization.Model): # pylint: disable=name-too-long
"""AutomationRulePropertyArrayValuesCondition.
- :ivar array_type: Known values are: "CustomDetails" and "CustomDetailValues".
+ :ivar array_type: Known values are: "CustomDetails", "CustomDetailValues", and
+ "IncidentLabels".
:vartype array_type: str or
~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayConditionSupportedArrayType
- :ivar array_condition_type: "AnyItem"
+ :ivar array_condition_type: Known values are: "AnyItem" and "AllItems".
:vartype array_condition_type: str or
~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayConditionSupportedArrayConditionType
:ivar item_conditions:
@@ -3454,7 +3893,7 @@ class AutomationRulePropertyArrayValuesCondition(_serialization.Model):
"""
_validation = {
- "item_conditions": {"max_items": 10, "min_items": 0},
+ 'item_conditions': {'max_items': 10, 'min_items': 0},
}
_attribute_map = {
@@ -3467,17 +3906,16 @@ def __init__(
self,
*,
array_type: Optional[Union[str, "_models.AutomationRulePropertyArrayConditionSupportedArrayType"]] = None,
- array_condition_type: Optional[
- Union[str, "_models.AutomationRulePropertyArrayConditionSupportedArrayConditionType"]
- ] = None,
+ array_condition_type: Optional[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: Known values are: "CustomDetails", "CustomDetailValues", and
+ "IncidentLabels".
:paramtype array_type: str or
~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayConditionSupportedArrayType
- :keyword array_condition_type: "AnyItem"
+ :keyword array_condition_type: Known values are: "AnyItem" and "AllItems".
:paramtype array_condition_type: str or
~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayConditionSupportedArrayConditionType
:keyword item_conditions:
@@ -3488,8 +3926,7 @@ def __init__(
self.array_condition_type = array_condition_type
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
@@ -3517,14 +3954,12 @@ class AutomationRulePropertyValuesChangedCondition(_serialization.Model):
def __init__(
self,
*,
- property_name: Optional[
- Union[str, "_models.AutomationRulePropertyChangedConditionSupportedPropertyType"]
- ] = None,
+ property_name: Optional[Union[str, "_models.AutomationRulePropertyChangedConditionSupportedPropertyType"]] = None,
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".
@@ -3546,7 +3981,6 @@ def __init__(
self.operator = operator
self.property_values = property_values
-
class AutomationRulePropertyValuesCondition(_serialization.Model):
"""AutomationRulePropertyValuesCondition.
@@ -3588,8 +4022,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",
@@ -3621,11 +4055,10 @@ def __init__(
self.operator = operator
self.property_values = property_values
-
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
@@ -3637,8 +4070,8 @@ class AutomationRuleRunPlaybookAction(AutomationRuleAction):
"""
_validation = {
- "order": {"required": True},
- "action_type": {"required": True},
+ 'order': {'required': True},
+ 'action_type': {'required': True},
}
_attribute_map = {
@@ -3648,8 +4081,12 @@ 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
@@ -3657,10 +4094,9 @@ def __init__(
:paramtype action_configuration: ~azure.mgmt.securityinsight.models.PlaybookActionProperties
"""
super().__init__(order=order, **kwargs)
- self.action_type: str = "RunPlaybook"
+ self.action_type: str = 'RunPlaybook'
self.action_configuration = action_configuration
-
class AutomationRulesList(_serialization.Model):
"""AutomationRulesList.
@@ -3676,8 +4112,12 @@ 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]
@@ -3688,11 +4128,10 @@ def __init__(
self.value = value
self.next_link = next_link
-
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
@@ -3709,10 +4148,10 @@ class AutomationRuleTriggeringLogic(_serialization.Model):
"""
_validation = {
- "is_enabled": {"required": True},
- "triggers_on": {"required": True},
- "triggers_when": {"required": True},
- "conditions": {"max_items": 50, "min_items": 0},
+ 'is_enabled': {'required': True},
+ 'triggers_on': {'required': True},
+ 'triggers_when': {'required': True},
+ 'conditions': {'max_items': 50, 'min_items': 0},
}
_attribute_map = {
@@ -3731,8 +4170,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
@@ -3754,7 +4193,6 @@ def __init__(
self.triggers_when = triggers_when
self.conditions = conditions
-
class Availability(_serialization.Model):
"""Connector Availability Status.
@@ -3769,7 +4207,13 @@ class Availability(_serialization.Model):
"is_preview": {"key": "isPreview", "type": "bool"},
}
- def __init__(self, *, status: Optional[Literal[1]] = None, is_preview: Optional[bool] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ status: Optional[Literal[1]] = None,
+ is_preview: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword status: The connector Availability Status. Default value is 1.
:paramtype status: int
@@ -3780,45 +4224,92 @@ def __init__(self, *, status: Optional[Literal[1]] = None, is_preview: Optional[
self.status = status
self.is_preview = is_preview
+class AWSAuthModel(CcpAuthConfig):
+ """Model for API authentication with AWS.
+
+ 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 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 = {
+ 'type': {'required': True},
+ 'role_arn': {'required': True},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "role_arn": {"key": "roleArn", "type": "str"},
+ "external_id": {"key": "externalId", "type": "str"},
+ }
+
+ 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.type: str = 'AWS'
+ self.role_arn = role_arn
+ self.external_id = external_id
class AwsCloudTrailCheckRequirements(DataConnectorsCheckRequirements):
"""Amazon Web Services CloudTrail requirements check 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".
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
"""
_validation = {
- "kind": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
"kind": {"key": "kind", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
super().__init__(**kwargs)
- self.kind: str = "AmazonWebServicesCloudTrail"
-
+ self.kind: str = 'AmazonWebServicesCloudTrail'
class AwsCloudTrailDataConnector(DataConnector):
"""Represents Amazon Web Services CloudTrail 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
@@ -3833,10 +4324,10 @@ class AwsCloudTrailDataConnector(DataConnector):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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.
@@ -3846,11 +4337,11 @@ class AwsCloudTrailDataConnector(DataConnector):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -3870,8 +4361,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
@@ -3882,29 +4373,33 @@ def __init__(
:paramtype data_types: ~azure.mgmt.securityinsight.models.AwsCloudTrailDataConnectorDataTypes
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "AmazonWebServicesCloudTrail"
+ self.kind: str = 'AmazonWebServicesCloudTrail'
self.aws_role_arn = aws_role_arn
self.data_types = data_types
-
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.
+ All required parameters must be populated in order to send to server.
:ivar logs: Logs data type. Required.
:vartype logs: ~azure.mgmt.securityinsight.models.AwsCloudTrailDataConnectorDataTypesLogs
"""
_validation = {
- "logs": {"required": True},
+ 'logs': {'required': True},
}
_attribute_map = {
"logs": {"key": "logs", "type": "AwsCloudTrailDataConnectorDataTypesLogs"},
}
- def __init__(self, *, logs: "_models.AwsCloudTrailDataConnectorDataTypesLogs", **kwargs):
+ def __init__(
+ self,
+ *,
+ logs: "_models.AwsCloudTrailDataConnectorDataTypesLogs",
+ **kwargs: Any
+ ) -> None:
"""
:keyword logs: Logs data type. Required.
:paramtype logs: ~azure.mgmt.securityinsight.models.AwsCloudTrailDataConnectorDataTypesLogs
@@ -3912,11 +4407,10 @@ def __init__(self, *, logs: "_models.AwsCloudTrailDataConnectorDataTypesLogs", *
super().__init__(**kwargs)
self.logs = logs
-
class DataConnectorDataTypeCommon(_serialization.Model):
"""Common field for data type in data connectors.
- 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".
@@ -3924,14 +4418,19 @@ class DataConnectorDataTypeCommon(_serialization.Model):
"""
_validation = {
- "state": {"required": True},
+ 'state': {'required': True},
}
_attribute_map = {
"state": {"key": "state", "type": "str"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
+ def __init__(
+ self,
+ *,
+ state: Union[str, "_models.DataTypeState"],
+ **kwargs: Any
+ ) -> None:
"""
:keyword state: Describe whether this data type connection is enabled or not. Required. Known
values are: "Enabled" and "Disabled".
@@ -3940,72 +4439,57 @@ def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
super().__init__(**kwargs)
self.state = state
-
class AwsCloudTrailDataConnectorDataTypesLogs(DataConnectorDataTypeCommon):
"""Logs data type.
- 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
"""
- _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.
+ 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".
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
"""
_validation = {
- "kind": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
"kind": {"key": "kind", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
super().__init__(**kwargs)
- self.kind: str = "AmazonWebServicesS3"
-
+ self.kind: str = 'AmazonWebServicesS3'
class AwsS3DataConnector(DataConnector):
"""Represents Amazon Web Services S3 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
@@ -4020,10 +4504,10 @@ class AwsS3DataConnector(DataConnector):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar destination_table: The logs destination table name in LogAnalytics.
:vartype destination_table: str
@@ -4036,11 +4520,11 @@ class AwsS3DataConnector(DataConnector):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -4064,8 +4548,8 @@ def __init__(
sqs_urls: Optional[List[str]] = None,
role_arn: Optional[str] = None,
data_types: Optional["_models.AwsS3DataConnectorDataTypes"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -4079,31 +4563,35 @@ def __init__(
:paramtype data_types: ~azure.mgmt.securityinsight.models.AwsS3DataConnectorDataTypes
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "AmazonWebServicesS3"
+ self.kind: str = 'AmazonWebServicesS3'
self.destination_table = destination_table
self.sqs_urls = sqs_urls
self.role_arn = role_arn
self.data_types = data_types
-
class AwsS3DataConnectorDataTypes(_serialization.Model):
"""The available data types for Amazon Web Services S3 data connector.
- 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.AwsS3DataConnectorDataTypesLogs
"""
_validation = {
- "logs": {"required": True},
+ 'logs': {'required': True},
}
_attribute_map = {
"logs": {"key": "logs", "type": "AwsS3DataConnectorDataTypesLogs"},
}
- def __init__(self, *, logs: "_models.AwsS3DataConnectorDataTypesLogs", **kwargs):
+ def __init__(
+ self,
+ *,
+ logs: "_models.AwsS3DataConnectorDataTypesLogs",
+ **kwargs: Any
+ ) -> None:
"""
:keyword logs: Logs data type. Required.
:paramtype logs: ~azure.mgmt.securityinsight.models.AwsS3DataConnectorDataTypesLogs
@@ -4111,34 +4599,16 @@ def __init__(self, *, logs: "_models.AwsS3DataConnectorDataTypesLogs", **kwargs)
super().__init__(**kwargs)
self.logs = logs
-
class AwsS3DataConnectorDataTypesLogs(DataConnectorDataTypeCommon):
"""Logs data type.
- 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
"""
- _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.
@@ -4153,7 +4623,13 @@ class AzureDevOpsResourceInfo(_serialization.Model):
"service_connection_id": {"key": "serviceConnectionId", "type": "str"},
}
- def __init__(self, *, pipeline_id: Optional[str] = None, service_connection_id: Optional[str] = None, **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
@@ -4164,16 +4640,60 @@ def __init__(self, *, pipeline_id: Optional[str] = None, service_connection_id:
self.pipeline_id = pipeline_id
self.service_connection_id = service_connection_id
+class AzureEntityResource(Resource):
+ """The resource model definition for an Azure Resource Manager resource with an etag.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :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: Resource Etag.
+ :vartype etag: str
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'etag': {'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"},
+ }
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.etag = None
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
@@ -4187,7 +4707,7 @@ class AzureResourceEntity(Entity):
"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
+ :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]
@@ -4201,15 +4721,15 @@ class AzureResourceEntity(Entity):
"""
_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},
+ '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 = {
@@ -4224,16 +4744,19 @@ class AzureResourceEntity(Entity):
"subscription_id": {"key": "properties.subscriptionId", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
super().__init__(**kwargs)
- self.kind: str = "AzureResource"
+ 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.
@@ -4252,10 +4775,10 @@ class AzureResourceEntityProperties(EntityCommonProperties):
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "resource_id": {"readonly": True},
- "subscription_id": {"readonly": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'resource_id': {'readonly': True},
+ 'subscription_id': {'readonly': True},
}
_attribute_map = {
@@ -4265,20 +4788,162 @@ class AzureResourceEntityProperties(EntityCommonProperties):
"subscription_id": {"key": "subscriptionId", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
super().__init__(**kwargs)
self.resource_id = None
self.subscription_id = None
+class BasicAuthModel(CcpAuthConfig):
+ """Model for API authentication with basic flow - user name + password.
+
+ 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. Required.
+ :vartype user_name: str
+ :ivar password: The password. Required.
+ :vartype password: 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"},
+ }
+
+ 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.type: str = 'Basic'
+ self.user_name = user_name
+ self.password = password
+
+class BillingStatistic(AzureEntityResource):
+ """Billing statistic.
+
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ SapSolutionUsageStatistic
+
+ 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: Resource Etag.
+ :vartype etag: str
+ :ivar kind: The kind of the billing statistic. Required. "SapSolutionUsage"
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.BillingStatisticKind
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'etag': {'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': {'SapSolutionUsage': 'SapSolutionUsageStatistic'}
+ }
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.kind: Optional[str] = None
+
+class BillingStatisticList(_serialization.Model):
+ """List of all Microsoft Sentinel billing statistics.
+
+ 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 billing statistics.
+ :vartype next_link: str
+ :ivar value: Array of billing statistics. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.BillingStatistic]
+ """
+
+ _validation = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[BillingStatistic]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: List["_models.BillingStatistic"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Array of billing statistics. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.BillingStatistic]
+ """
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
class Bookmark(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
"""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
@@ -4325,10 +4990,10 @@ class Bookmark(ResourceWithEtag): # pylint: disable=too-many-instance-attribute
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
@@ -4375,8 +5040,8 @@ def __init__(
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
@@ -4431,7 +5096,6 @@ def __init__(
self.tactics = tactics
self.techniques = techniques
-
class BookmarkEntityMappings(_serialization.Model):
"""Describes the entity mappings of a single entity.
@@ -4451,8 +5115,8 @@ def __init__(
*,
entity_type: Optional[str] = None,
field_mappings: Optional[List["_models.EntityFieldMapping"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword entity_type: The entity type.
:paramtype entity_type: str
@@ -4463,7 +5127,6 @@ def __init__(
self.entity_type = entity_type
self.field_mappings = field_mappings
-
class BookmarkExpandParameters(_serialization.Model):
"""The parameters required to execute an expand operation on the given bookmark.
@@ -4489,8 +5152,8 @@ def __init__(
end_time: Optional[datetime.datetime] = None,
expansion_id: Optional[str] = None,
start_time: Optional[datetime.datetime] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword end_time: The end date filter, so the only expansion results returned are before this
date.
@@ -4506,7 +5169,6 @@ def __init__(
self.expansion_id = expansion_id
self.start_time = start_time
-
class BookmarkExpandResponse(_serialization.Model):
"""The entity expansion result operation response.
@@ -4526,8 +5188,8 @@ def __init__(
*,
meta_data: Optional["_models.ExpansionResultsMetadata"] = None,
value: Optional["_models.BookmarkExpandResponseValue"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword meta_data: The metadata from the expansion operation results.
:paramtype meta_data: ~azure.mgmt.securityinsight.models.ExpansionResultsMetadata
@@ -4538,7 +5200,6 @@ def __init__(
self.meta_data = meta_data
self.value = value
-
class BookmarkExpandResponseValue(_serialization.Model):
"""The expansion result values.
@@ -4558,8 +5219,8 @@ def __init__(
*,
entities: Optional[List["_models.Entity"]] = None,
edges: Optional[List["_models.ConnectedEntity"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword entities: Array of the expansion result entities.
:paramtype entities: list[~azure.mgmt.securityinsight.models.Entity]
@@ -4570,13 +5231,12 @@ def __init__(
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.
+ All required parameters must be populated in order to send to server.
:ivar next_link: URL to fetch the next set of bookmarks.
:vartype next_link: str
@@ -4585,8 +5245,8 @@ class BookmarkList(_serialization.Model):
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
@@ -4594,7 +5254,12 @@ class BookmarkList(_serialization.Model):
"value": {"key": "value", "type": "[Bookmark]"},
}
- def __init__(self, *, value: List["_models.Bookmark"], **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.Bookmark"],
+ **kwargs: Any
+ ) -> None:
"""
:keyword value: Array of bookmarks. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.Bookmark]
@@ -4603,11 +5268,10 @@ def __init__(self, *, value: List["_models.Bookmark"], **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.
+ 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".
@@ -4631,8 +5295,8 @@ class BookmarkTimelineItem(EntityTimelineItem):
"""
_validation = {
- "kind": {"required": True},
- "azure_resource_id": {"required": True},
+ 'kind': {'required': True},
+ 'azure_resource_id': {'required': True},
}
_attribute_map = {
@@ -4658,8 +5322,8 @@ def __init__(
event_time: Optional[datetime.datetime] = None,
created_by: Optional["_models.UserInfo"] = None,
labels: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword azure_resource_id: The bookmark azure resource id. Required.
:paramtype azure_resource_id: str
@@ -4679,7 +5343,7 @@ def __init__(
:paramtype labels: list[str]
"""
super().__init__(**kwargs)
- self.kind: str = "Bookmark"
+ self.kind: str = 'Bookmark'
self.azure_resource_id = azure_resource_id
self.display_name = display_name
self.notes = notes
@@ -4689,11 +5353,11 @@ def __init__(
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.
+ """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.
+ 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".
@@ -4704,7 +5368,7 @@ class BooleanConditionProperties(AutomationRuleCondition):
"""
_validation = {
- "condition_type": {"required": True},
+ 'condition_type': {'required': True},
}
_attribute_map = {
@@ -4712,72 +5376,30 @@ class BooleanConditionProperties(AutomationRuleCondition):
"condition_properties": {"key": "conditionProperties", "type": "AutomationRuleBooleanCondition"},
}
- def __init__(self, *, condition_properties: Optional["_models.AutomationRuleBooleanCondition"] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ condition_properties: Optional["_models.AutomationRuleBooleanCondition"] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword condition_properties:
:paramtype condition_properties:
~azure.mgmt.securityinsight.models.AutomationRuleBooleanCondition
"""
super().__init__(**kwargs)
- self.condition_type: str = "Boolean"
+ 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
- ):
- """
- :keyword email: The email of the client.
- :paramtype email: str
- :keyword name: The name of the client.
- :paramtype name: str
- :keyword object_id: The object id of the client.
- :paramtype object_id: str
- :keyword user_principal_name: The user principal name of the client.
- :paramtype user_principal_name: str
- """
- super().__init__(**kwargs)
- self.email = email
- self.name = name
- self.object_id = object_id
- self.user_principal_name = user_principal_name
-
-
-class CloudApplicationEntity(Entity):
- """Represents a cloud application entity.
+class BusinessApplicationAgentResource(ResourceWithEtag):
+ """Describes the configuration of a Business Application Agent.
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
@@ -4787,37 +5409,27 @@ class CloudApplicationEntity(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 app_id: The technical identifier of the application.
- :vartype app_id: int
- :ivar app_name: The name of the related cloud application.
- :vartype app_name: str
- :ivar instance_name: The user defined instance name of the cloud application. It is often used
- to distinguish between several applications of the same type that a customer has.
- :vartype instance_name: str
+ :ivar etag: Etag of the azure resource.
+ :vartype etag: str
+ :ivar configuration: Describes the configuration of a Business Application Agent. Required.
+ :vartype configuration: ~azure.mgmt.securityinsight.models.AgentConfiguration
+ :ivar agent_systems:
+ :vartype agent_systems: list[~azure.mgmt.securityinsight.models.AgentSystem]
+ :ivar display_name: Required.
+ :vartype display_name: str
+ :ivar last_modified_time_utc:
+ :vartype last_modified_time_utc: ~datetime.datetime
"""
_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},
- "app_id": {"readonly": True},
- "app_name": {"readonly": True},
- "instance_name": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'configuration': {'required': True},
+ 'agent_systems': {'readonly': True},
+ 'display_name': {'required': True, 'min_length': 1},
+ 'last_modified_time_utc': {'readonly': True},
}
_attribute_map = {
@@ -4825,7 +5437,281 @@ class CloudApplicationEntity(Entity):
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
- "kind": {"key": "kind", "type": "str"},
+ "etag": {"key": "etag", "type": "str"},
+ "configuration": {"key": "properties.configuration", "type": "AgentConfiguration"},
+ "agent_systems": {"key": "properties.agentSystems", "type": "[AgentSystem]"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
+ }
+
+ def __init__(
+ self,
+ *,
+ configuration: "_models.AgentConfiguration",
+ display_name: str,
+ etag: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword configuration: Describes the configuration of a Business Application Agent. Required.
+ :paramtype configuration: ~azure.mgmt.securityinsight.models.AgentConfiguration
+ :keyword display_name: Required.
+ :paramtype display_name: str
+ """
+ super().__init__(etag=etag, **kwargs)
+ self.configuration = configuration
+ self.agent_systems = None
+ self.display_name = display_name
+ self.last_modified_time_utc = None
+
+class BusinessApplicationAgentsList(_serialization.Model):
+ """List of agents.
+
+ :ivar value:
+ :vartype value: list[~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource]
+ :ivar next_link:
+ :vartype next_link: str
+ """
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[BusinessApplicationAgentResource]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: Optional[List["_models.BusinessApplicationAgentResource"]] = None,
+ next_link: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value:
+ :paramtype value: list[~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource]
+ :keyword next_link:
+ :paramtype next_link: str
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
+
+class CcpResponseConfig(_serialization.Model): # pylint: disable=too-many-instance-attributes
+ """A custom response configuration for a rule.
+
+ All required parameters must be populated in order to send to server.
+
+ :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 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.
+ :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 a 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: Th 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 = {
+ "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,
+ *,
+ 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: Optional[str] = None,
+ 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 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.
+ :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 a 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: Th character used to escape characters in CSV.
+ :paramtype csv_escape: str
+ """
+ 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
+ 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 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: Any
+ ) -> None:
+ """
+ :keyword email: The email of the client.
+ :paramtype email: str
+ :keyword name: The name of the client.
+ :paramtype name: str
+ :keyword object_id: The object id of the client.
+ :paramtype object_id: str
+ :keyword user_principal_name: The user principal name of the client.
+ :paramtype user_principal_name: str
+ """
+ super().__init__(**kwargs)
+ self.email = email
+ self.name = name
+ self.object_id = object_id
+ self.user_principal_name = user_principal_name
+
+class CloudApplicationEntity(Entity):
+ """Represents a cloud application 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 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.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 app_id: The technical identifier of the application.
+ :vartype app_id: int
+ :ivar app_name: The name of the related cloud application.
+ :vartype app_name: str
+ :ivar instance_name: The user defined instance name of the cloud application. It is often used
+ to distinguish between several applications of the same type that a customer has.
+ :vartype instance_name: 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},
+ 'app_id': {'readonly': True},
+ 'app_name': {'readonly': True},
+ 'instance_name': {'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"},
"app_id": {"key": "properties.appId", "type": "int"},
@@ -4833,17 +5719,20 @@ 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"
+ self.kind: str = 'CloudApplication'
self.additional_data = None
self.friendly_name = None
self.app_id = None
self.app_name = None
self.instance_name = None
-
class CloudApplicationEntityProperties(EntityCommonProperties):
"""CloudApplication entity property bag.
@@ -4865,11 +5754,11 @@ class CloudApplicationEntityProperties(EntityCommonProperties):
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "app_id": {"readonly": True},
- "app_name": {"readonly": True},
- "instance_name": {"readonly": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'app_id': {'readonly': True},
+ 'app_name': {'readonly': True},
+ 'instance_name': {'readonly': True},
}
_attribute_map = {
@@ -4880,14 +5769,17 @@ 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
self.app_name = None
self.instance_name = None
-
class CloudErrorBody(_serialization.Model):
"""Error details.
@@ -4902,8 +5794,8 @@ class CloudErrorBody(_serialization.Model):
"""
_validation = {
- "code": {"readonly": True},
- "message": {"readonly": True},
+ 'code': {'readonly': True},
+ 'message': {'readonly': True},
}
_attribute_map = {
@@ -4911,22 +5803,25 @@ 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.
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
@@ -4941,10 +5836,10 @@ class CodelessApiPollingDataConnector(DataConnector):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar connector_ui_config: Config to describe the instructions blade.
:vartype connector_ui_config:
@@ -4955,11 +5850,11 @@ class CodelessApiPollingDataConnector(DataConnector):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -4979,8 +5874,8 @@ def __init__(
etag: Optional[str] = None,
connector_ui_config: Optional["_models.CodelessUiConnectorConfigProperties"] = None,
polling_config: Optional["_models.CodelessConnectorPollingConfigProperties"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -4992,15 +5887,14 @@ def __init__(
~azure.mgmt.securityinsight.models.CodelessConnectorPollingConfigProperties
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "APIPolling"
+ self.kind: str = 'APIPolling'
self.connector_ui_config = connector_ui_config
self.polling_config = polling_config
-
class CodelessConnectorPollingAuthProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
"""Describe the authentication properties needed to successfully authenticate with the server.
- 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
@@ -5035,7 +5929,7 @@ class CodelessConnectorPollingAuthProperties(_serialization.Model): # pylint: d
"""
_validation = {
- "auth_type": {"required": True},
+ 'auth_type': {'required': True},
}
_attribute_map = {
@@ -5070,8 +5964,8 @@ def __init__(
token_endpoint_query_parameters: Optional[JSON] = None,
is_client_secret_in_header: Optional[bool] = None,
scope: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword auth_type: The authentication type. Required.
:paramtype auth_type: str
@@ -5121,11 +6015,10 @@ def __init__(
self.is_client_secret_in_header = is_client_secret_in_header
self.scope = scope
-
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.
+ All required parameters must be populated in order to send to server.
:ivar is_active: The poller active status.
:vartype is_active: bool
@@ -5141,8 +6034,8 @@ class CodelessConnectorPollingConfigProperties(_serialization.Model):
"""
_validation = {
- "auth": {"required": True},
- "request": {"required": True},
+ 'auth': {'required': True},
+ 'request': {'required': True},
}
_attribute_map = {
@@ -5161,8 +6054,8 @@ def __init__(
is_active: Optional[bool] = None,
paging: Optional["_models.CodelessConnectorPollingPagingProperties"] = None,
response: Optional["_models.CodelessConnectorPollingResponseProperties"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword is_active: The poller active status.
:paramtype is_active: bool
@@ -5184,11 +6077,10 @@ def __init__(
self.paging = paging
self.response = response
-
class CodelessConnectorPollingPagingProperties(_serialization.Model):
"""Describe the properties needed to make a pagination call.
- 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'.
Required.
@@ -5213,7 +6105,7 @@ class CodelessConnectorPollingPagingProperties(_serialization.Model):
"""
_validation = {
- "paging_type": {"required": True},
+ 'paging_type': {'required': True},
}
_attribute_map = {
@@ -5223,10 +6115,7 @@ class CodelessConnectorPollingPagingProperties(_serialization.Model):
"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",
- },
+ "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"},
}
@@ -5243,8 +6132,8 @@ def __init__(
search_the_latest_time_stamp_from_events_list: Optional[str] = None,
page_size_para_name: Optional[str] = None,
page_size: Optional[int] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword paging_type: Describes the type. could be 'None', 'PageToken', 'PageCount',
'TimeStamp'. Required.
@@ -5278,11 +6167,10 @@ def __init__(
self.page_size_para_name = page_size_para_name
self.page_size = page_size
-
-class CodelessConnectorPollingRequestProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class CodelessConnectorPollingRequestProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes,name-too-long
"""Describe the request properties needed to successfully pull from the server.
- 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
@@ -5316,10 +6204,10 @@ class CodelessConnectorPollingRequestProperties(_serialization.Model): # pylint
"""
_validation = {
- "api_endpoint": {"required": True},
- "query_window_in_min": {"required": True},
- "http_method": {"required": True},
- "query_time_format": {"required": True},
+ 'api_endpoint': {'required': True},
+ 'query_window_in_min': {'required': True},
+ 'http_method': {'required': True},
+ 'query_time_format': {'required': True},
}
_attribute_map = {
@@ -5352,8 +6240,8 @@ def __init__(
query_parameters_template: Optional[str] = None,
start_time_attribute_name: Optional[str] = None,
end_time_attribute_name: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword api_endpoint: Describe the endpoint we should pull the data from. Required.
:paramtype api_endpoint: str
@@ -5400,11 +6288,10 @@ def __init__(
self.start_time_attribute_name = start_time_attribute_name
self.end_time_attribute_name = end_time_attribute_name
-
-class CodelessConnectorPollingResponseProperties(_serialization.Model):
+class CodelessConnectorPollingResponseProperties(_serialization.Model): # pylint: disable=name-too-long
"""Describes the response from the external server.
- 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 events_json_paths: Describes the path we should extract the data in the response.
Required.
@@ -5420,7 +6307,7 @@ class CodelessConnectorPollingResponseProperties(_serialization.Model):
"""
_validation = {
- "events_json_paths": {"required": True},
+ 'events_json_paths': {'required': True},
}
_attribute_map = {
@@ -5437,8 +6324,8 @@ def __init__(
success_status_json_path: Optional[str] = None,
success_status_value: Optional[str] = None,
is_gzip_compressed: Optional[bool] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword events_json_paths: Describes the path we should extract the data in the response.
Required.
@@ -5458,11 +6345,10 @@ def __init__(
self.success_status_value = success_status_value
self.is_gzip_compressed = is_gzip_compressed
-
class CodelessUiConnectorConfigProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
"""Config to describe the instructions blade.
- 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.
:vartype title: str
@@ -5498,17 +6384,17 @@ class CodelessUiConnectorConfigProperties(_serialization.Model): # pylint: disa
"""
_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},
+ '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 = {
@@ -5520,16 +6406,10 @@ class CodelessUiConnectorConfigProperties(_serialization.Model): # pylint: disa
"graph_queries": {"key": "graphQueries", "type": "[CodelessUiConnectorConfigPropertiesGraphQueriesItem]"},
"sample_queries": {"key": "sampleQueries", "type": "[CodelessUiConnectorConfigPropertiesSampleQueriesItem]"},
"data_types": {"key": "dataTypes", "type": "[CodelessUiConnectorConfigPropertiesDataTypesItem]"},
- "connectivity_criteria": {
- "key": "connectivityCriteria",
- "type": "[CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem]",
- },
+ "connectivity_criteria": {"key": "connectivityCriteria", "type": "[CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem]"},
"availability": {"key": "availability", "type": "Availability"},
"permissions": {"key": "permissions", "type": "Permissions"},
- "instruction_steps": {
- "key": "instructionSteps",
- "type": "[CodelessUiConnectorConfigPropertiesInstructionStepsItem]",
- },
+ "instruction_steps": {"key": "instructionSteps", "type": "[CodelessUiConnectorConfigPropertiesInstructionStepsItem]"},
}
def __init__(
@@ -5547,8 +6427,8 @@ def __init__(
permissions: "_models.Permissions",
instruction_steps: List["_models.CodelessUiConnectorConfigPropertiesInstructionStepsItem"],
custom_image: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword title: Connector blade title. Required.
:paramtype title: str
@@ -5596,7 +6476,6 @@ def __init__(
self.permissions = permissions
self.instruction_steps = instruction_steps
-
class ConnectivityCriteria(_serialization.Model):
"""Setting for the connector check connectivity.
@@ -5616,8 +6495,8 @@ def __init__(
*,
type: Optional[Union[str, "_models.ConnectivityType"]] = None,
value: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword type: type of connectivity. "IsConnectedQuery"
:paramtype type: str or ~azure.mgmt.securityinsight.models.ConnectivityType
@@ -5628,8 +6507,7 @@ def __init__(
self.type = type
self.value = value
-
-class CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem(ConnectivityCriteria):
+class CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem(ConnectivityCriteria): # pylint: disable=name-too-long
"""CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.
:ivar type: type of connectivity. "IsConnectedQuery"
@@ -5638,27 +6516,6 @@ class CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem(ConnectivityCr
:vartype value: list[str]
"""
- _attribute_map = {
- "type": {"key": "type", "type": "str"},
- "value": {"key": "value", "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]
- """
- super().__init__(type=type, value=value, **kwargs)
-
-
class LastDataReceivedDataType(_serialization.Model):
"""Data type for last data received.
@@ -5674,7 +6531,13 @@ class LastDataReceivedDataType(_serialization.Model):
"last_data_received_query": {"key": "lastDataReceivedQuery", "type": "str"},
}
- def __init__(self, *, name: Optional[str] = None, last_data_received_query: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ last_data_received_query: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword name: Name of the data type to show in the graph. can be use with
{{graphQueriesTableName}} placeholder.
@@ -5686,8 +6549,7 @@ def __init__(self, *, name: Optional[str] = None, last_data_received_query: Opti
self.name = name
self.last_data_received_query = last_data_received_query
-
-class CodelessUiConnectorConfigPropertiesDataTypesItem(LastDataReceivedDataType):
+class CodelessUiConnectorConfigPropertiesDataTypesItem(LastDataReceivedDataType): # pylint: disable=name-too-long
"""CodelessUiConnectorConfigPropertiesDataTypesItem.
:ivar name: Name of the data type to show in the graph. can be use with
@@ -5697,22 +6559,6 @@ class CodelessUiConnectorConfigPropertiesDataTypesItem(LastDataReceivedDataType)
: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__(name=name, last_data_received_query=last_data_received_query, **kwargs)
-
-
class GraphQueries(_serialization.Model):
"""The graph query to show the current data status.
@@ -5736,8 +6582,8 @@ def __init__(
metric_name: Optional[str] = None,
legend: Optional[str] = None,
base_query: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword metric_name: the metric that the query is checking.
:paramtype metric_name: str
@@ -5751,8 +6597,7 @@ def __init__(
self.legend = legend
self.base_query = base_query
-
-class CodelessUiConnectorConfigPropertiesGraphQueriesItem(GraphQueries):
+class CodelessUiConnectorConfigPropertiesGraphQueriesItem(GraphQueries): # pylint: disable=name-too-long
"""CodelessUiConnectorConfigPropertiesGraphQueriesItem.
:ivar metric_name: the metric that the query is checking.
@@ -5763,31 +6608,6 @@ class CodelessUiConnectorConfigPropertiesGraphQueriesItem(GraphQueries):
:vartype base_query: str
"""
- _attribute_map = {
- "metric_name": {"key": "metricName", "type": "str"},
- "legend": {"key": "legend", "type": "str"},
- "base_query": {"key": "baseQuery", "type": "str"},
- }
-
- def __init__(
- self,
- *,
- metric_name: Optional[str] = None,
- legend: Optional[str] = None,
- base_query: Optional[str] = None,
- **kwargs
- ):
- """
- :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
- """
- super().__init__(metric_name=metric_name, legend=legend, base_query=base_query, **kwargs)
-
-
class InstructionSteps(_serialization.Model):
"""Instruction steps to enable the connector.
@@ -5812,8 +6632,8 @@ def __init__(
title: Optional[str] = None,
description: Optional[str] = None,
instructions: Optional[List["_models.InstructionStepsInstructionsItem"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword title: Instruction step title.
:paramtype title: str
@@ -5828,8 +6648,7 @@ def __init__(
self.description = description
self.instructions = instructions
-
-class CodelessUiConnectorConfigPropertiesInstructionStepsItem(InstructionSteps):
+class CodelessUiConnectorConfigPropertiesInstructionStepsItem(InstructionSteps): # pylint: disable=name-too-long
"""CodelessUiConnectorConfigPropertiesInstructionStepsItem.
:ivar title: Instruction step title.
@@ -5841,34 +6660,8 @@ class CodelessUiConnectorConfigPropertiesInstructionStepsItem(InstructionSteps):
list[~azure.mgmt.securityinsight.models.InstructionStepsInstructionsItem]
"""
- _attribute_map = {
- "title": {"key": "title", "type": "str"},
- "description": {"key": "description", "type": "str"},
- "instructions": {"key": "instructions", "type": "[InstructionStepsInstructionsItem]"},
- }
-
- 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.
+class SampleQueries(_serialization.Model):
+ """The sample queries for the connector.
:ivar description: The sample query description.
:vartype description: str
@@ -5881,7 +6674,13 @@ class SampleQueries(_serialization.Model):
"query": {"key": "query", "type": "str"},
}
- def __init__(self, *, description: Optional[str] = None, query: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ description: Optional[str] = None,
+ query: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword description: The sample query description.
:paramtype description: str
@@ -5892,8 +6691,7 @@ def __init__(self, *, description: Optional[str] = None, query: Optional[str] =
self.description = description
self.query = query
-
-class CodelessUiConnectorConfigPropertiesSampleQueriesItem(SampleQueries):
+class CodelessUiConnectorConfigPropertiesSampleQueriesItem(SampleQueries): # pylint: disable=name-too-long
"""CodelessUiConnectorConfigPropertiesSampleQueriesItem.
:ivar description: The sample query description.
@@ -5902,30 +6700,15 @@ class CodelessUiConnectorConfigPropertiesSampleQueriesItem(SampleQueries):
: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)
-
-
class CodelessUiDataConnector(DataConnector):
"""Represents Codeless UI 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
@@ -5940,10 +6723,10 @@ class CodelessUiDataConnector(DataConnector):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", and "RestApiPoller".
:vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
:ivar connector_ui_config: Config to describe the instructions blade.
:vartype connector_ui_config:
@@ -5951,11 +6734,11 @@ class CodelessUiDataConnector(DataConnector):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -5973,8 +6756,8 @@ def __init__(
*,
etag: Optional[str] = None,
connector_ui_config: Optional["_models.CodelessUiConnectorConfigProperties"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -5983,9 +6766,123 @@ def __init__(
~azure.mgmt.securityinsight.models.CodelessUiConnectorConfigProperties
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "GenericUI"
+ self.kind: str = 'GenericUI'
self.connector_ui_config = connector_ui_config
+class ConditionClause(_serialization.Model):
+ """Represents a single clause to be evaluated by a NormalizedCondition.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar clause_connective: The connective used to join all values in this ConditionClause. Known
+ values are: "And", "Or", "And", and "Or".
+ :vartype clause_connective: str or ~azure.mgmt.securityinsight.models.Connective
+ :ivar field: The name of the field that is evaluated. Required.
+ :vartype field: str
+ :ivar operator: Represents an operator in a ConditionClause. Required. Known values are:
+ "Equals", "NotEquals", "LessThan", "LessThanEqual", "GreaterThan", "GreaterThanEqual",
+ "StringContains", "StringNotContains", "StringStartsWith", "StringNotStartsWith",
+ "StringEndsWith", "StringNotEndsWith", "StringIsEmpty", "IsNull", "IsTrue", "IsFalse",
+ "ArrayContains", "ArrayNotContains", "OnOrAfterRelative", "AfterRelative",
+ "OnOrBeforeRelative", "BeforeRelative", "OnOrAfterAbsolute", "AfterAbsolute",
+ "OnOrBeforeAbsolute", and "BeforeAbsolute".
+ :vartype operator: str or ~azure.mgmt.securityinsight.models.Operator
+ :ivar values: The top level connective operator for this condition. Required.
+ :vartype values: list[str]
+ """
+
+ _validation = {
+ 'field': {'required': True},
+ 'operator': {'required': True},
+ 'values': {'required': True},
+ }
+
+ _attribute_map = {
+ "clause_connective": {"key": "clauseConnective", "type": "str"},
+ "field": {"key": "field", "type": "str"},
+ "operator": {"key": "operator", "type": "str"},
+ "values": {"key": "values", "type": "[str]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ field: str,
+ operator: Union[str, "_models.Operator"],
+ values: List[str],
+ clause_connective: Optional[Union[str, "_models.Connective"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword clause_connective: The connective used to join all values in this ConditionClause.
+ Known values are: "And", "Or", "And", and "Or".
+ :paramtype clause_connective: str or ~azure.mgmt.securityinsight.models.Connective
+ :keyword field: The name of the field that is evaluated. Required.
+ :paramtype field: str
+ :keyword operator: Represents an operator in a ConditionClause. Required. Known values are:
+ "Equals", "NotEquals", "LessThan", "LessThanEqual", "GreaterThan", "GreaterThanEqual",
+ "StringContains", "StringNotContains", "StringStartsWith", "StringNotStartsWith",
+ "StringEndsWith", "StringNotEndsWith", "StringIsEmpty", "IsNull", "IsTrue", "IsFalse",
+ "ArrayContains", "ArrayNotContains", "OnOrAfterRelative", "AfterRelative",
+ "OnOrBeforeRelative", "BeforeRelative", "OnOrAfterAbsolute", "AfterAbsolute",
+ "OnOrBeforeAbsolute", and "BeforeAbsolute".
+ :paramtype operator: str or ~azure.mgmt.securityinsight.models.Operator
+ :keyword values: The top level connective operator for this condition. Required.
+ :paramtype values: list[str]
+ """
+ super().__init__(**kwargs)
+ self.clause_connective = clause_connective
+ self.field = field
+ self.operator = operator
+ self.values = values
+
+class ConditionProperties(_serialization.Model):
+ """Represents a condition used to query for TI 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 server.
+
+ :ivar stix_object_type: The STIX type for the objects returned by this query.
+ :vartype stix_object_type: str
+ :ivar clauses: The list of clauses to be evaluated in disjunction or conjunction base on the
+ specified top level connective operator. Required.
+ :vartype clauses: list[~azure.mgmt.securityinsight.models.ConditionClause]
+ :ivar condition_connective: The top level connective operator for this condition. Known values
+ are: "And", "Or", "And", and "Or".
+ :vartype condition_connective: str or ~azure.mgmt.securityinsight.models.Connective
+ """
+
+ _validation = {
+ 'stix_object_type': {'readonly': True},
+ 'clauses': {'required': True},
+ }
+
+ _attribute_map = {
+ "stix_object_type": {"key": "stixObjectType", "type": "str"},
+ "clauses": {"key": "clauses", "type": "[ConditionClause]"},
+ "condition_connective": {"key": "conditionConnective", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ clauses: List["_models.ConditionClause"],
+ condition_connective: Optional[Union[str, "_models.Connective"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword clauses: The list of clauses to be evaluated in disjunction or conjunction base on the
+ specified top level connective operator. Required.
+ :paramtype clauses: list[~azure.mgmt.securityinsight.models.ConditionClause]
+ :keyword condition_connective: The top level connective operator for this condition. Known
+ values are: "And", "Or", "And", and "Or".
+ :paramtype condition_connective: str or ~azure.mgmt.securityinsight.models.Connective
+ """
+ super().__init__(**kwargs)
+ self.stix_object_type = None
+ self.clauses = clauses
+ self.condition_connective = condition_connective
class ConnectedEntity(_serialization.Model):
"""Expansion result connected entities.
@@ -6001,7 +6898,13 @@ class ConnectedEntity(_serialization.Model):
"additional_data": {"key": "additionalData", "type": "object"},
}
- def __init__(self, *, target_entity_id: Optional[str] = None, additional_data: Optional[JSON] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ target_entity_id: Optional[str] = None,
+ additional_data: Optional[JSON] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword target_entity_id: Entity Id of the connected entity.
:paramtype target_entity_id: str
@@ -6012,456 +6915,425 @@ def __init__(self, *, target_entity_id: Optional[str] = None, additional_data: O
self.target_entity_id = target_entity_id
self.additional_data = additional_data
+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).
-class ConnectorInstructionModelBase(_serialization.Model):
- """Instruction step details.
-
- 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 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 type: Gets or sets the type of connectivity. Required.
+ :vartype type: str
+ :ivar value: Gets or sets the queries for checking connectivity.
+ :vartype value: list[str]
"""
_validation = {
- "type": {"required": True},
+ 'type': {'required': True},
}
_attribute_map = {
- "parameters": {"key": "parameters", "type": "object"},
"type": {"key": "type", "type": "str"},
+ "value": {"key": "value", "type": "[str]"},
}
- def __init__(self, *, type: Union[str, "_models.SettingType"], parameters: Optional[JSON] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ type: str,
+ value: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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__(**kwargs)
- self.parameters = parameters
self.type = type
+ self.value = value
+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.
-class Content(_serialization.Model):
- """Content section of the recommendation.
-
- 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 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 = {
- "title": {"required": True},
- "description": {"required": True},
+ 'name': {'required': True},
+ 'last_data_received_query': {'required': True},
}
_attribute_map = {
- "title": {"key": "title", "type": "str"},
- "description": {"key": "description", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "last_data_received_query": {"key": "lastDataReceivedQuery", "type": "str"},
}
- def __init__(self, *, title: str, description: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ name: str,
+ last_data_received_query: str,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword title: Title of the content. Required.
- :paramtype title: str
- :keyword description: Description of the content. Required.
- :paramtype description: 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.title = title
- self.description = description
-
+ self.name = name
+ self.last_data_received_query = last_data_received_query
-class ContentPathMap(_serialization.Model):
- """The mapping of content type to a repo path.
+class ConnectorDefinitionsAvailability(_serialization.Model):
+ """The exposure status of the connector to the customers.
- :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 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
"""
_attribute_map = {
- "content_type": {"key": "contentType", "type": "str"},
- "path": {"key": "path", "type": "str"},
+ "status": {"key": "status", "type": "int"},
+ "is_preview": {"key": "isPreview", "type": "bool"},
}
def __init__(
- self, *, content_type: Optional[Union[str, "_models.ContentType"]] = None, path: Optional[str] = None, **kwargs
- ):
+ self,
+ *,
+ status: Optional[int] = None,
+ is_preview: Optional[bool] = 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 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.content_type = content_type
- self.path = path
-
+ self.status = status
+ self.is_preview = is_preview
-class CustomsPermission(_serialization.Model):
- """Customs permissions required for the connector.
+class ConnectorDefinitionsPermissions(_serialization.Model):
+ """The required Permissions for the connector.
- :ivar name: Customs permissions name.
- :vartype name: str
- :ivar description: Customs permissions description.
- :vartype description: str
+ :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 = {
- "name": {"key": "name", "type": "str"},
- "description": {"key": "description", "type": "str"},
+ "tenant": {"key": "tenant", "type": "[str]"},
+ "licenses": {"key": "licenses", "type": "[str]"},
+ "resource_provider": {"key": "resourceProvider", "type": "[ConnectorDefinitionsResourceProvider]"},
+ "customs": {"key": "customs", "type": "[CustomPermissionDetails]"},
}
- 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,
+ *,
+ 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.name = name
- self.description = description
+ self.tenant = tenant
+ self.licenses = licenses
+ self.resource_provider = resource_provider
+ self.customs = customs
+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.
-class Customs(CustomsPermission):
- """Customs permissions required for the connector.
+ All required parameters must be populated in order to send to server.
- :ivar name: Customs permissions name.
- :vartype name: str
- :ivar description: Customs permissions description.
- :vartype description: str
+ :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 required_permissions:
+ ~azure.mgmt.securityinsight.models.ResourceProviderRequiredPermissions
"""
+ _validation = {
+ 'provider': {'required': True},
+ 'permissions_display_text': {'required': True},
+ 'provider_display_name': {'required': True},
+ 'scope': {'required': True},
+ 'required_permissions': {'required': True},
+ }
+
_attribute_map = {
- "name": {"key": "name", "type": "str"},
- "description": {"key": "description", "type": "str"},
+ "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, *, 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,
+ *,
+ 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__(name=name, description=description, **kwargs)
+ 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
+class ConnectorInstructionModelBase(_serialization.Model):
+ """Instruction step details.
-class DataConnectorConnectBody(_serialization.Model): # pylint: disable=too-many-instance-attributes
- """Represents Codeless API Polling data connector.
+ All required parameters must be populated in order to send to server.
- :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]
+ :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 = {
- "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]"},
+ "parameters": {"key": "parameters", "type": "object"},
+ "type": {"key": "type", "type": "str"},
}
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]
- """
- 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.
-
- 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 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 = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[DataConnector]"},
- }
-
- def __init__(self, *, value: List["_models.DataConnector"], **kwargs):
+ type: Union[str, "_models.SettingType"],
+ parameters: Optional[JSON] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of data connectors. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.DataConnector]
+ :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__(**kwargs)
- self.next_link = None
- self.value = value
-
+ self.parameters = parameters
+ self.type = type
-class DataConnectorRequirementsState(_serialization.Model):
- """Data connector requirements status.
+class CountQuery(_serialization.Model):
+ """Represents a query to run on the TI objects in the workspace.
- :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 condition: Represents a condition used to query for TI objects.
+ :vartype condition: ~azure.mgmt.securityinsight.models.ConditionProperties
"""
_attribute_map = {
- "authorization_state": {"key": "authorizationState", "type": "str"},
- "license_state": {"key": "licenseState", "type": "str"},
+ "condition": {"key": "properties.condition", "type": "ConditionProperties"},
}
def __init__(
self,
*,
- authorization_state: Optional[Union[str, "_models.DataConnectorAuthorizationState"]] = None,
- license_state: Optional[Union[str, "_models.DataConnectorLicenseState"]] = None,
- **kwargs
- ):
+ condition: Optional["_models.ConditionProperties"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword condition: Represents a condition used to query for TI objects.
+ :paramtype condition: ~azure.mgmt.securityinsight.models.ConditionProperties
"""
super().__init__(**kwargs)
- self.authorization_state = authorization_state
- self.license_state = license_state
+ self.condition = condition
+class CustomizableConnectionsConfig(_serialization.Model):
+ """The UiConfig for 'Customizable' connector definition kind.
-class DataTypeDefinitions(_serialization.Model):
- """The data type definition.
+ All required parameters must be populated in order to send to server.
- :ivar data_type: The data type name.
- :vartype data_type: str
+ :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 template_spec_name: str
+ :ivar template_spec_version: Gets or sets the template version. Required.
+ :vartype template_spec_version: str
"""
- _attribute_map = {
- "data_type": {"key": "dataType", "type": "str"},
+ _validation = {
+ 'template_spec_name': {'required': True},
+ 'template_spec_version': {'required': True},
}
- def __init__(self, *, data_type: Optional[str] = None, **kwargs):
- """
- :keyword data_type: The data type name.
- :paramtype data_type: str
- """
- super().__init__(**kwargs)
- self.data_type = data_type
-
-
-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"},
+ "template_spec_name": {"key": "templateSpecName", "type": "str"},
+ "template_spec_version": {"key": "templateSpecVersion", "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
- ):
+ template_spec_name: str,
+ template_spec_version: str,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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.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
+ self.template_spec_name = template_spec_name
+ self.template_spec_version = template_spec_version
+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.
-class DeploymentInfo(_serialization.Model):
- """Information regarding a deployment.
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ CustomizableConnectorDefinition
- :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
+ 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 = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ }
+
_attribute_map = {
- "deployment_fetch_status": {"key": "deploymentFetchStatus", "type": "str"},
- "deployment": {"key": "deployment", "type": "Deployment"},
- "message": {"key": "message", "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"},
+ }
+
+ _subtype_map = {
+ 'kind': {'Customizable': 'CustomizableConnectorDefinition'}
}
def __init__(
self,
*,
- deployment_fetch_status: Optional[Union[str, "_models.DeploymentFetchStatus"]] = None,
- deployment: Optional["_models.Deployment"] = None,
- message: Optional[str] = None,
- **kwargs
- ):
+ etag: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
"""
- super().__init__(**kwargs)
- self.deployment_fetch_status = deployment_fetch_status
- self.deployment = deployment
- self.message = message
-
+ super().__init__(etag=etag, **kwargs)
+ self.kind: Optional[str] = None
-class DnsEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a dns entity.
+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 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
@@ -6471,39 +7343,27 @@ class DnsEntity(Entity): # pylint: disable=too-many-instance-attributes
: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 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 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},
- "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},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -6511,759 +7371,822 @@ class DnsEntity(Entity): # pylint: disable=too-many-instance-attributes
"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"},
- "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]"},
+ "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, **kwargs):
- """ """
- super().__init__(**kwargs)
- 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 DnsEntityProperties(EntityCommonProperties):
- """Dns 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 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 = {
- "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 = {
- "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, **kwargs):
- """ """
- 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):
+ def __init__(
+ self,
+ *,
+ 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 tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
+ :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.kind: str = "Dynamics365"
- self.tenant_id = tenant_id
-
+ 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 Dynamics365CheckRequirementsProperties(DataConnectorTenantId):
- """Dynamics365 requirements check properties.
+class CustomizableConnectorUiConfig(_serialization.Model): # pylint: disable=too-many-instance-attributes
+ """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 tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: str
+ :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: Gets or sets the connector publisher name. Required.
+ :vartype publisher: str
+ :ivar description_markdown: Gets or sets the connector description in markdown format.
+ Required.
+ :vartype description_markdown: str
+ :ivar graph_queries: Gets or sets the graph queries to show the current data volume over time.
+ Required.
+ :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 = {
- "tenant_id": {"required": True},
+ 'title': {'required': True},
+ 'publisher': {'required': True},
+ 'description_markdown': {'required': True},
+ 'graph_queries': {'required': True},
+ 'data_types': {'required': True},
+ 'connectivity_criteria': {'required': True},
+ 'permissions': {'required': True},
+ 'instruction_steps': {'required': True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "id": {"key": "id", "type": "str"},
+ "title": {"key": "title", "type": "str"},
+ "publisher": {"key": "publisher", "type": "str"},
+ "description_markdown": {"key": "descriptionMarkdown", "type": "str"},
+ "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__(self, *, tenant_id: str, **kwargs):
- """
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
+ def __init__(
+ self,
+ *,
+ title: str,
+ publisher: str,
+ description_markdown: str,
+ 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: Gets or sets the connector publisher name. Required.
+ :paramtype publisher: str
+ :keyword description_markdown: Gets or sets the connector description in markdown format.
+ 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.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__(tenant_id=tenant_id, **kwargs)
-
-
-class Dynamics365DataConnector(DataConnector):
- """Represents Dynamics365 data connector.
+ super().__init__(**kwargs)
+ self.id = id
+ self.title = title
+ self.publisher = publisher
+ self.description_markdown = description_markdown
+ self.graph_queries = graph_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
- Variables are only populated by the server, and will be ignored when sending a request.
+class CustomPermissionDetails(_serialization.Model):
+ """The Custom permissions required for the connector.
- 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 name: Gets or sets the custom permissions name. Required.
: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.Dynamics365DataConnectorDataTypes
+ :ivar description: Gets or sets the custom permissions description. Required.
+ :vartype description: str
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'name': {'required': True},
+ 'description': {'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": "Dynamics365DataConnectorDataTypes"},
+ "description": {"key": "description", "type": "str"},
}
def __init__(
self,
*,
- etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.Dynamics365DataConnectorDataTypes"] = None,
- **kwargs
- ):
+ name: str,
+ description: str,
+ **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.Dynamics365DataConnectorDataTypes
+ :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__(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.
+ super().__init__(**kwargs)
+ self.name = name
+ self.description = description
- All required parameters must be populated in order to send to Azure.
+class CustomsPermission(_serialization.Model):
+ """Customs permissions required for the connector.
- :ivar dynamics365_cds_activities: Common Data Service data type connection. Required.
- :vartype dynamics365_cds_activities:
- ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities
+ :ivar name: Customs permissions name.
+ :vartype name: str
+ :ivar description: Customs permissions description.
+ :vartype description: str
"""
- _validation = {
- "dynamics365_cds_activities": {"required": True},
- }
-
_attribute_map = {
- "dynamics365_cds_activities": {
- "key": "dynamics365CdsActivities",
- "type": "Dynamics365DataConnectorDataTypesDynamics365CdsActivities",
- },
+ "name": {"key": "name", "type": "str"},
+ "description": {"key": "description", "type": "str"},
}
def __init__(
self,
*,
- dynamics365_cds_activities: "_models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities",
- **kwargs
- ):
+ name: Optional[str] = None,
+ description: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword dynamics365_cds_activities: Common Data Service data type connection. Required.
- :paramtype dynamics365_cds_activities:
- ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities
+ :keyword name: Customs permissions name.
+ :paramtype name: str
+ :keyword description: Customs permissions description.
+ :paramtype description: str
"""
super().__init__(**kwargs)
- self.dynamics365_cds_activities = dynamics365_cds_activities
+ self.name = name
+ self.description = description
+class Customs(CustomsPermission):
+ """Customs permissions required for the connector.
-class Dynamics365DataConnectorDataTypesDynamics365CdsActivities(DataConnectorDataTypeCommon):
- """Common Data Service data type connection.
+ :ivar name: Customs permissions name.
+ :vartype name: str
+ :ivar description: Customs permissions description.
+ :vartype description: str
+ """
- All required parameters must be populated in order to send to Azure.
+class DataConnectorConnectBody(_serialization.Model): # pylint: disable=too-many-instance-attributes
+ """Represents Codeless API Polling data connector.
- :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 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]
"""
- _validation = {
- "state": {"required": True},
+ _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]"},
}
+ 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: Any
+ ) -> None:
+ """
+ :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]
+ """
+ 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 DataConnectorDefinitionArmCollectionWrapper(_serialization.Model): # pylint: disable=name-too-long
+ """Encapsulate the data connector definition object.
+
+ :ivar value:
+ :vartype value: list[~azure.mgmt.securityinsight.models.DataConnectorDefinition]
+ :ivar next_link:
+ :vartype next_link: str
+ """
+
_attribute_map = {
- "state": {"key": "state", "type": "str"},
+ "value": {"key": "value", "type": "[DataConnectorDefinition]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
+ def __init__(
+ self,
+ *,
+ value: Optional[List["_models.DataConnectorDefinition"]] = None,
+ next_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 value:
+ :paramtype value: list[~azure.mgmt.securityinsight.models.DataConnectorDefinition]
+ :keyword next_link:
+ :paramtype next_link: str
"""
- super().__init__(state=state, **kwargs)
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
+class DataConnectorList(_serialization.Model):
+ """List all the data connectors.
-class Dynamics365DataConnectorProperties(DataConnectorTenantId):
- """Dynamics365 data connector 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 data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypes
+ :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 = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "Dynamics365DataConnectorDataTypes"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[DataConnector]"},
}
- def __init__(self, *, tenant_id: str, data_types: "_models.Dynamics365DataConnectorDataTypes", **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.DataConnector"],
+ **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.Dynamics365DataConnectorDataTypes
+ :keyword value: Array of data connectors. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.DataConnector]
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
-
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
-class EnrichmentDomainWhois(_serialization.Model):
- """Whois information for a given domain and associated metadata.
+class DataConnectorRequirementsState(_serialization.Model):
+ """Data connector requirements status.
- :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
+ :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
"""
_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"},
+ "authorization_state": {"key": "authorizationState", "type": "str"},
+ "license_state": {"key": "licenseState", "type": "str"},
}
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
- ):
+ authorization_state: Optional[Union[str, "_models.DataConnectorAuthorizationState"]] = None,
+ license_state: Optional[Union[str, "_models.DataConnectorLicenseState"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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
"""
super().__init__(**kwargs)
- self.domain = domain
- self.server = server
- self.created = created
- self.updated = updated
- self.expires = expires
- self.parsed_whois = parsed_whois
-
+ self.authorization_state = authorization_state
+ self.license_state = license_state
-class EnrichmentDomainWhoisContact(_serialization.Model):
- """An individual contact associated with this domain.
+class DataTypeDefinitions(_serialization.Model):
+ """The data type definition.
- :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
+ :ivar data_type: The data type name.
+ :vartype data_type: 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"},
+ "data_type": {"key": "dataType", "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
- ):
+ data_type: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword data_type: The data type name.
+ :paramtype data_type: 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
+ self.data_type = data_type
+class DCRConfiguration(_serialization.Model):
+ """The configuration of the destination of the data.
-class EnrichmentDomainWhoisContacts(_serialization.Model):
- """The set of contacts associated with this domain.
+ All required parameters must be populated in order to send to server.
- :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
+ :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 = {
- "admin": {"key": "admin", "type": "EnrichmentDomainWhoisContact"},
- "billing": {"key": "billing", "type": "EnrichmentDomainWhoisContact"},
- "registrant": {"key": "registrant", "type": "EnrichmentDomainWhoisContact"},
- "tech": {"key": "tech", "type": "EnrichmentDomainWhoisContact"},
+ "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,
*,
- 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
+ data_collection_endpoint: str,
+ data_collection_rule_immutable_id: str,
+ stream_name: str,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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__(**kwargs)
- self.admin = admin
- self.billing = billing
- self.registrant = registrant
- self.tech = tech
-
+ self.data_collection_endpoint = data_collection_endpoint
+ self.data_collection_rule_immutable_id = data_collection_rule_immutable_id
+ self.stream_name = stream_name
-class EnrichmentDomainWhoisDetails(_serialization.Model):
- """The whois record for a given domain.
+class Deployment(_serialization.Model):
+ """Description about a deployment.
- :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]
+ :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 = {
- "registrar": {"key": "registrar", "type": "EnrichmentDomainWhoisRegistrarDetails"},
- "contacts": {"key": "contacts", "type": "EnrichmentDomainWhoisContacts"},
- "name_servers": {"key": "nameServers", "type": "[str]"},
- "statuses": {"key": "statuses", "type": "[str]"},
+ "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,
*,
- registrar: Optional["_models.EnrichmentDomainWhoisRegistrarDetails"] = None,
- contacts: Optional["_models.EnrichmentDomainWhoisContacts"] = None,
- name_servers: Optional[List[str]] = None,
- statuses: Optional[List[str]] = 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 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]
+ :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.registrar = registrar
- self.contacts = contacts
- self.name_servers = name_servers
- self.statuses = statuses
-
+ 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 EnrichmentDomainWhoisRegistrarDetails(_serialization.Model):
- """The registrar associated with this domain.
+class DeploymentInfo(_serialization.Model):
+ """Information regarding a deployment.
- :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
+ :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 = {
- "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"},
+ "deployment_fetch_status": {"key": "deploymentFetchStatus", "type": "str"},
+ "deployment": {"key": "deployment", "type": "Deployment"},
+ "message": {"key": "message", "type": "str"},
}
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
- ):
+ deployment_fetch_status: Optional[Union[str, "_models.DeploymentFetchStatus"]] = None,
+ deployment: Optional["_models.Deployment"] = None,
+ message: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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.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
+ 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 EnrichmentIpGeodata(_serialization.Model): # pylint: disable=too-many-instance-attributes
- """Geodata information for a given IP address.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :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
+ 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", "SubmissionMail", and "Nic".
+ :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 = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ '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 = {
- "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"},
+ "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"},
+ "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,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ 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 DnsEntityProperties(EntityCommonProperties):
+ """Dns 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 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 = {
+ '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 = {
+ "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,
+ **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 server.
+
+ :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
+ "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
+ "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
+ """
+
+ _validation = {
+ 'kind': {'required': True},
+ }
+
+ _attribute_map = {
+ "kind": {"key": "kind", "type": "str"},
+ "tenant_id": {"key": "properties.tenantId", "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
- ):
+ tenant_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_id: str
"""
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.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 server.
-class EntityAnalytics(Settings):
- """Settings with single toggle.
+ :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
+ :vartype tenant_id: str
+ """
+
+class Dynamics365DataConnector(DataConnector):
+ """Represents Dynamics365 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
@@ -7275,19 +8198,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 data connector kind. Required. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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.Dynamics365DataConnectorDataTypes
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -7297,644 +8227,862 @@ 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]"},
+ "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "data_types": {"key": "properties.dataTypes", "type": "Dynamics365DataConnectorDataTypes"},
}
def __init__(
self,
*,
etag: Optional[str] = None,
- entity_providers: Optional[List[Union[str, "_models.EntityProviders"]]] = None,
- **kwargs
- ):
+ tenant_id: Optional[str] = None,
+ data_types: Optional["_models.Dynamics365DataConnectorDataTypes"] = 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 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 = "EntityAnalytics"
- self.entity_providers = entity_providers
+ 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.
-class EntityEdges(_serialization.Model):
- """The edge that connects the entity to the other entity.
+ All required parameters must be populated in order to send to server.
- :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]
+ :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 = {
- "target_entity_id": {"key": "targetEntityId", "type": "str"},
- "additional_data": {"key": "additionalData", "type": "{object}"},
+ "dynamics365_cds_activities": {"key": "dynamics365CdsActivities", "type": "Dynamics365DataConnectorDataTypesDynamics365CdsActivities"},
}
def __init__(
- self, *, target_entity_id: Optional[str] = None, additional_data: Optional[Dict[str, Any]] = None, **kwargs
- ):
+ self,
+ *,
+ dynamics365_cds_activities: "_models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities",
+ **kwargs: Any
+ ) -> None:
"""
- :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]
+ :keyword dynamics365_cds_activities: Common Data Service data type connection. Required.
+ :paramtype dynamics365_cds_activities:
+ ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities
"""
super().__init__(**kwargs)
- self.target_entity_id = target_entity_id
- self.additional_data = additional_data
+ self.dynamics365_cds_activities = dynamics365_cds_activities
+class Dynamics365DataConnectorDataTypesDynamics365CdsActivities(DataConnectorDataTypeCommon): # pylint: disable=name-too-long
+ """Common Data Service data type connection.
-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 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
"""
- _attribute_map = {
- "end_time": {"key": "endTime", "type": "iso-8601"},
- "expansion_id": {"key": "expansionId", "type": "str"},
- "start_time": {"key": "startTime", "type": "iso-8601"},
+class Dynamics365DataConnectorProperties(DataConnectorTenantId):
+ """Dynamics365 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. Required.
+ :vartype tenant_id: str
+ :ivar data_types: The available data types for the connector. Required.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.Dynamics365DataConnectorDataTypes
+ """
+
+ _validation = {
+ 'tenant_id': {'required': True},
+ 'data_types': {'required': True},
}
- def __init__(
- self,
+ _attribute_map = {
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "data_types": {"key": "dataTypes", "type": "Dynamics365DataConnectorDataTypes"},
+ }
+
+ def __init__(
+ self,
*,
- end_time: Optional[datetime.datetime] = None,
- expansion_id: Optional[str] = None,
- start_time: Optional[datetime.datetime] = None,
- **kwargs
- ):
+ tenant_id: str,
+ data_types: "_models.Dynamics365DataConnectorDataTypes",
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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__(**kwargs)
- self.end_time = end_time
- self.expansion_id = expansion_id
- self.start_time = start_time
-
+ super().__init__(tenant_id=tenant_id, **kwargs)
+ self.data_types = data_types
-class EntityExpandResponse(_serialization.Model):
- """The entity expansion result operation response.
+class EnrichmentDomainBody(_serialization.Model):
+ """Domain name to be enriched.
- :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
+ :ivar domain: The domain name.
+ :vartype domain: str
"""
_attribute_map = {
- "meta_data": {"key": "metaData", "type": "ExpansionResultsMetadata"},
- "value": {"key": "value", "type": "EntityExpandResponseValue"},
+ "domain": {"key": "domain", "type": "str"},
}
def __init__(
self,
*,
- meta_data: Optional["_models.ExpansionResultsMetadata"] = None,
- value: Optional["_models.EntityExpandResponseValue"] = None,
- **kwargs
- ):
+ domain: Optional[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 domain: The domain name.
+ :paramtype domain: str
"""
super().__init__(**kwargs)
- self.meta_data = meta_data
- self.value = value
-
+ self.domain = domain
-class EntityExpandResponseValue(_serialization.Model):
- """The expansion result values.
+class EnrichmentDomainWhois(_serialization.Model):
+ """Whois information for a given domain and associated metadata.
- :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]
+ :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 = {
- "entities": {"key": "entities", "type": "[Entity]"},
- "edges": {"key": "edges", "type": "[EntityEdges]"},
+ "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,
*,
- entities: Optional[List["_models.Entity"]] = None,
- edges: Optional[List["_models.EntityEdges"]] = None,
- **kwargs
- ):
+ 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: Any
+ ) -> None:
"""
- :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]
+ :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.entities = entities
- self.edges = edges
-
+ self.domain = domain
+ self.server = server
+ self.created = created
+ self.updated = updated
+ self.expires = expires
+ self.parsed_whois = parsed_whois
-class EntityFieldMapping(_serialization.Model):
- """Map identifiers of a single entity.
+class EnrichmentDomainWhoisContact(_serialization.Model):
+ """An individual contact associated with this domain.
- :ivar identifier: Alert V3 identifier.
- :vartype identifier: str
- :ivar value: The value of the identifier.
- :vartype value: str
+ :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 = {
- "identifier": {"key": "identifier", "type": "str"},
- "value": {"key": "value", "type": "str"},
+ "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, *, identifier: Optional[str] = None, value: Optional[str] = None, **kwargs):
+ 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: Any
+ ) -> None:
"""
- :keyword identifier: Alert V3 identifier.
- :paramtype identifier: str
- :keyword value: The value of the identifier.
- :paramtype value: str
+ :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.identifier = identifier
- self.value = value
-
-
-class EntityGetInsightsParameters(_serialization.Model):
- """The parameters required to execute insights operation on the given entity.
+ 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
- All required parameters must be populated in order to send to Azure.
+class EnrichmentDomainWhoisContacts(_serialization.Model):
+ """The set of contacts associated with this domain.
- :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 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
"""
- _validation = {
- "start_time": {"required": True},
- "end_time": {"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]"},
+ "admin": {"key": "admin", "type": "EnrichmentDomainWhoisContact"},
+ "billing": {"key": "billing", "type": "EnrichmentDomainWhoisContact"},
+ "registrant": {"key": "registrant", "type": "EnrichmentDomainWhoisContact"},
+ "tech": {"key": "tech", "type": "EnrichmentDomainWhoisContact"},
}
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
- ):
+ admin: Optional["_models.EnrichmentDomainWhoisContact"] = None,
+ billing: Optional["_models.EnrichmentDomainWhoisContact"] = None,
+ registrant: Optional["_models.EnrichmentDomainWhoisContact"] = None,
+ tech: Optional["_models.EnrichmentDomainWhoisContact"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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]
+ :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.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.admin = admin
+ self.billing = billing
+ self.registrant = registrant
+ self.tech = tech
-class EntityGetInsightsResponse(_serialization.Model):
- """The Get Insights result operation response.
+class EnrichmentDomainWhoisDetails(_serialization.Model):
+ """The whois record for a given domain.
- :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 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 = {
- "meta_data": {"key": "metaData", "type": "GetInsightsResultsMetadata"},
- "value": {"key": "value", "type": "[EntityInsightItem]"},
+ "registrar": {"key": "registrar", "type": "EnrichmentDomainWhoisRegistrarDetails"},
+ "contacts": {"key": "contacts", "type": "EnrichmentDomainWhoisContacts"},
+ "name_servers": {"key": "nameServers", "type": "[str]"},
+ "statuses": {"key": "statuses", "type": "[str]"},
}
def __init__(
self,
*,
- meta_data: Optional["_models.GetInsightsResultsMetadata"] = None,
- value: Optional[List["_models.EntityInsightItem"]] = None,
- **kwargs
- ):
+ registrar: Optional["_models.EnrichmentDomainWhoisRegistrarDetails"] = None,
+ contacts: Optional["_models.EnrichmentDomainWhoisContacts"] = None,
+ name_servers: Optional[List[str]] = None,
+ statuses: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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]
+ :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.meta_data = meta_data
- self.value = value
-
+ self.registrar = registrar
+ self.contacts = contacts
+ self.name_servers = name_servers
+ self.statuses = statuses
-class EntityInsightItem(_serialization.Model):
- """Entity insight Item.
+class EnrichmentDomainWhoisRegistrarDetails(_serialization.Model):
+ """The registrar associated with this domain.
- :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 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 = {
- "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]"},
+ "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"},
}
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
- ):
+ 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: Any
+ ) -> None:
"""
- :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]
+ :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.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.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 EntityInsightItemQueryTimeInterval(_serialization.Model):
- """The Time interval that the query actually executed on.
+class EnrichmentIpAddressBody(_serialization.Model):
+ """IP address (v4 or v6) to be enriched.
- :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 ip_address: The dotted-decimal or colon-separated string representation of the IP
+ address.
+ :vartype ip_address: str
"""
_attribute_map = {
- "start_time": {"key": "startTime", "type": "iso-8601"},
- "end_time": {"key": "endTime", "type": "iso-8601"},
+ "ip_address": {"key": "ipAddress", "type": "str"},
}
def __init__(
- self, *, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, **kwargs
- ):
+ self,
+ *,
+ ip_address: 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 ip_address: The dotted-decimal or colon-separated string representation of the IP
+ address.
+ :paramtype ip_address: str
"""
super().__init__(**kwargs)
- self.start_time = start_time
- self.end_time = end_time
+ self.ip_address = ip_address
+class EnrichmentIpGeodata(_serialization.Model): # pylint: disable=too-many-instance-attributes
+ """Geodata information for a given IP address.
-class EntityList(_serialization.Model):
- """List of all the entities.
-
- 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 entities.
- :vartype next_link: str
- :ivar value: Array of entities. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Entity]
+ :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_confidence_factor: A numeric rating of confidence that the value in the 'city' field
+ is correct, on a scale of 0-100.
+ :vartype city_confidence_factor: 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_confidence_factor: A numeric rating of confidence that the value in the 'country'
+ field is correct on a scale of 0-100.
+ :vartype country_confidence_factor: 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_confidence_factor: A numeric rating of confidence that the value in the 'state'
+ field is correct on a scale of 0-100.
+ :vartype state_confidence_factor: int
+ :ivar state_code: The abbreviated name for the state this IP address is located in.
+ :vartype state_code: str
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'city_confidence_factor': {'maximum': 100, 'minimum': 0},
+ 'country_confidence_factor': {'maximum': 100, 'minimum': 0},
+ 'state_confidence_factor': {'maximum': 100, 'minimum': 0},
}
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[Entity]"},
- }
-
- def __init__(self, *, value: List["_models.Entity"], **kwargs):
- """
- :keyword value: Array of entities. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Entity]
- """
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
-
-
-class EntityMapping(_serialization.Model):
- """Single entity mapping for the alert rule.
-
- :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 = {
- "entity_type": {"key": "entityType", "type": "str"},
- "field_mappings": {"key": "fieldMappings", "type": "[FieldMapping]"},
+ "asn": {"key": "asn", "type": "str"},
+ "carrier": {"key": "carrier", "type": "str"},
+ "city": {"key": "city", "type": "str"},
+ "city_confidence_factor": {"key": "cityConfidenceFactor", "type": "int"},
+ "continent": {"key": "continent", "type": "str"},
+ "country": {"key": "country", "type": "str"},
+ "country_confidence_factor": {"key": "countryConfidenceFactor", "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_confidence_factor": {"key": "stateConfidenceFactor", "type": "int"},
+ "state_code": {"key": "stateCode", "type": "str"},
}
def __init__(
self,
*,
- entity_type: Optional[Union[str, "_models.EntityMappingType"]] = None,
- field_mappings: Optional[List["_models.FieldMapping"]] = None,
- **kwargs
- ):
- """
- :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.entity_type = entity_type
- self.field_mappings = field_mappings
-
-
-class EntityQueryItem(_serialization.Model):
- """An abstract Query item for entity.
+ asn: Optional[str] = None,
+ carrier: Optional[str] = None,
+ city: Optional[str] = None,
+ city_confidence_factor: Optional[int] = None,
+ continent: Optional[str] = None,
+ country: Optional[str] = None,
+ country_confidence_factor: 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_confidence_factor: Optional[int] = None,
+ state_code: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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_confidence_factor: A numeric rating of confidence that the value in the 'city'
+ field is correct, on a scale of 0-100.
+ :paramtype city_confidence_factor: 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_confidence_factor: A numeric rating of confidence that the value in the
+ 'country' field is correct on a scale of 0-100.
+ :paramtype country_confidence_factor: 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_confidence_factor: A numeric rating of confidence that the value in the 'state'
+ field is correct on a scale of 0-100.
+ :paramtype state_confidence_factor: int
+ :keyword state_code: The abbreviated name for the state this IP address is located in.
+ :paramtype state_code: str
+ """
+ super().__init__(**kwargs)
+ self.asn = asn
+ self.carrier = carrier
+ self.city = city
+ self.city_confidence_factor = city_confidence_factor
+ self.continent = continent
+ self.country = country
+ self.country_confidence_factor = country_confidence_factor
+ 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_confidence_factor = state_confidence_factor
+ self.state_code = state_code
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- InsightQueryItem
+class EntityAnalytics(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.
+ 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 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]
"""
_validation = {
- "id": {"readonly": True},
- "kind": {"required": True},
+ '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"},
+ "entity_providers": {"key": "properties.entityProviders", "type": "[str]"},
}
- _subtype_map = {"kind": {"Insight": "InsightQueryItem"}}
-
- def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ etag: Optional[str] = None,
+ entity_providers: Optional[List[Union[str, "_models.EntityProviders"]]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword name: Query Template ARM Name.
- :paramtype name: str
- :keyword type: ARM Type.
- :paramtype type: str
+ :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]
"""
- super().__init__(**kwargs)
- self.id = None
- self.name = name
- self.type = type
- self.kind: Optional[str] = None
-
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = 'EntityAnalytics'
+ self.entity_providers = entity_providers
-class EntityQueryItemProperties(_serialization.Model):
- """An properties abstract Query item for entity.
+class EntityEdges(_serialization.Model):
+ """The edge that connects the entity to the other entity.
- :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 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 = {
- "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"},
+ "target_entity_id": {"key": "targetEntityId", "type": "str"},
+ "additional_data": {"key": "additionalData", "type": "{object}"},
}
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
- ):
+ target_entity_id: Optional[str] = None,
+ additional_data: Optional[Dict[str, Any]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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 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.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.target_entity_id = target_entity_id
+ self.additional_data = additional_data
-class EntityQueryItemPropertiesDataTypesItem(_serialization.Model):
- """EntityQueryItemPropertiesDataTypesItem.
+class EntityExpandParameters(_serialization.Model):
+ """The parameters required to execute an expand operation on the given entity.
- :ivar data_type: Data type name.
- :vartype data_type: str
+ :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
"""
_attribute_map = {
- "data_type": {"key": "dataType", "type": "str"},
+ "end_time": {"key": "endTime", "type": "iso-8601"},
+ "expansion_id": {"key": "expansionId", "type": "str"},
+ "start_time": {"key": "startTime", "type": "iso-8601"},
}
- def __init__(self, *, data_type: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ end_time: Optional[datetime.datetime] = None,
+ expansion_id: Optional[str] = None,
+ start_time: Optional[datetime.datetime] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword data_type: Data type name.
- :paramtype data_type: str
+ :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.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.
+ self.end_time = end_time
+ self.expansion_id = expansion_id
+ self.start_time = start_time
- All required parameters must be populated in order to send to Azure.
+class EntityExpandResponse(_serialization.Model):
+ """The entity expansion result operation response.
- :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]
+ :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
"""
- _validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
- }
-
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[EntityQuery]"},
+ "meta_data": {"key": "metaData", "type": "ExpansionResultsMetadata"},
+ "value": {"key": "value", "type": "EntityExpandResponseValue"},
}
- def __init__(self, *, value: List["_models.EntityQuery"], **kwargs):
+ def __init__(
+ self,
+ *,
+ meta_data: Optional["_models.ExpansionResultsMetadata"] = None,
+ value: Optional["_models.EntityExpandResponseValue"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of entity queries. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.EntityQuery]
+ :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
"""
super().__init__(**kwargs)
- self.next_link = None
+ self.meta_data = meta_data
self.value = value
+class EntityExpandResponseValue(_serialization.Model):
+ """The expansion result values.
-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]
+ :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]
"""
- _validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ _attribute_map = {
+ "entities": {"key": "entities", "type": "[Entity]"},
+ "edges": {"key": "edges", "type": "[EntityEdges]"},
}
+ def __init__(
+ self,
+ *,
+ entities: Optional[List["_models.Entity"]] = None,
+ edges: Optional[List["_models.EntityEdges"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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 = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[EntityQueryTemplate]"},
+ "identifier": {"key": "identifier", "type": "str"},
+ "value": {"key": "value", "type": "str"},
}
- def __init__(self, *, value: List["_models.EntityQueryTemplate"], **kwargs):
+ def __init__(
+ self,
+ *,
+ identifier: Optional[str] = None,
+ value: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of entity query templates. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.EntityQueryTemplate]
+ :keyword identifier: Alert V3 identifier.
+ :paramtype identifier: str
+ :keyword value: The value of the identifier.
+ :paramtype value: str
"""
super().__init__(**kwargs)
- self.next_link = None
+ self.identifier = identifier
self.value = value
+class EntityGetInsightsParameters(_serialization.Model):
+ """The parameters required to execute insights operation on the given entity.
-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.
+ All required parameters must be populated in order to send to server.
- :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
+ :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]
"""
_validation = {
- "start_time": {"required": True},
- "end_time": {"required": True},
+ '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"},
+ "add_default_extended_time_range": {"key": "addDefaultExtendedTimeRange", "type": "bool"},
+ "insight_query_ids": {"key": "insightQueryIds", "type": "[str]"},
}
def __init__(
@@ -7942,818 +9090,729 @@ def __init__(
*,
start_time: datetime.datetime,
end_time: datetime.datetime,
- kinds: Optional[List[Union[str, "_models.EntityTimelineKind"]]] = None,
- number_of_bucket: Optional[int] = None,
- **kwargs
- ):
+ add_default_extended_time_range: Optional[bool] = None,
+ insight_query_ids: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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]
"""
super().__init__(**kwargs)
- self.kinds = kinds
self.start_time = start_time
self.end_time = end_time
- self.number_of_bucket = number_of_bucket
-
+ self.add_default_extended_time_range = add_default_extended_time_range
+ self.insight_query_ids = insight_query_ids
-class EntityTimelineResponse(_serialization.Model):
- """The entity timeline result operation response.
+class EntityGetInsightsResponse(_serialization.Model):
+ """The Get Insights 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]
+ :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]
"""
_attribute_map = {
- "meta_data": {"key": "metaData", "type": "TimelineResultsMetadata"},
- "value": {"key": "value", "type": "[EntityTimelineItem]"},
+ "meta_data": {"key": "metaData", "type": "GetInsightsResultsMetadata"},
+ "value": {"key": "value", "type": "[EntityInsightItem]"},
}
def __init__(
self,
*,
- meta_data: Optional["_models.TimelineResultsMetadata"] = None,
- value: Optional[List["_models.EntityTimelineItem"]] = None,
- **kwargs
- ):
+ meta_data: Optional["_models.GetInsightsResultsMetadata"] = None,
+ value: Optional[List["_models.EntityInsightItem"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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]
+ :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]
"""
super().__init__(**kwargs)
self.meta_data = meta_data
self.value = value
+class EntityInsightItem(_serialization.Model):
+ """Entity insight Item.
-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
+ :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]
"""
_attribute_map = {
- "aggregation_kind": {"key": "aggregationKind", "type": "str"},
+ "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]"},
}
def __init__(
- self, *, aggregation_kind: Optional[Union[str, "_models.EventGroupingAggregationKind"]] = None, **kwargs
- ):
+ 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: 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
+ :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]
"""
super().__init__(**kwargs)
- self.aggregation_kind = aggregation_kind
+ 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
+class EntityInsightItemQueryTimeInterval(_serialization.Model):
+ """The Time interval that the query actually executed on.
-class ExpansionEntityQuery(EntityQuery): # pylint: disable=too-many-instance-attributes
- """Represents Expansion entity query.
+ :ivar start_time: Insight query start time.
+ :vartype start_time: ~datetime.datetime
+ :ivar end_time: Insight query end time.
+ :vartype end_time: ~datetime.datetime
+ """
+
+ _attribute_map = {
+ "start_time": {"key": "startTime", "type": "iso-8601"},
+ "end_time": {"key": "endTime", "type": "iso-8601"},
+ }
+
+ def __init__(
+ self,
+ *,
+ start_time: Optional[datetime.datetime] = None,
+ end_time: Optional[datetime.datetime] = 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
+ """
+ super().__init__(**kwargs)
+ self.start_time = start_time
+ self.end_time = end_time
+
+class EntityList(_serialization.Model):
+ """List of all the entities.
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 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.
- :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 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]
"""
_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"},
- "data_sources": {"key": "properties.dataSources", "type": "[str]"},
- "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"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Entity]"},
}
def __init__(
self,
*,
- etag: Optional[str] = None,
- data_sources: Optional[List[str]] = 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
- ):
+ value: List["_models.Entity"],
+ **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.
- :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 value: Array of entities. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Entity]
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "Expansion"
- self.data_sources = data_sources
- 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
-
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
-class ExpansionResultAggregation(_serialization.Model):
- """Information of a specific aggregation in the expansion result.
+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 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.
- :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 incident_arm_id: Incident ARM id.
+ :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 = {
- "count": {"required": True},
- "entity_kind": {"required": True},
+ 'logic_apps_resource_id': {'required': True},
}
_attribute_map = {
- "aggregation_type": {"key": "aggregationType", "type": "str"},
- "count": {"key": "count", "type": "int"},
- "display_name": {"key": "displayName", "type": "str"},
- "entity_kind": {"key": "entityKind", "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,
*,
- count: int,
- entity_kind: Union[str, "_models.EntityKind"],
- aggregation_type: Optional[str] = None,
- display_name: Optional[str] = None,
- **kwargs
- ):
+ logic_apps_resource_id: str,
+ incident_arm_id: Optional[str] = None,
+ tenant_id: Optional[str] = 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.
- :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 incident_arm_id: Incident ARM id.
+ :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.aggregation_type = aggregation_type
- self.count = count
- self.display_name = display_name
- self.entity_kind = entity_kind
-
+ self.incident_arm_id = incident_arm_id
+ self.tenant_id = tenant_id
+ self.logic_apps_resource_id = logic_apps_resource_id
-class ExpansionResultsMetadata(_serialization.Model):
- """Expansion result metadata.
+class EntityMapping(_serialization.Model):
+ """Single entity mapping for the alert rule.
- :ivar aggregations: Information of the aggregated nodes in the expansion result.
- :vartype aggregations: list[~azure.mgmt.securityinsight.models.ExpansionResultAggregation]
+ :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 = {
- "aggregations": {"key": "aggregations", "type": "[ExpansionResultAggregation]"},
+ "entity_type": {"key": "entityType", "type": "str"},
+ "field_mappings": {"key": "fieldMappings", "type": "[FieldMapping]"},
}
- def __init__(self, *, aggregations: Optional[List["_models.ExpansionResultAggregation"]] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ entity_type: Optional[Union[str, "_models.EntityMappingType"]] = None,
+ field_mappings: Optional[List["_models.FieldMapping"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword aggregations: Information of the aggregated nodes in the expansion result.
- :paramtype aggregations: list[~azure.mgmt.securityinsight.models.ExpansionResultAggregation]
+ :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.aggregations = aggregations
+ self.entity_type = entity_type
+ self.field_mappings = field_mappings
+class EntityQueryItem(_serialization.Model):
+ """An abstract Query item for entity.
-class EyesOn(Settings):
- """Settings with single toggle.
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ InsightQueryItem
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: Query Template ARM ID.
:vartype id: str
- :ivar name: The name of the resource.
+ :ivar name: Query Template ARM Name.
:vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
+ :ivar type: ARM Type.
: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 kind: The kind of the entity query. Required. Known values are: "Expansion", "Insight",
+ and "Activity".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.EntityQueryKind
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "is_enabled": {"readonly": True},
+ 'id': {'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"},
- "is_enabled": {"key": "properties.isEnabled", "type": "bool"},
}
- def __init__(self, *, etag: Optional[str] = None, **kwargs):
+ _subtype_map = {
+ 'kind': {'Insight': 'InsightQueryItem'}
+ }
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ type: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
+ :keyword name: Query Template ARM Name.
+ :paramtype name: str
+ :keyword type: ARM Type.
+ :paramtype type: str
"""
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "EyesOn"
- self.is_enabled = None
-
+ super().__init__(**kwargs)
+ self.id = None
+ self.name = name
+ self.type = type
+ self.kind: Optional[str] = None
-class FieldMapping(_serialization.Model):
- """A single field mapping of the mapped entity.
+class EntityQueryItemProperties(_serialization.Model):
+ """An properties abstract Query item for entity.
- :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
+ :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
"""
_attribute_map = {
- "identifier": {"key": "identifier", "type": "str"},
- "column_name": {"key": "columnName", "type": "str"},
+ "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"},
}
- def __init__(self, *, identifier: Optional[str] = None, column_name: Optional[str] = None, **kwargs):
+ 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: Any
+ ) -> None:
"""
- :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
+ :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
"""
super().__init__(**kwargs)
- self.identifier = identifier
- self.column_name = column_name
-
-
-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.
+ 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
- All required parameters must be populated in order to send to Azure.
+class EntityQueryItemPropertiesDataTypesItem(_serialization.Model):
+ """EntityQueryItemPropertiesDataTypesItem.
- :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 data_type: Data type name.
+ :vartype data_type: 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},
- "directory": {"readonly": True},
- "file_hash_entity_ids": {"readonly": True},
- "file_name": {"readonly": True},
- "host_entity_id": {"readonly": True},
+ _attribute_map = {
+ "data_type": {"key": "dataType", "type": "str"},
}
- _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"},
- }
-
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ *,
+ data_type: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword data_type: Data type name.
+ :paramtype data_type: str
+ """
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.data_type = data_type
-class FileEntityProperties(EntityCommonProperties):
- """File entity property bag.
+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.
- :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
+ All required parameters must be populated in order to send to server.
+
+ :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 = {
- "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},
+ 'next_link': {'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"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[EntityQuery]"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ *,
+ value: List["_models.EntityQuery"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Array of entity queries. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.EntityQuery]
+ """
super().__init__(**kwargs)
- self.directory = None
- self.file_hash_entity_ids = None
- self.file_name = None
- self.host_entity_id = None
-
+ self.next_link = None
+ self.value = value
-class FileHashEntity(Entity):
- """Represents a file hash entity.
+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.
+ 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 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 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 = {
- "id": {"readonly": True},
- "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},
+ '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"},
- "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"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[EntityQueryTemplate]"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ *,
+ value: List["_models.EntityQueryTemplate"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Array of entity query templates. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.EntityQueryTemplate]
+ """
super().__init__(**kwargs)
- self.kind: str = "FileHash"
- self.additional_data = None
- self.friendly_name = None
- self.algorithm = None
- self.hash_value = None
-
+ self.next_link = None
+ self.value = value
-class FileHashEntityProperties(EntityCommonProperties):
- """FileHash entity property bag.
+class EntityTimelineParameters(_serialization.Model):
+ """The parameters required to execute s timeline operation on the given 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 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 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 = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "algorithm": {"readonly": True},
- "hash_value": {"readonly": True},
+ 'start_time': {'required': True},
+ 'end_time': {'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"},
+ "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, **kwargs):
- """ """
+ 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: Any
+ ) -> None:
+ """
+ :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.algorithm = None
- self.hash_value = None
-
-
-class FileImport(Resource): # pylint: disable=too-many-instance-attributes
- """Represents a file import in Azure Security Insights.
+ self.kinds = kinds
+ self.start_time = start_time
+ self.end_time = end_time
+ self.number_of_bucket = number_of_bucket
- Variables are only populated by the server, and will be ignored when sending a request.
+class EntityTimelineResponse(_serialization.Model):
+ """The entity timeline result operation response.
- :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 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]
"""
- _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},
- }
-
_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"},
+ "meta_data": {"key": "metaData", "type": "TimelineResultsMetadata"},
+ "value": {"key": "value", "type": "[EntityTimelineItem]"},
}
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
- ):
+ meta_data: Optional["_models.TimelineResultsMetadata"] = None,
+ value: Optional[List["_models.EntityTimelineItem"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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.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.meta_data = meta_data
+ self.value = value
+class Error(_serialization.Model):
+ """The error description for why a publication failed.
-class FileImportList(_serialization.Model):
- """List all the file imports.
+ 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.
+ :ivar member_resource_name: The member resource name for which the publication error occured.
+ Required.
+ :vartype member_resource_name: str
+ :ivar error_message: The error message. Required.
+ :vartype error_message: str
+ """
- All required parameters must be populated in order to send to Azure.
+ _validation = {
+ 'member_resource_name': {'required': True},
+ 'error_message': {'required': True},
+ }
- :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]
+ _attribute_map = {
+ "member_resource_name": {"key": "memberResourceName", "type": "str"},
+ "error_message": {"key": "errorMessage", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ member_resource_name: str,
+ error_message: str,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword member_resource_name: The member resource name for which the publication error
+ occured. Required.
+ :paramtype member_resource_name: str
+ :keyword error_message: The error message. Required.
+ :paramtype error_message: str
+ """
+ super().__init__(**kwargs)
+ self.member_resource_name = member_resource_name
+ self.error_message = error_message
+
+class ErrorAdditionalInfo(_serialization.Model):
+ """The resource management error additional info.
+
+ 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 = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'type': {'readonly': True},
+ 'info': {'readonly': True},
}
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[FileImport]"},
+ "type": {"key": "type", "type": "str"},
+ "info": {"key": "info", "type": "object"},
}
- def __init__(self, *, value: List["_models.FileImport"], **kwargs):
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of file imports. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.FileImport]
"""
super().__init__(**kwargs)
- self.next_link = None
- self.value = value
-
+ self.type = None
+ self.info = None
-class FileMetadata(_serialization.Model):
- """Represents a file.
+class ErrorDetail(_serialization.Model):
+ """The error detail.
Variables are only populated by the server, and will be ignored when sending a request.
- :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 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]
"""
_validation = {
- "file_content_uri": {"readonly": True},
- "delete_status": {"readonly": True},
+ 'code': {'readonly': True},
+ 'message': {'readonly': True},
+ 'target': {'readonly': True},
+ 'details': {'readonly': True},
+ 'additional_info': {'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"},
+ "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,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.code = None
+ self.message = None
+ self.target = None
+ self.details = None
+ self.additional_info = None
+
+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 error: The error object.
+ :vartype error: ~azure.mgmt.securityinsight.models.ErrorDetail
+ """
+
+ _attribute_map = {
+ "error": {"key": "error", "type": "ErrorDetail"},
}
def __init__(
self,
*,
- file_format: Optional[Union[str, "_models.FileFormat"]] = None,
- file_name: Optional[str] = None,
- file_size: Optional[int] = None,
- **kwargs
- ):
+ error: Optional["_models.ErrorDetail"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword error: The error object.
+ :paramtype error: ~azure.mgmt.securityinsight.models.ErrorDetail
"""
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.error = error
+
+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
+ """
-class FusionAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
- """Represents Fusion alert rule.
+ _attribute_map = {
+ "aggregation_kind": {"key": "aggregationKind", "type": "str"},
+ }
+
+ def __init__(
+ 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.aggregation_kind = aggregation_kind
+
+class ExpansionEntityQuery(EntityQuery): # pylint: disable=too-many-instance-attributes
+ """Represents Expansion 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.
+ 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
@@ -8765,46 +9824,33 @@ class FusionAlertRule(AlertRule): # pylint: disable=too-many-instance-attribute
: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 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.
: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 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
"""
_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},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -8814,818 +9860,829 @@ class FusionAlertRule(AlertRule): # pylint: disable=too-many-instance-attribute
"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"},
+ "data_sources": {"key": "properties.dataSources", "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]"},
+ "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"},
}
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
- ):
+ data_sources: Optional[List[str]] = 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: 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 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.
+ :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
"""
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
-
-
-class FusionAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
- """Represents Fusion alert rule template.
+ self.kind: str = 'Expansion'
+ self.data_sources = data_sources
+ 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
- Variables are only populated by the server, and will be ignored when sending a request.
+class ExpansionResultAggregation(_serialization.Model):
+ """Information of a specific aggregation in the expansion result.
- 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.
+ :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.
: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 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.EntityKindEnum
"""
_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},
+ 'count': {'required': True},
+ 'entity_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"},
- "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]"},
+ "aggregation_type": {"key": "aggregationType", "type": "str"},
+ "count": {"key": "count", "type": "int"},
+ "display_name": {"key": "displayName", "type": "str"},
+ "entity_kind": {"key": "entityKind", "type": "str"},
}
def __init__(
self,
*,
- alert_rules_created_by_template_count: Optional[int] = None,
- description: Optional[str] = None,
+ count: int,
+ entity_kind: Union[str, "_models.EntityKindEnum"],
+ aggregation_type: 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
- ):
+ **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.
+ :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.
: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 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.EntityKindEnum
"""
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.aggregation_type = aggregation_type
+ self.count = count
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
-
-
-class FusionScenarioExclusionPattern(_serialization.Model):
- """Represents a Fusion scenario exclusion patterns in Fusion detection.
+ self.entity_kind = entity_kind
- All required parameters must be populated in order to send to Azure.
+class ExpansionResultsMetadata(_serialization.Model):
+ """Expansion result metadata.
- :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 aggregations: Information of the aggregated nodes in the expansion result.
+ :vartype aggregations: list[~azure.mgmt.securityinsight.models.ExpansionResultAggregation]
"""
- _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"},
+ "aggregations": {"key": "aggregations", "type": "[ExpansionResultAggregation]"},
}
- def __init__(self, *, exclusion_pattern: str, date_added_in_utc: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ aggregations: Optional[List["_models.ExpansionResultAggregation"]] = 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 aggregations: Information of the aggregated nodes in the expansion result.
+ :paramtype aggregations: list[~azure.mgmt.securityinsight.models.ExpansionResultAggregation]
"""
super().__init__(**kwargs)
- self.exclusion_pattern = exclusion_pattern
- self.date_added_in_utc = date_added_in_utc
+ self.aggregations = aggregations
+class EyesOn(Settings):
+ """Settings with single toggle.
-class FusionSourceSettings(_serialization.Model):
- """Represents a supported source signal configuration in Fusion detection.
+ 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 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 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 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
"""
_validation = {
- "enabled": {"required": True},
- "source_name": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'is_enabled': {'readonly': True},
}
_attribute_map = {
- "enabled": {"key": "enabled", "type": "bool"},
- "source_name": {"key": "sourceName", "type": "str"},
- "source_sub_types": {"key": "sourceSubTypes", "type": "[FusionSourceSubTypeSetting]"},
+ "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"},
}
def __init__(
self,
*,
- enabled: bool,
- source_name: str,
- source_sub_types: Optional[List["_models.FusionSourceSubTypeSetting"]] = None,
- **kwargs
- ):
+ etag: Optional[str] = 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 etag: Etag of the azure resource.
+ :paramtype etag: str
"""
- super().__init__(**kwargs)
- self.enabled = enabled
- self.source_name = source_name
- self.source_sub_types = source_sub_types
-
-
-class FusionSourceSubTypeSetting(_serialization.Model):
- """Represents a supported source subtype configuration under a source signal in Fusion detection.
-
- Variables are only populated by the server, and will be ignored when sending a request.
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = 'EyesOn'
+ self.is_enabled = None
- All required parameters must be populated in order to send to Azure.
+class FieldMapping(_serialization.Model):
+ """A single field mapping of the mapped entity.
- :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 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
"""
- _validation = {
- "enabled": {"required": True},
- "source_sub_type_name": {"required": True},
- "source_sub_type_display_name": {"readonly": True},
- "severity_filters": {"required": 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"},
+ "identifier": {"key": "identifier", "type": "str"},
+ "column_name": {"key": "columnName", "type": "str"},
}
def __init__(
self,
*,
- enabled: bool,
- source_sub_type_name: str,
- severity_filters: "_models.FusionSubTypeSeverityFilter",
- **kwargs
- ):
+ identifier: Optional[str] = None,
+ column_name: Optional[str] = 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 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.enabled = enabled
- self.source_sub_type_name = source_sub_type_name
- self.source_sub_type_display_name = None
- self.severity_filters = severity_filters
-
+ self.identifier = identifier
+ self.column_name = column_name
-class FusionSubTypeSeverityFilter(_serialization.Model):
- """Represents severity configuration for a source subtype consumed in Fusion detection.
+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.
- :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]
+ 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", "SubmissionMail", and "Nic".
+ :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 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 = {
- "is_supported": {"readonly": 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},
+ 'directory': {'readonly': True},
+ 'file_hash_entity_ids': {'readonly': True},
+ 'file_name': {'readonly': True},
+ 'host_entity_id': {'readonly': True},
}
_attribute_map = {
- "is_supported": {"key": "isSupported", "type": "bool"},
- "filters": {"key": "filters", "type": "[FusionSubTypeSeverityFiltersItem]"},
+ "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"},
}
- def __init__(self, *, filters: Optional[List["_models.FusionSubTypeSeverityFiltersItem"]] = None, **kwargs):
+ def __init__(
+ self,
+ **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]
"""
super().__init__(**kwargs)
- self.is_supported = None
- self.filters = filters
-
+ 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
-class FusionSubTypeSeverityFiltersItem(_serialization.Model):
- """Represents a Severity filter setting for a given source subtype consumed in Fusion detection.
+class FileEntityProperties(EntityCommonProperties):
+ """File 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 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 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
"""
_validation = {
- "severity": {"required": True},
- "enabled": {"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},
}
_attribute_map = {
- "severity": {"key": "severity", "type": "str"},
- "enabled": {"key": "enabled", "type": "bool"},
+ "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"},
}
- def __init__(self, *, severity: Union[str, "_models.AlertSeverity"], enabled: bool, **kwargs):
+ def __init__(
+ self,
+ **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
"""
super().__init__(**kwargs)
- self.severity = severity
- self.enabled = enabled
+ self.directory = None
+ self.file_hash_entity_ids = None
+ self.file_name = None
+ self.host_entity_id = None
+class FileHashEntity(Entity):
+ """Represents a file hash entity.
-class FusionTemplateSourceSetting(_serialization.Model):
- """Represents a source signal consumed in Fusion detection.
+ 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_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 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", "SubmissionMail", and "Nic".
+ :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 = {
- "source_name": {"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},
+ 'algorithm': {'readonly': True},
+ 'hash_value': {'readonly': True},
}
_attribute_map = {
- "source_name": {"key": "sourceName", "type": "str"},
- "source_sub_types": {"key": "sourceSubTypes", "type": "[FusionTemplateSourceSubType]"},
+ "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"},
+ "algorithm": {"key": "properties.algorithm", "type": "str"},
+ "hash_value": {"key": "properties.hashValue", "type": "str"},
}
def __init__(
self,
- *,
- source_name: str,
- source_sub_types: Optional[List["_models.FusionTemplateSourceSubType"]] = None,
- **kwargs
- ):
+ **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]
"""
super().__init__(**kwargs)
- self.source_name = source_name
- self.source_sub_types = source_sub_types
-
+ self.kind: str = 'FileHash'
+ self.additional_data = None
+ self.friendly_name = None
+ self.algorithm = None
+ self.hash_value = None
-class FusionTemplateSourceSubType(_serialization.Model):
- """Represents a source subtype under a source signal consumed in Fusion detection.
+class FileHashEntityProperties(EntityCommonProperties):
+ """FileHash 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 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 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 = {
- "source_sub_type_name": {"required": True},
- "source_sub_type_display_name": {"readonly": True},
- "severity_filter": {"required": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'algorithm': {'readonly': True},
+ 'hash_value': {'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"},
+ "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, *, source_sub_type_name: str, severity_filter: "_models.FusionTemplateSubTypeSeverityFilter", **kwargs
- ):
+ self,
+ **kwargs: Any
+ ) -> None:
"""
- :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
"""
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.algorithm = None
+ self.hash_value = None
+class FileImport(Resource): # pylint: disable=too-many-instance-attributes
+ """Represents a file import in Azure Security Insights.
-class FusionTemplateSubTypeSeverityFilter(_serialization.Model):
- """Represents severity configurations available for a source subtype consumed in Fusion detection.
+ 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 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 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 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
"""
_validation = {
- "is_supported": {"required": True},
+ '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},
}
_attribute_map = {
- "is_supported": {"key": "isSupported", "type": "bool"},
- "severity_filters": {"key": "severityFilters", "type": "[str]"},
+ "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"},
}
def __init__(
self,
*,
- is_supported: bool,
- severity_filters: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
- **kwargs
- ):
+ 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: Any
+ ) -> None:
"""
- :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]
+ :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
"""
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},
- }
-
- _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"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.asn = None
- self.city = None
- self.country_code = None
- self.country_name = None
- self.latitude = None
- self.longitude = None
+ 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
+class FileImportList(_serialization.Model):
+ """List all the file imports.
-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 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]
"""
_validation = {
- "kind": {"required": True},
- "error_message": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "query_id": {"key": "queryId", "type": "str"},
- "error_message": {"key": "errorMessage", "type": "str"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[FileImport]"},
}
def __init__(
self,
*,
- kind: Union[str, "_models.GetInsightsError"],
- error_message: str,
- query_id: Optional[str] = None,
- **kwargs
- ):
+ value: List["_models.FileImport"],
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword value: Array of file imports. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.FileImport]
"""
super().__init__(**kwargs)
- self.kind = kind
- self.query_id = query_id
- self.error_message = error_message
-
+ self.next_link = None
+ self.value = value
-class GetInsightsResultsMetadata(_serialization.Model):
- """Get Insights result metadata.
+class FileMetadata(_serialization.Model):
+ """Represents a file.
- 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 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
"""
_validation = {
- "total_count": {"required": True},
+ 'file_content_uri': {'readonly': True},
+ 'delete_status': {'readonly': True},
}
_attribute_map = {
- "total_count": {"key": "totalCount", "type": "int"},
- "errors": {"key": "errors", "type": "[GetInsightsErrorKind]"},
+ "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"},
}
- def __init__(self, *, total_count: int, errors: Optional[List["_models.GetInsightsErrorKind"]] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ file_format: Optional[Union[str, "_models.FileFormat"]] = None,
+ file_name: Optional[str] = None,
+ file_size: Optional[int] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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]
+ :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
"""
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]
- """
+ self.file_format = file_format
+ self.file_name = file_name
+ self.file_size = file_size
+ self.file_content_uri = None
+ self.delete_status = None
- _attribute_map = {
- "value": {"key": "value", "type": "[EntityQueryItem]"},
- }
+class FusionAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
+ """Represents Fusion alert rule.
- 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
+ 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 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"},
- }
-
- def __init__(self, *, app_installation_id: Optional[str] = None, **kwargs):
- """
- :keyword app_installation_id: GitHub application installation id.
- :paramtype app_installation_id: str
- """
- super().__init__(**kwargs)
- self.app_installation_id = app_installation_id
-
-
-class GroupingConfiguration(_serialization.Model):
- """Grouping configuration property bag.
-
- All required parameters must be populated in order to send to Azure.
-
- :ivar enabled: Grouping enabled. 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 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 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 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 sub_techniques: The sub-techniques of the alert rule.
+ :vartype sub_techniques: list[str]
"""
_validation = {
- "enabled": {"required": True},
- "reopen_closed_incident": {"required": True},
- "lookback_duration": {"required": True},
- "matching_method": {"required": True},
+ '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},
+ 'sub_techniques': {'readonly': True},
}
_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]"},
+ "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]"},
+ "sub_techniques": {"key": "properties.subTechniques", "type": "[str]"},
}
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
- ):
+ 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: Any
+ ) -> None:
"""
- :keyword enabled: Grouping enabled. Required.
+ :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 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]
+ :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]
"""
- super().__init__(**kwargs)
+ 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.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
-
+ 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
+ self.sub_techniques = None
-class HostEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a host entity.
+class FusionAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
+ """Represents Fusion 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
@@ -9635,57 +10692,48 @@ class HostEntity(Entity): # pylint: disable=too-many-instance-attributes
: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 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 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 sub_techniques: The sub-techniques of the alert rule.
+ :vartype sub_techniques: list[str]
+ :ivar source_settings: All supported source signal configurations consumed in fusion detection.
+ :vartype source_settings: list[~azure.mgmt.securityinsight.models.FusionTemplateSourceSetting]
"""
_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},
+ '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 = {
@@ -9694,1846 +10742,1829 @@ class HostEntity(Entity): # pylint: disable=too-many-instance-attributes
"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"},
+ "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]"},
+ "sub_techniques": {"key": "properties.subTechniques", "type": "[str]"},
+ "source_settings": {"key": "properties.sourceSettings", "type": "[FusionTemplateSourceSetting]"},
}
- 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
- """
- super().__init__(**kwargs)
- 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
-
+ 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,
+ sub_techniques: Optional[List[str]] = None,
+ source_settings: Optional[List["_models.FusionTemplateSourceSetting"]] = 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 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 sub_techniques: The sub-techniques of the alert rule.
+ :paramtype sub_techniques: list[str]
+ :keyword source_settings: All supported source signal configurations consumed in fusion
+ detection.
+ :paramtype source_settings:
+ list[~azure.mgmt.securityinsight.models.FusionTemplateSourceSetting]
+ """
+ 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.sub_techniques = sub_techniques
+ self.source_settings = source_settings
-class HostEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Host entity property bag.
+class FusionScenarioExclusionPattern(_serialization.Model):
+ """Represents a Fusion scenario exclusion patterns in Fusion detection.
- 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 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 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
"""
_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},
+ 'exclusion_pattern': {'required': True},
+ 'date_added_in_utc': {'required': 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"},
+ "exclusion_pattern": {"key": "exclusionPattern", "type": "str"},
+ "date_added_in_utc": {"key": "dateAddedInUTC", "type": "str"},
}
- def __init__(self, *, os_family: Optional[Union[str, "_models.OSFamily"]] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ exclusion_pattern: str,
+ date_added_in_utc: str,
+ **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
+ :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
"""
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
-
-
-class HuntingBookmark(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a Hunting bookmark entity.
+ self.exclusion_pattern = exclusion_pattern
+ self.date_added_in_utc = date_added_in_utc
- Variables are only populated by the server, and will be ignored when sending a request.
+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.
+ 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 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.
- :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 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]
"""
_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},
+ 'enabled': {'required': True},
+ 'source_name': {'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"},
- "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"},
- "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"},
+ "enabled": {"key": "enabled", "type": "bool"},
+ "source_name": {"key": "sourceName", "type": "str"},
+ "source_sub_types": {"key": "sourceSubTypes", "type": "[FusionSourceSubTypeSetting]"},
}
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
- ):
+ enabled: bool,
+ source_name: str,
+ source_sub_types: Optional[List["_models.FusionSourceSubTypeSetting"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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]
"""
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.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.enabled = enabled
+ self.source_name = source_name
+ self.source_sub_types = source_sub_types
-class HuntingBookmarkProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Describes bookmark properties.
+class FusionSourceSubTypeSetting(_serialization.Model):
+ """Represents a supported source subtype configuration under a source signal in Fusion detection.
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 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.
- :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 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
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "display_name": {"required": True},
- "query": {"required": True},
+ 'enabled': {'required': True},
+ 'source_sub_type_name': {'required': True},
+ 'source_sub_type_display_name': {'readonly': True},
+ 'severity_filters': {'required': 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"},
- "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"},
+ "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"},
}
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
- ):
+ enabled: bool,
+ source_sub_type_name: str,
+ severity_filters: "_models.FusionSubTypeSeverityFilter",
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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
"""
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
-
+ self.enabled = enabled
+ self.source_sub_type_name = source_sub_type_name
+ self.source_sub_type_display_name = None
+ self.severity_filters = severity_filters
-class Incident(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
- """Incident.
+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.
- :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 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 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]
"""
_validation = {
- "id": {"readonly": True},
- "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},
- "additional_data": {"readonly": True},
- "related_analytic_rule_ids": {"readonly": True},
- "incident_url": {"readonly": True},
+ 'is_supported': {'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"},
- "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"},
+ "is_supported": {"key": "isSupported", "type": "bool"},
+ "filters": {"key": "filters", "type": "[FusionSubTypeSeverityFiltersItem]"},
}
- def __init__( # pylint: disable=too-many-locals
+ def __init__(
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
- ):
+ filters: Optional[List["_models.FusionSubTypeSeverityFiltersItem"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword filters: Individual Severity configuration settings for a given source subtype
+ consumed in Fusion detection.
+ :paramtype filters: list[~azure.mgmt.securityinsight.models.FusionSubTypeSeverityFiltersItem]
"""
- 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
-
+ super().__init__(**kwargs)
+ self.is_supported = None
+ self.filters = filters
-class IncidentAdditionalData(_serialization.Model):
- """Incident additional data property bag.
+class FusionSubTypeSeverityFiltersItem(_serialization.Model):
+ """Represents a Severity filter setting for a given source subtype consumed in Fusion detection.
- 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 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
+ :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
"""
_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},
+ 'severity': {'required': True},
+ 'enabled': {'required': 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"},
+ "severity": {"key": "severity", "type": "str"},
+ "enabled": {"key": "enabled", "type": "bool"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ *,
+ severity: Union[str, "_models.AlertSeverity"],
+ enabled: bool,
+ **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
+ """
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
-
+ self.severity = severity
+ self.enabled = enabled
-class IncidentAlertList(_serialization.Model):
- """List of incident alerts.
+class FusionTemplateSourceSetting(_serialization.Model):
+ """Represents a source signal consumed in Fusion detection.
- 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 incident alerts. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.SecurityAlert]
+ :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]
"""
_validation = {
- "value": {"required": True},
+ 'source_name': {'required': True},
}
_attribute_map = {
- "value": {"key": "value", "type": "[SecurityAlert]"},
+ "source_name": {"key": "sourceName", "type": "str"},
+ "source_sub_types": {"key": "sourceSubTypes", "type": "[FusionTemplateSourceSubType]"},
}
- def __init__(self, *, value: List["_models.SecurityAlert"], **kwargs):
+ def __init__(
+ self,
+ *,
+ source_name: str,
+ source_sub_types: Optional[List["_models.FusionTemplateSourceSubType"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of incident alerts. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.SecurityAlert]
+ :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]
"""
super().__init__(**kwargs)
- self.value = value
+ self.source_name = source_name
+ self.source_sub_types = source_sub_types
+class FusionTemplateSourceSubType(_serialization.Model):
+ """Represents a source subtype under a source signal consumed in Fusion detection.
-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 Azure.
+ All required parameters must be populated in order to send to server.
- :ivar value: Array of incident bookmarks. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.HuntingBookmark]
+ :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
"""
_validation = {
- "value": {"required": True},
+ 'source_sub_type_name': {'required': True},
+ 'source_sub_type_display_name': {'readonly': True},
+ 'severity_filter': {'required': True},
}
_attribute_map = {
- "value": {"key": "value", "type": "[HuntingBookmark]"},
+ "source_sub_type_name": {"key": "sourceSubTypeName", "type": "str"},
+ "source_sub_type_display_name": {"key": "sourceSubTypeDisplayName", "type": "str"},
+ "severity_filter": {"key": "severityFilter", "type": "FusionTemplateSubTypeSeverityFilter"},
}
- def __init__(self, *, value: List["_models.HuntingBookmark"], **kwargs):
+ def __init__(
+ self,
+ *,
+ source_sub_type_name: str,
+ severity_filter: "_models.FusionTemplateSubTypeSeverityFilter",
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of incident bookmarks. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.HuntingBookmark]
+ :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
"""
super().__init__(**kwargs)
- self.value = value
-
+ self.source_sub_type_name = source_sub_type_name
+ self.source_sub_type_display_name = None
+ self.severity_filter = severity_filter
-class IncidentComment(ResourceWithEtag):
- """Represents an incident comment.
+class FusionTemplateSubTypeSeverityFilter(_serialization.Model):
+ """Represents severity configurations available for a source subtype consumed in Fusion detection.
- 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 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
+ :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]
"""
_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},
+ 'is_supported': {'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"},
- "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"},
+ "is_supported": {"key": "isSupported", "type": "bool"},
+ "severity_filters": {"key": "severityFilters", "type": "[str]"},
}
- def __init__(self, *, etag: Optional[str] = None, message: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ is_supported: bool,
+ severity_filters: Optional[List[Union[str, "_models.AlertSeverity"]]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword etag: Etag of the azure resource.
- :paramtype etag: str
- :keyword message: The comment message.
- :paramtype message: str
+ :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__(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.
+ super().__init__(**kwargs)
+ self.is_supported = is_supported
+ self.severity_filters = severity_filters
- Variables are only populated by the server, and will be ignored when sending a request.
+class GCPAuthModel(CcpAuthConfig):
+ """Model for API authentication for all GCP kind connectors.
- 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: Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.IncidentComment]
- :ivar next_link:
- :vartype next_link: 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 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
"""
_validation = {
- "value": {"required": True},
- "next_link": {"readonly": True},
+ 'type': {'required': True},
+ 'service_account_email': {'required': True},
+ 'project_number': {'required': True},
+ 'workload_identity_provider_id': {'required': True},
}
_attribute_map = {
- "value": {"key": "value", "type": "[IncidentComment]"},
- "next_link": {"key": "nextLink", "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, *, value: List["_models.IncidentComment"], **kwargs):
+ def __init__(
+ self,
+ *,
+ service_account_email: str,
+ project_number: str,
+ workload_identity_provider_id: str,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.IncidentComment]
+ :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.value = value
- self.next_link = None
+ 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 GCPAuthProperties(_serialization.Model):
+ """Google Cloud Platform auth section properties.
-class IncidentConfiguration(_serialization.Model):
- """Incident Configuration 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 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
+ :ivar service_account_email: The service account that is used to access the GCP project.
+ Required.
+ :vartype service_account_email: str
+ :ivar project_number: The GCP project number. Required.
+ :vartype project_number: str
+ :ivar workload_identity_provider_id: The workload identity provider id that is used to gain
+ access to the GCP project. Required.
+ :vartype workload_identity_provider_id: str
"""
_validation = {
- "create_incident": {"required": True},
+ 'service_account_email': {'required': True},
+ 'project_number': {'required': True},
+ 'workload_identity_provider_id': {'required': True},
}
_attribute_map = {
- "create_incident": {"key": "createIncident", "type": "bool"},
- "grouping_configuration": {"key": "groupingConfiguration", "type": "GroupingConfiguration"},
+ "service_account_email": {"key": "serviceAccountEmail", "type": "str"},
+ "project_number": {"key": "projectNumber", "type": "str"},
+ "workload_identity_provider_id": {"key": "workloadIdentityProviderId", "type": "str"},
}
def __init__(
self,
*,
- create_incident: bool,
- grouping_configuration: Optional["_models.GroupingConfiguration"] = None,
- **kwargs
- ):
+ service_account_email: str,
+ project_number: str,
+ workload_identity_provider_id: str,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword create_incident: Create incidents from alerts triggered by this analytics rule.
+ :keyword service_account_email: The service account that is used to access the GCP project.
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
+ :paramtype service_account_email: str
+ :keyword project_number: The GCP project number. Required.
+ :paramtype project_number: str
+ :keyword workload_identity_provider_id: The workload identity provider id that is used to gain
+ access to the GCP project. Required.
+ :paramtype workload_identity_provider_id: str
"""
super().__init__(**kwargs)
- self.create_incident = create_incident
- self.grouping_configuration = grouping_configuration
+ self.service_account_email = service_account_email
+ self.project_number = project_number
+ self.workload_identity_provider_id = workload_identity_provider_id
+class GCPDataConnector(DataConnector):
+ """Represents Google Cloud Platform data connector.
-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]
+ 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. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", and "RestApiPoller".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.DataConnectorKind
+ :ivar connector_definition_name: The name of the connector definition that represents the UI
+ config.
+ :vartype connector_definition_name: str
+ :ivar auth: The auth section of the connector.
+ :vartype auth: ~azure.mgmt.securityinsight.models.GCPAuthProperties
+ :ivar request: The request section of the connector.
+ :vartype request: ~azure.mgmt.securityinsight.models.GCPRequestProperties
+ :ivar dcr_config: The configuration of the destination of the data.
+ :vartype dcr_config: ~azure.mgmt.securityinsight.models.DCRConfiguration
"""
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ }
+
_attribute_map = {
- "entities": {"key": "entities", "type": "[Entity]"},
- "meta_data": {"key": "metaData", "type": "[IncidentEntitiesResultsMetadata]"},
+ "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_definition_name": {"key": "properties.connectorDefinitionName", "type": "str"},
+ "auth": {"key": "properties.auth", "type": "GCPAuthProperties"},
+ "request": {"key": "properties.request", "type": "GCPRequestProperties"},
+ "dcr_config": {"key": "properties.dcrConfig", "type": "DCRConfiguration"},
}
def __init__(
self,
*,
- entities: Optional[List["_models.Entity"]] = None,
- meta_data: Optional[List["_models.IncidentEntitiesResultsMetadata"]] = None,
- **kwargs
- ):
+ etag: Optional[str] = None,
+ connector_definition_name: Optional[str] = None,
+ auth: Optional["_models.GCPAuthProperties"] = None,
+ request: Optional["_models.GCPRequestProperties"] = None,
+ dcr_config: Optional["_models.DCRConfiguration"] = 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]
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword connector_definition_name: The name of the connector definition that represents the UI
+ config.
+ :paramtype connector_definition_name: str
+ :keyword auth: The auth section of the connector.
+ :paramtype auth: ~azure.mgmt.securityinsight.models.GCPAuthProperties
+ :keyword request: The request section of the connector.
+ :paramtype request: ~azure.mgmt.securityinsight.models.GCPRequestProperties
+ :keyword dcr_config: The configuration of the destination of the data.
+ :paramtype dcr_config: ~azure.mgmt.securityinsight.models.DCRConfiguration
"""
- super().__init__(**kwargs)
- self.entities = entities
- self.meta_data = meta_data
-
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = 'GCP'
+ self.connector_definition_name = connector_definition_name
+ self.auth = auth
+ self.request = request
+ self.dcr_config = dcr_config
-class IncidentEntitiesResultsMetadata(_serialization.Model):
- """Information of a specific aggregation in the incident related entities result.
+class GCPRequestProperties(_serialization.Model):
+ """Google Cloud Platform request section 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 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
+ :ivar project_id: The GCP project id. Required.
+ :vartype project_id: str
+ :ivar subscription_names: The GCP pub/sub subscription names. Required.
+ :vartype subscription_names: list[str]
"""
_validation = {
- "entity_kind": {"required": True},
- "count": {"required": True},
+ 'project_id': {'required': True},
+ 'subscription_names': {'required': True},
}
_attribute_map = {
- "entity_kind": {"key": "entityKind", "type": "str"},
- "count": {"key": "count", "type": "int"},
+ "project_id": {"key": "projectId", "type": "str"},
+ "subscription_names": {"key": "subscriptionNames", "type": "[str]"},
}
- def __init__(self, *, entity_kind: Union[str, "_models.EntityKind"], count: int, **kwargs):
+ def __init__(
+ self,
+ *,
+ project_id: str,
+ subscription_names: List[str],
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword project_id: The GCP project id. Required.
+ :paramtype project_id: str
+ :keyword subscription_names: The GCP pub/sub subscription names. Required.
+ :paramtype subscription_names: list[str]
"""
super().__init__(**kwargs)
- self.entity_kind = entity_kind
- self.count = count
+ self.project_id = project_id
+ self.subscription_names = subscription_names
+class GenericBlobSbsAuthModel(CcpAuthConfig):
+ """Model for API authentication for working with service bus or storage account.
-class IncidentInfo(_serialization.Model):
- """Describes related incident information for the bookmark.
+ All required parameters must be populated in order to send to server.
- :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
+ :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 = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
- "incident_id": {"key": "incidentId", "type": "str"},
- "severity": {"key": "severity", "type": "str"},
- "title": {"key": "title", "type": "str"},
- "relation_name": {"key": "relationName", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "credentials_config": {"key": "credentialsConfig", "type": "{str}"},
+ "storage_account_credentials_config": {"key": "storageAccountCredentialsConfig", "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
- ):
+ credentials_config: Optional[Dict[str, str]] = None,
+ storage_account_credentials_config: Optional[Dict[str, 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
+ :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.incident_id = incident_id
- self.severity = severity
- self.title = title
- self.relation_name = relation_name
+ self.type: str = 'ServiceBus'
+ self.credentials_config = credentials_config
+ self.storage_account_credentials_config = storage_account_credentials_config
-
-class IncidentLabel(_serialization.Model):
- """Represents an incident label.
+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.
- 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
+ :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 latitude of the identified location, expressed as a floating point number
+ with range of - 90 to 90. Latitude and longitude are derived from the city or postal code.
+ :vartype latitude: float
+ :ivar longitude: The longitude of the identified location, expressed as a floating point number
+ with range of -180 to 180. Latitude and longitude are derived from the city or postal code.
+ :vartype longitude: float
+ :ivar state: State name.
+ :vartype state: str
"""
_validation = {
- "label_name": {"required": True},
- "label_type": {"readonly": True},
+ '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 = {
- "label_name": {"key": "labelName", "type": "str"},
- "label_type": {"key": "labelType", "type": "str"},
+ "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, *, label_name: str, **kwargs):
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
"""
- :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.
+ self.asn = None
+ self.city = None
+ self.country_code = None
+ self.country_name = None
+ self.latitude = None
+ self.longitude = None
+ self.state = None
- Variables are only populated by the server, and will be ignored when sending a request.
+class GetInsightsErrorKind(_serialization.Model):
+ """GetInsights Query Errors.
- 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: Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Incident]
- :ivar next_link: URL to fetch the next set of incidents.
- :vartype next_link: str
+ :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
"""
_validation = {
- "value": {"required": True},
- "next_link": {"readonly": True},
+ 'kind': {'required': True},
+ 'error_message': {'required': True},
}
_attribute_map = {
- "value": {"key": "value", "type": "[Incident]"},
- "next_link": {"key": "nextLink", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ "query_id": {"key": "queryId", "type": "str"},
+ "error_message": {"key": "errorMessage", "type": "str"},
}
- def __init__(self, *, value: List["_models.Incident"], **kwargs):
+ def __init__(
+ self,
+ *,
+ kind: Union[str, "_models.GetInsightsError"],
+ error_message: str,
+ query_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Incident]
+ :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
"""
super().__init__(**kwargs)
- self.value = value
- self.next_link = None
+ self.kind = kind
+ self.query_id = query_id
+ self.error_message = error_message
+class GetInsightsResultsMetadata(_serialization.Model):
+ """Get Insights result metadata.
-class IncidentOwnerInfo(_serialization.Model):
- """Information on the user an incident is assigned to.
+ All required parameters must be populated in order to send to server.
- :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
+ :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]
"""
+ _validation = {
+ 'total_count': {'required': True},
+ }
+
_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"},
+ "total_count": {"key": "totalCount", "type": "int"},
+ "errors": {"key": "errors", "type": "[GetInsightsErrorKind]"},
}
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
- ):
+ total_count: int,
+ errors: Optional[List["_models.GetInsightsErrorKind"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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.email = email
- self.assigned_to = assigned_to
- self.object_id = object_id
- self.user_principal_name = user_principal_name
- self.owner_type = owner_type
-
+ self.total_count = total_count
+ self.errors = errors
-class IncidentPropertiesAction(_serialization.Model):
- """IncidentPropertiesAction.
+class GetQueriesResponse(_serialization.Model):
+ """Retrieve queries for entity result operation response.
- :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]
+ :ivar value: The query result values.
+ :vartype value: list[~azure.mgmt.securityinsight.models.EntityQueryItem]
"""
_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]"},
+ "value": {"key": "value", "type": "[EntityQueryItem]"},
}
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
- ):
+ value: Optional[List["_models.EntityQueryItem"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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]
+ :keyword value: The query result values.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.EntityQueryItem]
"""
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.
+ self.value = value
- Variables are only populated by the server, and will be ignored when sending a request.
+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.
- 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 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
+ :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 = {
- "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},
+ '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"},
- "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"},
+ "installation_id": {"key": "installationId", "type": "str"},
}
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
- ):
+ installation_id: 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
- :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
+ :keyword installation_id: The GitHubApp auth installation id.
+ :paramtype installation_id: str
"""
- 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
-
+ super().__init__(**kwargs)
+ self.type: str = 'GitHub'
+ self.installation_id = installation_id
-class IncidentTaskList(_serialization.Model):
- """IncidentTaskList.
+class GitHubResourceInfo(_serialization.Model):
+ """Resources created in GitHub repository.
- :ivar value:
- :vartype value: list[~azure.mgmt.securityinsight.models.IncidentTask]
- :ivar next_link:
- :vartype next_link: str
+ :ivar app_installation_id: GitHub application installation id.
+ :vartype app_installation_id: str
"""
_attribute_map = {
- "value": {"key": "value", "type": "[IncidentTask]"},
- "next_link": {"key": "nextLink", "type": "str"},
+ "app_installation_id": {"key": "appInstallationId", "type": "str"},
}
def __init__(
- self, *, value: Optional[List["_models.IncidentTask"]] = None, next_link: Optional[str] = None, **kwargs
- ):
+ self,
+ *,
+ app_installation_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value:
- :paramtype value: list[~azure.mgmt.securityinsight.models.IncidentTask]
- :keyword next_link:
- :paramtype next_link: str
+ :keyword app_installation_id: GitHub application installation id.
+ :paramtype app_installation_id: str
"""
super().__init__(**kwargs)
- self.value = value
- self.next_link = next_link
-
-
-class InsightQueryItem(EntityQueryItem):
- """Represents Insight Query.
+ self.app_installation_id = app_installation_id
- 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 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
+ :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 = {
- "id": {"readonly": True},
- "kind": {"required": True},
+ 'metric_name': {'required': True},
+ 'legend': {'required': True},
+ 'base_query': {'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"},
+ "metric_name": {"key": "metricName", "type": "str"},
+ "legend": {"key": "legend", "type": "str"},
+ "base_query": {"key": "baseQuery", "type": "str"},
}
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
+ metric_name: str,
+ legend: str,
+ base_query: str,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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__(name=name, type=type, **kwargs)
- self.kind: str = "Insight"
- self.properties = properties
+ super().__init__(**kwargs)
+ self.metric_name = metric_name
+ self.legend = legend
+ self.base_query = base_query
+class GroupingConfiguration(_serialization.Model):
+ """Grouping configuration property bag.
-class InsightQueryItemProperties(EntityQueryItemProperties): # pylint: disable=too-many-instance-attributes
- """Represents Insight Query.
+ All required parameters must be populated in order to send to server.
- :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
+ :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 = {
- "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"},
+ "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,
*,
- 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
- ):
+ 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 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
+ :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__(
- 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
+ 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
+
+class HostEntity(Entity): # pylint: disable=too-many-instance-attributes
+ """Represents a host entity.
+ Variables are only populated by the server, and will be ignored when sending a request.
-class InsightQueryItemPropertiesAdditionalQuery(_serialization.Model):
- """The activity query definitions.
+ All required parameters must be populated in order to send to server.
- :ivar query: The insight query.
- :vartype query: str
- :ivar text: The insight text.
- :vartype text: 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", "SubmissionMail", and "Nic".
+ :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
"""
- _attribute_map = {
- "query": {"key": "query", "type": "str"},
- "text": {"key": "text", "type": "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},
}
- 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"},
+ "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"},
}
- def __init__(self, *, before_range: Optional[str] = None, after_range: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ os_family: Optional[Union[str, "_models.OSFamily"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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.before_range = before_range
- self.after_range = after_range
-
+ 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 InsightQueryItemPropertiesReferenceTimeRange(_serialization.Model):
- """The insight chart query.
+class HostEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
+ """Host entity property bag.
- :ivar before_range: Additional query time for looking back.
- :vartype before_range: str
- """
+ Variables are only populated by the server, and will be ignored when sending a request.
- _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]
+ :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 = {
- "columns_definitions": {
- "key": "columnsDefinitions",
- "type": "[InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem]",
- },
- "queries_definitions": {
- "key": "queriesDefinitions",
- "type": "[InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem]",
- },
+ "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,
*,
- columns_definitions: Optional[
- List["_models.InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem"]
- ] = None,
- queries_definitions: Optional[
- List["_models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem"]
- ] = None,
- **kwargs
- ):
+ os_family: Optional[Union[str, "_models.OSFamily"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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]
+ :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.columns_definitions = columns_definitions
- self.queries_definitions = queries_definitions
+ 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 Hunt(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
+ """Represents a Hunt in Azure Security Insights.
-class InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem(_serialization.Model):
- """InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :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
+ :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 display_name: The display name of the hunt.
+ :vartype display_name: str
+ :ivar description: The description of the hunt.
+ :vartype description: str
+ :ivar status: The status of the hunt. Known values are: "New", "Active", "Closed", "Backlog",
+ "Approved", "Succeeded", "Failed", and "InProgress".
+ :vartype status: str or ~azure.mgmt.securityinsight.models.Status
+ :ivar hypothesis_status: The hypothesis status of the hunt. Known values are: "Unknown",
+ "Invalidated", and "Validated".
+ :vartype hypothesis_status: str or ~azure.mgmt.securityinsight.models.HypothesisStatus
+ :ivar attack_tactics: A list of mitre attack tactics the hunt is associated with.
+ :vartype attack_tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
+ :ivar attack_techniques: A list of a mitre attack techniques the hunt is associated with.
+ :vartype attack_techniques: list[str]
+ :ivar labels: List of labels relevant to this hunt.
+ :vartype labels: list[str]
+ :ivar owner: Describes a user that the hunt is assigned to.
+ :vartype owner: ~azure.mgmt.securityinsight.models.HuntOwner
"""
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ }
+
_attribute_map = {
- "header": {"key": "header", "type": "str"},
- "output_type": {"key": "outputType", "type": "str"},
- "support_deep_link": {"key": "supportDeepLink", "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"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "description": {"key": "properties.description", "type": "str"},
+ "status": {"key": "properties.status", "type": "str"},
+ "hypothesis_status": {"key": "properties.hypothesisStatus", "type": "str"},
+ "attack_tactics": {"key": "properties.attackTactics", "type": "[str]"},
+ "attack_techniques": {"key": "properties.attackTechniques", "type": "[str]"},
+ "labels": {"key": "properties.labels", "type": "[str]"},
+ "owner": {"key": "properties.owner", "type": "HuntOwner"},
}
def __init__(
self,
*,
- header: Optional[str] = None,
- output_type: Optional[Union[str, "_models.OutputType"]] = None,
- support_deep_link: Optional[bool] = None,
- **kwargs
- ):
+ etag: Optional[str] = None,
+ display_name: Optional[str] = None,
+ description: Optional[str] = None,
+ status: Optional[Union[str, "_models.Status"]] = None,
+ hypothesis_status: Union[str, "_models.HypothesisStatus"] = "Unknown",
+ attack_tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
+ attack_techniques: Optional[List[str]] = None,
+ labels: Optional[List[str]] = None,
+ owner: Optional["_models.HuntOwner"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword display_name: The display name of the hunt.
+ :paramtype display_name: str
+ :keyword description: The description of the hunt.
+ :paramtype description: str
+ :keyword status: The status of the hunt. Known values are: "New", "Active", "Closed",
+ "Backlog", "Approved", "Succeeded", "Failed", and "InProgress".
+ :paramtype status: str or ~azure.mgmt.securityinsight.models.Status
+ :keyword hypothesis_status: The hypothesis status of the hunt. Known values are: "Unknown",
+ "Invalidated", and "Validated".
+ :paramtype hypothesis_status: str or ~azure.mgmt.securityinsight.models.HypothesisStatus
+ :keyword attack_tactics: A list of mitre attack tactics the hunt is associated with.
+ :paramtype attack_tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
+ :keyword attack_techniques: A list of a mitre attack techniques the hunt is associated with.
+ :paramtype attack_techniques: list[str]
+ :keyword labels: List of labels relevant to this hunt.
+ :paramtype labels: list[str]
+ :keyword owner: Describes a user that the hunt is assigned to.
+ :paramtype owner: ~azure.mgmt.securityinsight.models.HuntOwner
"""
- super().__init__(**kwargs)
- self.header = header
- self.output_type = output_type
- self.support_deep_link = support_deep_link
+ super().__init__(etag=etag, **kwargs)
+ self.display_name = display_name
+ self.description = description
+ self.status = status
+ self.hypothesis_status = hypothesis_status
+ self.attack_tactics = attack_tactics
+ self.attack_techniques = attack_techniques
+ self.labels = labels
+ self.owner = owner
+class HuntComment(ResourceWithEtag):
+ """Represents a Hunt Comment in Azure Security Insights.
-class InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem(_serialization.Model):
- """InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :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]
+ :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 message: The message for the comment.
+ :vartype message: str
"""
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ }
+
_attribute_map = {
- "filter": {"key": "filter", "type": "str"},
- "summarize": {"key": "summarize", "type": "str"},
- "project": {"key": "project", "type": "str"},
- "link_columns_definitions": {
- "key": "linkColumnsDefinitions",
- "type": "[InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem]",
- },
+ "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"},
}
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
- ):
+ etag: Optional[str] = None,
+ message: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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]
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword message: The message for the comment.
+ :paramtype message: str
"""
- super().__init__(**kwargs)
- self.filter = filter
- self.summarize = summarize
- self.project = project
- self.link_columns_definitions = link_columns_definitions
+ super().__init__(etag=etag, **kwargs)
+ self.message = message
+class HuntCommentList(_serialization.Model):
+ """List of all hunt comments.
-class InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem(_serialization.Model):
- """InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar projected_name: Insight Link Definition Projected Name.
- :vartype projected_name: str
- :ivar query: Insight Link Definition Query.
- :vartype query: str
+ All required parameters must be populated in order to send to server.
+
+ :ivar next_link: URL to fetch the next set of hunt comments.
+ :vartype next_link: str
+ :ivar value: Array of hunt comments. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.HuntComment]
"""
- _attribute_map = {
- "projected_name": {"key": "projectedName", "type": "str"},
- "query": {"key": "Query", "type": "str"},
+ _validation = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
- 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]]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[HuntComment]"},
}
def __init__(
self,
*,
- columns: Optional[List["_models.InsightsTableResultColumnsItem"]] = None,
- rows: Optional[List[List[str]]] = None,
- **kwargs
- ):
+ value: List["_models.HuntComment"],
+ **kwargs: Any
+ ) -> None:
"""
- :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]]
+ :keyword value: Array of hunt comments. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.HuntComment]
"""
super().__init__(**kwargs)
- self.columns = columns
- self.rows = rows
+ self.next_link = None
+ self.value = value
+class HuntingBookmark(Entity): # pylint: disable=too-many-instance-attributes
+ """Represents a Hunting bookmark entity.
-class InsightsTableResultColumnsItem(_serialization.Model):
- """InsightsTableResultColumnsItem.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar type: the type of the colum.
- :vartype type: str
- :ivar name: the name of the colum.
+ 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", "SubmissionMail", and "Nic".
+ :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.
+ :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 = {
+ '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 = {
- "type": {"key": "type", "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"},
+ "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"},
+ "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, *, type: Optional[str] = None, name: Optional[str] = None, **kwargs):
+ 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: Any
+ ) -> None:
"""
- :keyword type: the type of the colum.
- :paramtype type: str
- :keyword name: the name of the colum.
- :paramtype name: str
+ :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
"""
super().__init__(**kwargs)
- self.type = type
- self.name = name
+ 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.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): # pylint: disable=too-many-instance-attributes
+ """Describes bookmark properties.
-class Instructions(_serialization.Model):
- """Instructions section of a 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 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
+ :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.
+ :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 = {
- "actions_to_be_performed": {"required": True},
- "recommendation_importance": {"required": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'display_name': {'required': True},
+ 'query': {'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"},
+ "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"},
+ "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,
*,
- actions_to_be_performed: str,
- recommendation_importance: str,
- how_to_perform_action_details: 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 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
+ :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
"""
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
+ 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 HuntList(_serialization.Model):
+ """List all the hunts.
-class InstructionStepsInstructionsItem(ConnectorInstructionModelBase):
- """InstructionStepsInstructionsItem.
+ 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 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 next_link: URL to fetch the next set of hunts.
+ :vartype next_link: str
+ :ivar value: Array of hunts. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.Hunt]
"""
_validation = {
- "type": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
- "parameters": {"key": "parameters", "type": "object"},
- "type": {"key": "type", "type": "str"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Hunt]"},
}
- def __init__(self, *, type: Union[str, "_models.SettingType"], parameters: Optional[JSON] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.Hunt"],
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword value: Array of hunts. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Hunt]
"""
- super().__init__(parameters=parameters, type=type, **kwargs)
-
-
-class IoTCheckRequirements(DataConnectorsCheckRequirements):
- """Represents IoT requirements check request.
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
- All required parameters must be populated in order to send to Azure.
+class HuntOwner(_serialization.Model):
+ """Describes a user that the hunt is assigned to.
- :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 email: The email of the user the hunt is assigned to.
+ :vartype email: str
+ :ivar assigned_to: The name of the user the hunt is assigned to.
+ :vartype assigned_to: str
+ :ivar object_id: The object id of the user the hunt is assigned to.
+ :vartype object_id: str
+ :ivar user_principal_name: The user principal name of the user the hunt is assigned to.
+ :vartype user_principal_name: str
+ :ivar owner_type: The type of the owner the hunt is assigned to. Known values are: "Unknown",
+ "User", and "Group".
+ :vartype owner_type: str or ~azure.mgmt.securityinsight.models.OwnerType
"""
- _validation = {
- "kind": {"required": True},
- }
-
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "subscription_id": {"key": "properties.subscriptionId", "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, *, subscription_id: Optional[str] = None, **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 subscription_id: The subscription id to connect to, and get the data from.
- :paramtype subscription_id: str
+ :keyword email: The email of the user the hunt is assigned to.
+ :paramtype email: str
+ :keyword assigned_to: The name of the user the hunt is assigned to.
+ :paramtype assigned_to: str
+ :keyword object_id: The object id of the user the hunt is assigned to.
+ :paramtype object_id: str
+ :keyword user_principal_name: The user principal name of the user the hunt is assigned to.
+ :paramtype user_principal_name: str
+ :keyword owner_type: The type of the owner the hunt is assigned to. Known values are:
+ "Unknown", "User", and "Group".
+ :paramtype owner_type: str or ~azure.mgmt.securityinsight.models.OwnerType
"""
super().__init__(**kwargs)
- self.kind: str = "IOT"
- self.subscription_id = subscription_id
-
+ 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 IoTDataConnector(DataConnector):
- """Represents IoT data connector.
+class HuntRelation(ResourceWithEtag):
+ """Represents a Hunt Relation 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
@@ -11545,26 +12576,26 @@ class IoTDataConnector(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 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
+ :ivar related_resource_id: The 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 relation_type: The type of the hunt relation.
+ :vartype relation_type: str
+ :ivar related_resource_kind: The resource that the relation is related to.
+ :vartype related_resource_kind: str
+ :ivar labels: List of labels relevant to this hunt.
+ :vartype labels: list[str]
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'related_resource_name': {'readonly': True},
+ 'relation_type': {'readonly': True},
+ 'related_resource_kind': {'readonly': True},
}
_attribute_map = {
@@ -11573,73 +12604,82 @@ class IoTDataConnector(DataConnector):
"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"},
+ "related_resource_id": {"key": "properties.relatedResourceId", "type": "str"},
+ "related_resource_name": {"key": "properties.relatedResourceName", "type": "str"},
+ "relation_type": {"key": "properties.relationType", "type": "str"},
+ "related_resource_kind": {"key": "properties.relatedResourceKind", "type": "str"},
+ "labels": {"key": "properties.labels", "type": "[str]"},
}
def __init__(
self,
*,
etag: Optional[str] = None,
- data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- subscription_id: Optional[str] = None,
- **kwargs
- ):
+ related_resource_id: Optional[str] = None,
+ labels: Optional[List[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
+ :keyword related_resource_id: The id of the related resource.
+ :paramtype related_resource_id: str
+ :keyword labels: List of labels relevant to this hunt.
+ :paramtype labels: list[str]
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "IOT"
- self.data_types = data_types
- self.subscription_id = subscription_id
+ self.related_resource_id = related_resource_id
+ self.related_resource_name = None
+ self.relation_type = None
+ self.related_resource_kind = None
+ self.labels = labels
+class HuntRelationList(_serialization.Model):
+ """List of all the hunt relations.
-class IoTDataConnectorProperties(DataConnectorWithAlertsProperties):
- """IoT data connector properties.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :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
+ All required parameters must be populated in order to send to server.
+
+ :ivar next_link: URL to fetch the next set of hunt relations.
+ :vartype next_link: str
+ :ivar value: Array of hunt relations. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.HuntRelation]
"""
+ _validation = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
+ }
+
_attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "subscription_id": {"key": "subscriptionId", "type": "str"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[HuntRelation]"},
}
def __init__(
self,
*,
- data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- subscription_id: Optional[str] = None,
- **kwargs
- ):
+ value: List["_models.HuntRelation"],
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword value: Array of hunt relations. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.HuntRelation]
"""
- super().__init__(data_types=data_types, **kwargs)
- self.subscription_id = subscription_id
-
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
-class IoTDeviceEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents an IoT device entity.
+class Identity(TIObject): # pylint: disable=too-many-instance-attributes
+ """Represents an identity 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.
+ 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
@@ -11649,111 +12689,52 @@ class IoTDeviceEntity(Entity): # pylint: disable=too-many-instance-attributes
: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.
+ :ivar kind: The kind of the TI object. Required. Known values are: "AttackPattern", "Identity",
+ "Indicator", "Relationship", and "ThreatActor".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.TIObjectKind
+ :ivar data: The core STIX object that this TI object represents.
+ :vartype data: dict[str, any]
+ :ivar created_by: The UserInfo of the user/entity which originally created this TI object.
+ :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar source: The source name for this TI object.
: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},
+ :ivar first_ingested_time_utc: The timestamp for the first time this object was ingested.
+ :vartype first_ingested_time_utc: ~datetime.datetime
+ :ivar last_ingested_time_utc: The timestamp for the last time this object was ingested.
+ :vartype last_ingested_time_utc: ~datetime.datetime
+ :ivar ingestion_rules_version: The ID of the rules version that was active when this TI object
+ was last ingested.
+ :vartype ingestion_rules_version: str
+ :ivar last_update_method: The name of the method/application that initiated the last write to
+ this TI object.
+ :vartype last_update_method: str
+ :ivar last_modified_by: The UserInfo of the user/entity which last modified this TI object.
+ :vartype last_modified_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar last_updated_date_time_utc: The timestamp for the last time this TI object was updated.
+ :vartype last_updated_date_time_utc: ~datetime.datetime
+ :ivar relationship_hints: A dictionary used to help follow relationships from this object to
+ other STIX objects. The keys are field names from the STIX object (in the 'data' field), and
+ the values are lists of sources that can be prepended to the object ID in order to efficiently
+ locate the target TI object.
+ :vartype relationship_hints: list[~azure.mgmt.securityinsight.models.RelationshipHint]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'data': {'readonly': True},
+ 'created_by': {'readonly': True},
+ 'source': {'readonly': True},
+ 'first_ingested_time_utc': {'readonly': True},
+ 'last_ingested_time_utc': {'readonly': True},
+ 'ingestion_rules_version': {'readonly': True},
+ 'last_update_method': {'readonly': True},
+ 'last_modified_by': {'readonly': True},
+ 'last_updated_date_time_utc': {'readonly': True},
+ 'relationship_hints': {'readonly': True},
}
_attribute_map = {
@@ -11762,263 +12743,34 @@ class IoTDeviceEntity(Entity): # pylint: disable=too-many-instance-attributes
"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"},
+ "data": {"key": "properties.data", "type": "{object}"},
+ "created_by": {"key": "properties.createdBy", "type": "UserInfo"},
"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"},
+ "first_ingested_time_utc": {"key": "properties.firstIngestedTimeUtc", "type": "iso-8601"},
+ "last_ingested_time_utc": {"key": "properties.lastIngestedTimeUtc", "type": "iso-8601"},
+ "ingestion_rules_version": {"key": "properties.ingestionRulesVersion", "type": "str"},
+ "last_update_method": {"key": "properties.lastUpdateMethod", "type": "str"},
+ "last_modified_by": {"key": "properties.lastModifiedBy", "type": "UserInfo"},
+ "last_updated_date_time_utc": {"key": "properties.lastUpdatedDateTimeUtc", "type": "iso-8601"},
+ "relationship_hints": {"key": "properties.relationshipHints", "type": "[RelationshipHint]"},
}
- def __init__( # pylint: disable=too-many-locals
- self, *, importance: Optional[Union[str, "_models.DeviceImportance"]] = None, **kwargs
- ):
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ self.kind: str = 'Identity'
-
-class IoTDeviceEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """IoTDevice entity property bag.
+class Incident(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
+ """Incident.
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}.
+ :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
@@ -12028,36 +12780,69 @@ class IpEntity(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 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]
+ :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
"""
_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},
+ 'id': {'readonly': True},
+ '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},
+ 'additional_data': {'readonly': True},
+ 'related_analytic_rule_ids': {'readonly': True},
+ 'incident_url': {'readonly': True},
+ 'provider_name': {'readonly': True},
+ 'provider_incident_id': {'readonly': True},
}
_attribute_map = {
@@ -12065,206 +12850,226 @@ class IpEntity(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"},
- "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]"},
+ "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"},
}
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.address = None
- self.location = None
- self.threat_intelligence = None
-
+ 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,
+ team_information: Optional["_models.TeamInformation"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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 team_information: Describes a team for the incident.
+ :paramtype team_information: ~azure.mgmt.securityinsight.models.TeamInformation
+ """
+ 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 = None
+ self.provider_incident_id = None
+ self.team_information = team_information
-class MailboxEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a mailbox entity.
+class IncidentAdditionalData(_serialization.Model):
+ """Incident additional data 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 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
+ :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 = {
- "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},
+ '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 = {
- "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"},
+ "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):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
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
-
+ 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 MailboxEntityProperties(EntityCommonProperties):
- """Mailbox entity property bag.
+class IncidentAlertList(_serialization.Model):
+ """List of incident alerts.
- 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 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
+ :ivar value: Array of incident alerts. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.SecurityAlert]
"""
_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},
+ 'value': {'required': 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"},
+ "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.mailbox_primary_address = None
- self.display_name = None
- self.upn = None
- self.external_directory_object_id = None
+ self.value = value
+class IncidentBookmarkList(_serialization.Model):
+ """List of incident bookmarks.
-class MailClusterEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a mail cluster entity.
+ 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.
+ :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: Any
+ ) -> None:
+ """
+ :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.
- 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: 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
@@ -12274,73 +13079,26 @@ class MailClusterEntity(Entity): # pylint: disable=too-many-instance-attributes
: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
+ :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},
- "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},
+ '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 = {
@@ -12348,785 +13106,448 @@ class MailClusterEntity(Entity): # pylint: disable=too-many-instance-attributes
"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"},
+ "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, **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
-
+ 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.message = message
+ self.created_time_utc = None
+ self.last_modified_time_utc = None
+ self.author = None
-class MailClusterEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Mail cluster entity property bag.
+class IncidentCommentList(_serialization.Model):
+ """IncidentCommentList.
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
+ All required parameters must be populated in order to send to server.
+
+ :ivar value: Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.IncidentComment]
+ :ivar next_link:
+ :vartype next_link: 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},
+ 'value': {'required': True},
+ 'next_link': {'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"},
+ "value": {"key": "value", "type": "[IncidentComment]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ *,
+ value: List["_models.IncidentComment"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.IncidentComment]
+ """
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.
+ self.value = value
+ self.next_link = None
- Variables are only populated by the server, and will be ignored when sending a request.
+class IncidentConfiguration(_serialization.Model):
+ """Incident Configuration 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 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
+ :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},
- "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},
+ '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"},
- "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"},
+ "create_incident": {"key": "createIncident", "type": "bool"},
+ "grouping_configuration": {"key": "groupingConfiguration", "type": "GroupingConfiguration"},
}
- def __init__( # pylint: disable=too-many-locals
+ def __init__(
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
- ):
+ create_incident: bool,
+ grouping_configuration: Optional["_models.GroupingConfiguration"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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.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
+ self.create_incident = create_incident
+ self.grouping_configuration = grouping_configuration
+class IncidentEntitiesResponse(_serialization.Model):
+ """The incident related entities response.
-class MailMessageEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Mail message entity property bag.
+ :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]
+ """
- Variables are only populated by the server, and will be ignored when sending a request.
+ _attribute_map = {
+ "entities": {"key": "entities", "type": "[Entity]"},
+ "meta_data": {"key": "metaData", "type": "[IncidentEntitiesResultsMetadata]"},
+ }
- :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
+ 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
+
+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 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.EntityKindEnum
+ :ivar count: Total number of aggregations of the given kind in the incident related entities
+ result. Required.
+ :vartype count: int
"""
_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},
+ 'entity_kind': {'required': True},
+ 'count': {'required': 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"},
+ "entity_kind": {"key": "entityKind", "type": "str"},
+ "count": {"key": "count", "type": "int"},
}
- def __init__( # pylint: disable=too-many-locals
+ def __init__(
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
- ):
+ entity_kind: Union[str, "_models.EntityKindEnum"],
+ count: int,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :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.EntityKindEnum
+ :keyword count: Total number of aggregations of the given kind in the incident related entities
+ result. Required.
+ :paramtype count: int
"""
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.
+ self.entity_kind = entity_kind
+ self.count = count
- All required parameters must be populated in order to send to Azure.
+class IncidentInfo(_serialization.Model):
+ """Describes related incident information for the bookmark.
- :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]
+ :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 = {
- "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]"},
+ "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, **kwargs):
- """ """
+ 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: 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.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
-
+ self.incident_id = incident_id
+ self.severity = severity
+ self.title = title
+ self.relation_name = relation_name
-class MalwareEntityProperties(EntityCommonProperties):
- """Malware entity property bag.
+class IncidentLabel(_serialization.Model):
+ """Represents an incident label.
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 server.
- 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
+ :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 = {
- "logic_apps_resource_id": {"required": True},
+ 'label_name': {'required': True},
+ 'label_type': {'readonly': True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "logic_apps_resource_id": {"key": "logicAppsResourceId", "type": "str"},
+ "label_name": {"key": "labelName", "type": "str"},
+ "label_type": {"key": "labelType", "type": "str"},
}
- def __init__(self, *, logic_apps_resource_id: str, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ label_name: str,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id:
- :paramtype tenant_id: str
- :keyword logic_apps_resource_id: Required.
- :paramtype logic_apps_resource_id: str
+ :keyword label_name: The name of the label. Required.
+ :paramtype label_name: str
"""
super().__init__(**kwargs)
- self.tenant_id = tenant_id
- self.logic_apps_resource_id = logic_apps_resource_id
+ self.label_name = label_name
+ self.label_type = None
+class IncidentList(_serialization.Model):
+ """List all the incidents.
-class MCASCheckRequirements(DataConnectorsCheckRequirements):
- """Represents MCAS (Microsoft Cloud App Security) requirements check request.
+ 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".
- :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: 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 = {
- "kind": {"required": True},
+ 'value': {'required': True},
+ 'next_link': {'readonly': True},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "value": {"key": "value", "type": "[Incident]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.Incident"],
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
+ :keyword value: Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Incident]
"""
super().__init__(**kwargs)
- self.kind: str = "MicrosoftCloudAppSecurity"
- self.tenant_id = tenant_id
-
-
-class MCASCheckRequirementsProperties(DataConnectorTenantId):
- """MCAS (Microsoft Cloud App Security) requirements check properties.
+ self.value = value
+ self.next_link = None
- 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 tenant_id: The tenant id to connect to, and get the data from. Required.
- :vartype tenant_id: 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 = {
- "tenant_id": {"required": True},
- }
-
_attribute_map = {
- "tenant_id": {"key": "tenantId", "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, *, tenant_id: 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 tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: 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__(tenant_id=tenant_id, **kwargs)
+ 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.
-class MCASDataConnector(DataConnector):
- """Represents MCAS (Microsoft Cloud App Security) data connector.
+ :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: Any
+ ) -> None:
+ """
+ :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.
+ 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
@@ -13138,26 +13559,31 @@ class MCASDataConnector(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.MCASDataConnectorDataTypes
+ :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},
- "kind": {"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 = {
@@ -13166,519 +13592,858 @@ class MCASDataConnector(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": "MCASDataConnectorDataTypes"},
+ "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,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.MCASDataConnectorDataTypes"] = None,
- **kwargs
- ):
+ description: Optional[str] = None,
+ created_by: Optional["_models.ClientInfo"] = None,
+ last_modified_by: Optional["_models.ClientInfo"] = 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.MCASDataConnectorDataTypes
+ :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.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.
+ 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
- All required parameters must be populated in order to send to Azure.
+class IncidentTaskList(_serialization.Model):
+ """IncidentTaskList.
- :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
+ :ivar value:
+ :vartype value: list[~azure.mgmt.securityinsight.models.IncidentTask]
+ :ivar next_link:
+ :vartype next_link: str
"""
- _validation = {
- "alerts": {"required": True},
- }
-
_attribute_map = {
- "alerts": {"key": "alerts", "type": "DataConnectorDataTypeCommon"},
- "discovery_logs": {"key": "discoveryLogs", "type": "DataConnectorDataTypeCommon"},
+ "value": {"key": "value", "type": "[IncidentTask]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self,
*,
- alerts: "_models.DataConnectorDataTypeCommon",
- discovery_logs: Optional["_models.DataConnectorDataTypeCommon"] = None,
- **kwargs
- ):
+ value: Optional[List["_models.IncidentTask"]] = None,
+ next_link: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword value:
+ :paramtype value: list[~azure.mgmt.securityinsight.models.IncidentTask]
+ :keyword next_link:
+ :paramtype next_link: str
"""
- super().__init__(alerts=alerts, **kwargs)
- self.discovery_logs = discovery_logs
-
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
-class MCASDataConnectorProperties(DataConnectorTenantId):
- """MCAS (Microsoft Cloud App Security) data connector properties.
+class Indicator(TIObject): # pylint: disable=too-many-instance-attributes
+ """Represents an indicator 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.MCASDataConnectorDataTypes
- """
+ All required parameters must be populated in order to send to server.
- _validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
+ :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 TI object. Required. Known values are: "AttackPattern", "Identity",
+ "Indicator", "Relationship", and "ThreatActor".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.TIObjectKind
+ :ivar data: The core STIX object that this TI object represents.
+ :vartype data: dict[str, any]
+ :ivar created_by: The UserInfo of the user/entity which originally created this TI object.
+ :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar source: The source name for this TI object.
+ :vartype source: str
+ :ivar first_ingested_time_utc: The timestamp for the first time this object was ingested.
+ :vartype first_ingested_time_utc: ~datetime.datetime
+ :ivar last_ingested_time_utc: The timestamp for the last time this object was ingested.
+ :vartype last_ingested_time_utc: ~datetime.datetime
+ :ivar ingestion_rules_version: The ID of the rules version that was active when this TI object
+ was last ingested.
+ :vartype ingestion_rules_version: str
+ :ivar last_update_method: The name of the method/application that initiated the last write to
+ this TI object.
+ :vartype last_update_method: str
+ :ivar last_modified_by: The UserInfo of the user/entity which last modified this TI object.
+ :vartype last_modified_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar last_updated_date_time_utc: The timestamp for the last time this TI object was updated.
+ :vartype last_updated_date_time_utc: ~datetime.datetime
+ :ivar relationship_hints: A dictionary used to help follow relationships from this object to
+ other STIX objects. The keys are field names from the STIX object (in the 'data' field), and
+ the values are lists of sources that can be prepended to the object ID in order to efficiently
+ locate the target TI object.
+ :vartype relationship_hints: list[~azure.mgmt.securityinsight.models.RelationshipHint]
+ :ivar observables: The observables of this indicator.
+ :vartype observables: list[~azure.mgmt.securityinsight.models.IndicatorObservablesItem]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'data': {'readonly': True},
+ 'created_by': {'readonly': True},
+ 'source': {'readonly': True},
+ 'first_ingested_time_utc': {'readonly': True},
+ 'last_ingested_time_utc': {'readonly': True},
+ 'ingestion_rules_version': {'readonly': True},
+ 'last_update_method': {'readonly': True},
+ 'last_modified_by': {'readonly': True},
+ 'last_updated_date_time_utc': {'readonly': True},
+ 'relationship_hints': {'readonly': True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "MCASDataConnectorDataTypes"},
+ "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"},
+ "data": {"key": "properties.data", "type": "{object}"},
+ "created_by": {"key": "properties.createdBy", "type": "UserInfo"},
+ "source": {"key": "properties.source", "type": "str"},
+ "first_ingested_time_utc": {"key": "properties.firstIngestedTimeUtc", "type": "iso-8601"},
+ "last_ingested_time_utc": {"key": "properties.lastIngestedTimeUtc", "type": "iso-8601"},
+ "ingestion_rules_version": {"key": "properties.ingestionRulesVersion", "type": "str"},
+ "last_update_method": {"key": "properties.lastUpdateMethod", "type": "str"},
+ "last_modified_by": {"key": "properties.lastModifiedBy", "type": "UserInfo"},
+ "last_updated_date_time_utc": {"key": "properties.lastUpdatedDateTimeUtc", "type": "iso-8601"},
+ "relationship_hints": {"key": "properties.relationshipHints", "type": "[RelationshipHint]"},
+ "observables": {"key": "observables", "type": "[IndicatorObservablesItem]"},
}
- def __init__(self, *, tenant_id: str, data_types: "_models.MCASDataConnectorDataTypes", **kwargs):
+ def __init__(
+ self,
+ *,
+ observables: Optional[List["_models.IndicatorObservablesItem"]] = 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.MCASDataConnectorDataTypes
+ :keyword observables: The observables of this indicator.
+ :paramtype observables: list[~azure.mgmt.securityinsight.models.IndicatorObservablesItem]
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
-
+ super().__init__(**kwargs)
+ self.kind: str = 'Indicator'
+ self.observables = observables
-class MDATPCheckRequirements(DataConnectorsCheckRequirements):
- """Represents MDATP (Microsoft Defender Advanced Threat Protection) requirements check request.
+class IndicatorObservablesItem(_serialization.Model):
+ """An observable of this indicator.
- 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},
- }
+ :ivar type: The type of the observable of this indicator.
+ :vartype type: str
+ :ivar value: The value of the observable of this indicator.
+ :vartype value: str
+ """
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "value": {"key": "value", "type": "str"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ 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 type: The type of the observable of this indicator.
+ :paramtype type: str
+ :keyword value: The value of the observable of this indicator.
+ :paramtype value: 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)
-
+ self.type = type
+ self.value = value
-class MDATPDataConnector(DataConnector):
- """Represents MDATP (Microsoft Defender Advanced Threat Protection) data connector.
+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.
+ 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: Query Template ARM ID.
:vartype id: str
- :ivar name: The name of the resource.
+ :ivar name: Query Template ARM Name.
:vartype name: str
- :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
- "Microsoft.Storage/storageAccounts".
+ :ivar type: ARM Type.
: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
+ :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},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'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"},
+ "properties": {"key": "properties", "type": "InsightQueryItemProperties"},
}
def __init__(
self,
*,
- etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None,
- **kwargs
- ):
+ name: Optional[str] = None,
+ type: Optional[str] = None,
+ properties: Optional["_models.InsightQueryItemProperties"] = 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 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__(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.
+ super().__init__(name=name, type=type, **kwargs)
+ self.kind: str = 'Insight'
+ self.properties = properties
- All required parameters must be populated in order to send to Azure.
+class InsightQueryItemProperties(EntityQueryItemProperties): # pylint: disable=too-many-instance-attributes
+ """Represents Insight Query.
- :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
+ :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
"""
- _validation = {
- "tenant_id": {"required": True},
- }
-
_attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "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, *, tenant_id: str, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs
- ):
+ 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: 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.
- :paramtype tenant_id: str
+ :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__(tenant_id=tenant_id, data_types=data_types, **kwargs)
- self.data_types = data_types
- self.tenant_id = tenant_id
-
+ 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 MetadataAuthor(_serialization.Model):
- """Publisher or creator of the content item.
+class InsightQueryItemPropertiesAdditionalQuery(_serialization.Model): # pylint: disable=name-too-long
+ """The activity query definitions.
- :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
+ :ivar query: The insight query.
+ :vartype query: str
+ :ivar text: The insight text.
+ :vartype text: str
"""
_attribute_map = {
- "name": {"key": "name", "type": "str"},
- "email": {"key": "email", "type": "str"},
- "link": {"key": "link", "type": "str"},
+ "query": {"key": "query", "type": "str"},
+ "text": {"key": "text", "type": "str"},
}
def __init__(
- self, *, name: Optional[str] = None, email: Optional[str] = None, link: Optional[str] = None, **kwargs
- ):
+ self,
+ *,
+ query: Optional[str] = None,
+ text: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword query: The insight query.
+ :paramtype query: str
+ :keyword text: The insight text.
+ :paramtype text: str
"""
super().__init__(**kwargs)
- self.name = name
- self.email = email
- self.link = link
-
+ self.query = query
+ self.text = text
-class MetadataCategories(_serialization.Model):
- """ies for the solution content item.
+class InsightQueryItemPropertiesDefaultTimeRange(_serialization.Model): # pylint: disable=name-too-long
+ """The insight chart query.
- :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]
+ :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 = {
- "domains": {"key": "domains", "type": "[str]"},
- "verticals": {"key": "verticals", "type": "[str]"},
+ "before_range": {"key": "beforeRange", "type": "str"},
+ "after_range": {"key": "afterRange", "type": "str"},
}
- def __init__(self, *, domains: Optional[List[str]] = None, verticals: Optional[List[str]] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ before_range: Optional[str] = None,
+ after_range: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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]
+ :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.domains = domains
- self.verticals = verticals
+ self.before_range = before_range
+ self.after_range = after_range
+class InsightQueryItemPropertiesReferenceTimeRange(_serialization.Model): # pylint: disable=name-too-long
+ """The insight chart query.
-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 before_range: Additional query time for looking back.
+ :vartype before_range: 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", 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 = {
+ "before_range": {"key": "beforeRange", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ before_range: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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 = {
- "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]"},
+ "columns_definitions": {"key": "columnsDefinitions", "type": "[InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem]"},
+ "queries_definitions": {"key": "queriesDefinitions", "type": "[InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem]"},
}
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
- ):
+ columns_definitions: Optional[List["_models.InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem"]] = None,
+ queries_definitions: Optional[List["_models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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]
+ :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.content_id = content_id
- self.kind = kind
- self.version = version
- self.name = name
- self.operator = operator
- self.criteria = criteria
+ self.columns_definitions = columns_definitions
+ self.queries_definitions = queries_definitions
+
+class InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem(_serialization.Model): # pylint: disable=name-too-long
+ """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
+ """
-class MetadataList(_serialization.Model):
- """List of all the metadata.
+ _attribute_map = {
+ "header": {"key": "header", "type": "str"},
+ "output_type": {"key": "outputType", "type": "str"},
+ "support_deep_link": {"key": "supportDeepLink", "type": "bool"},
+ }
- Variables are only populated by the server, and will be ignored when sending a request.
+ def __init__(
+ self,
+ *,
+ header: Optional[str] = None,
+ output_type: Optional[Union[str, "_models.OutputType"]] = None,
+ support_deep_link: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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
- All required parameters must be populated in order to send to Azure.
+class InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem(_serialization.Model): # pylint: disable=name-too-long
+ """InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.
- :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
+ :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]
"""
- _validation = {
- "value": {"required": True},
- "next_link": {"readonly": True},
+ _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: Any
+ ) -> None:
+ """
+ :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] # pylint: disable=line-too-long
+ """
+ super().__init__(**kwargs)
+ self.filter = filter
+ self.summarize = summarize
+ self.project = project
+ self.link_columns_definitions = link_columns_definitions
+
+class InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem(_serialization.Model): # pylint: disable=name-too-long
+ """InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.
+
+ :ivar projected_name: Insight Link Definition Projected Name.
+ :vartype projected_name: str
+ :ivar query: Insight Link Definition Query.
+ :vartype query: str
+ """
+
_attribute_map = {
- "value": {"key": "value", "type": "[MetadataModel]"},
- "next_link": {"key": "nextLink", "type": "str"},
+ "projected_name": {"key": "projectedName", "type": "str"},
+ "query": {"key": "Query", "type": "str"},
}
- def __init__(self, *, value: List["_models.MetadataModel"], **kwargs):
+ def __init__(
+ self,
+ *,
+ projected_name: Optional[str] = None,
+ query: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of metadata. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.MetadataModel]
+ :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.value = value
- self.next_link = None
+ self.projected_name = projected_name
+ self.query = query
+class InsightsTableResult(_serialization.Model):
+ """Query results for table insights query.
-class MetadataModel(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
- """Metadata resource definition.
+ :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]]
+ """
- Variables are only populated by the server, and will be ignored when sending a request.
+ _attribute_map = {
+ "columns": {"key": "columns", "type": "[InsightsTableResultColumnsItem]"},
+ "rows": {"key": "rows", "type": "[[str]]"},
+ }
- :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]
+ def __init__(
+ self,
+ *,
+ columns: Optional[List["_models.InsightsTableResultColumnsItem"]] = None,
+ rows: Optional[List[List[str]]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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: Any
+ ) -> None:
+ """
+ :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 InstructionStep(_serialization.Model):
+ """Instruction steps to enable the connector.
+
+ :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.
+ Foe 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]
+ """
+
+ _attribute_map = {
+ "title": {"key": "title", "type": "str"},
+ "description": {"key": "description", "type": "str"},
+ "instructions": {"key": "instructions", "type": "[InstructionStepDetails]"},
+ "inner_steps": {"key": "innerSteps", "type": "[InstructionStep]"},
+ }
+
+ 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 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.
+ Foe 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.title = title
+ self.description = description
+ self.instructions = instructions
+ self.inner_steps = inner_steps
+
+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 server.
+
+ :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 = {
+ 'parameters': {'required': True},
+ 'type': {'required': True},
+ }
+
+ _attribute_map = {
+ "parameters": {"key": "parameters", "type": "object"},
+ "type": {"key": "type", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ parameters: JSON,
+ type: str,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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.parameters = parameters
+ self.type = type
+
+class InstructionStepsInstructionsItem(ConnectorInstructionModelBase):
+ """InstructionStepsInstructionsItem.
+
+ All required parameters must be populated in order to send to server.
+
+ :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
+ """
+
+class IoTCheckRequirements(DataConnectorsCheckRequirements):
+ """Represents IoT requirements check request.
+
+ 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", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", and "RestApiPoller".
+ :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: Any
+ ) -> None:
+ """
+ :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 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. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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 = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -13687,138 +14452,4098 @@ class MetadataModel(ResourceWithEtag): # pylint: disable=too-many-instance-attr
"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]"},
+ "kind": {"key": "kind", "type": "str"},
+ "data_types": {"key": "properties.dataTypes", "type": "AlertsDataTypeOfDataConnector"},
+ "subscription_id": {"key": "properties.subscriptionId", "type": "str"},
}
- def __init__( # pylint: disable=too-many-locals
+ def __init__(
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
- ):
+ 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 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]
+ :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: Any
+ ) -> None:
+ """
+ :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 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", "SubmissionMail", and "Nic".
+ :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]
+ :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: Any
+ ) -> None:
+ """
+ :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: Any
+ ) -> None:
+ """
+ :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 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", "SubmissionMail", and "Nic".
+ :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},
+ '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: Any
+ ) -> None:
+ """
+ """
+ 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: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.address = None
+ self.location = None
+ self.threat_intelligence = None
+
+class Job(ResourceWithEtag):
+ """The assignment job.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :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 end_time: The time the job completed.
+ :vartype end_time: ~datetime.datetime
+ :ivar items: List of items published by the job.
+ :vartype items: list[~azure.mgmt.securityinsight.models.JobItem]
+ :ivar provisioning_state: State of the job. Known values are: "Accepted", "InProgress",
+ "Succeeded", "Failed", and "Canceled".
+ :vartype provisioning_state: str or ~azure.mgmt.securityinsight.models.ProvisioningState
+ :ivar start_time: The time the job started.
+ :vartype start_time: ~datetime.datetime
+ :ivar error_message: Message to describe error, if an error exists.
+ :vartype error_message: str
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'end_time': {'readonly': True},
+ 'provisioning_state': {'readonly': True},
+ 'start_time': {'readonly': True},
+ 'error_message': {'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"},
+ "end_time": {"key": "properties.endTime", "type": "iso-8601"},
+ "items": {"key": "properties.items", "type": "[JobItem]"},
+ "provisioning_state": {"key": "properties.provisioningState", "type": "str"},
+ "start_time": {"key": "properties.startTime", "type": "iso-8601"},
+ "error_message": {"key": "properties.errorMessage", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ etag: Optional[str] = None,
+ items: Optional[List["_models.JobItem"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword items: List of items published by the job.
+ :paramtype items: list[~azure.mgmt.securityinsight.models.JobItem]
+ """
+ super().__init__(etag=etag, **kwargs)
+ self.end_time = None
+ self.items = items
+ self.provisioning_state = None
+ self.start_time = None
+ self.error_message = None
+
+class JobItem(_serialization.Model):
+ """An entity describing the publish status of a content item.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar resource_id: The resource id of the content item.
+ :vartype resource_id: str
+ :ivar status: Status of the item publication. Known values are: "New", "Active", "Closed",
+ "Backlog", "Approved", "Succeeded", "Failed", and "InProgress".
+ :vartype status: str or ~azure.mgmt.securityinsight.models.Status
+ :ivar execution_time: The time the item publishing was completed.
+ :vartype execution_time: ~datetime.datetime
+ :ivar errors: The list of error descriptions if the item publication fails.
+ :vartype errors: list[~azure.mgmt.securityinsight.models.Error]
+ """
+
+ _validation = {
+ 'status': {'readonly': True},
+ 'execution_time': {'readonly': True},
+ }
+
+ _attribute_map = {
+ "resource_id": {"key": "resourceId", "type": "str"},
+ "status": {"key": "status", "type": "str"},
+ "execution_time": {"key": "executionTime", "type": "iso-8601"},
+ "errors": {"key": "errors", "type": "[Error]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ resource_id: Optional[str] = None,
+ errors: Optional[List["_models.Error"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource_id: The resource id of the content item.
+ :paramtype resource_id: str
+ :keyword errors: The list of error descriptions if the item publication fails.
+ :paramtype errors: list[~azure.mgmt.securityinsight.models.Error]
+ """
+ super().__init__(**kwargs)
+ self.resource_id = resource_id
+ self.status = None
+ self.execution_time = None
+ self.errors = errors
+
+class JobList(_serialization.Model):
+ """List of all the jobs.
+
+ 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 jobs.
+ :vartype next_link: str
+ :ivar value: Array of jobs. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.Job]
+ """
+
+ _validation = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Job]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: List["_models.Job"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Array of jobs. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Job]
+ """
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
+
+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 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 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 = {
+ 'type': {'required': True},
+ 'token_endpoint': {'required': True},
+ 'user_name': {'required': True},
+ 'password': {'required': True},
+ 'request_timeout_in_seconds': {'maximum': 180},
+ }
+
+ _attribute_map = {
+ "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,
+ *,
+ 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 ListActionsResponse(_serialization.Model):
+ """List all actions for a system to perform.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar value: Array of actions. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.Action]
+ :ivar next_link: The link to fetch the next page of actions.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[Action]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: List["_models.Action"],
+ next_link: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Array of actions. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Action]
+ :keyword next_link: The link to fetch the next page of actions.
+ :paramtype next_link: str
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
+
+class LockUserAction(Action):
+ """Represents lock user action.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar kind: The actions kind. Required. Known values are: "LockUser" and "UnlockUser".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.ListActionKind
+ :ivar user: The user to lock.
+ :vartype user: str
+ :ivar failure_reason: The reason of the failure of the action. Empty if the action is
+ successful.
+ :vartype failure_reason: str
+ """
+
+ _validation = {
+ 'kind': {'required': True},
+ }
+
+ _attribute_map = {
+ "kind": {"key": "kind", "type": "str"},
+ "user": {"key": "user", "type": "str"},
+ "failure_reason": {"key": "failureReason", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ user: Optional[str] = None,
+ failure_reason: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword user: The user to lock.
+ :paramtype user: str
+ :keyword failure_reason: The reason of the failure of the action. Empty if the action is
+ successful.
+ :paramtype failure_reason: str
+ """
+ super().__init__(**kwargs)
+ self.kind: str = 'LockUser'
+ self.user = user
+ self.failure_reason = failure_reason
+
+class Log(_serialization.Model):
+ """Describes a log.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar type: Types of logs and tables. Required. Known values are: "AbapAuditLog", "AbapJobLog",
+ "AbapSpoolLog", "AbapSpoolOutputLog", "AbapChangeDocsLog", "AbapAppLog", "AbapWorkflowLog",
+ "AbapCrLog", "AbapTableDataLog", "AbapFilesLogs", "JavaFilesLogs", "AGRTCODES", "USR01",
+ "USR02", "AGR1251", "AGRUSERS", "AGRPROF", "UST04", "USR21", "ADR6", "ADCP", "USR05",
+ "USGRPUSER", "USERADDR", "DEVACCESS", "AGRDEFINE", "PAHI", "AGRAGRS", "USRSTAMP", "AGRFLAGS",
+ "SNCSYSACL", and "USRACL".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.LogType
+ :ivar ingestion_type: Types of ingestion. Known values are: "Full" and "Incremental".
+ :vartype ingestion_type: str or ~azure.mgmt.securityinsight.models.IngestionType
+ :ivar status: Types of log status. Known values are: "Enabled" and "Disabled".
+ :vartype status: str or ~azure.mgmt.securityinsight.models.LogStatusType
+ :ivar schedule_interval: The schedule interval in seconds.
+ :vartype schedule_interval: int
+ :ivar bulk_size: The bulk size for the log.
+ :vartype bulk_size: int
+ :ivar filters: The filters for the log.
+ :vartype filters: list[str]
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "ingestion_type": {"key": "ingestionType", "type": "str"},
+ "status": {"key": "status", "type": "str"},
+ "schedule_interval": {"key": "scheduleInterval", "type": "int"},
+ "bulk_size": {"key": "bulkSize", "type": "int"},
+ "filters": {"key": "filters", "type": "[str]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Union[str, "_models.LogType"],
+ ingestion_type: Optional[Union[str, "_models.IngestionType"]] = None,
+ status: Optional[Union[str, "_models.LogStatusType"]] = None,
+ schedule_interval: Optional[int] = None,
+ bulk_size: Optional[int] = None,
+ filters: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword type: Types of logs and tables. Required. Known values are: "AbapAuditLog",
+ "AbapJobLog", "AbapSpoolLog", "AbapSpoolOutputLog", "AbapChangeDocsLog", "AbapAppLog",
+ "AbapWorkflowLog", "AbapCrLog", "AbapTableDataLog", "AbapFilesLogs", "JavaFilesLogs",
+ "AGRTCODES", "USR01", "USR02", "AGR1251", "AGRUSERS", "AGRPROF", "UST04", "USR21", "ADR6",
+ "ADCP", "USR05", "USGRPUSER", "USERADDR", "DEVACCESS", "AGRDEFINE", "PAHI", "AGRAGRS",
+ "USRSTAMP", "AGRFLAGS", "SNCSYSACL", and "USRACL".
+ :paramtype type: str or ~azure.mgmt.securityinsight.models.LogType
+ :keyword ingestion_type: Types of ingestion. Known values are: "Full" and "Incremental".
+ :paramtype ingestion_type: str or ~azure.mgmt.securityinsight.models.IngestionType
+ :keyword status: Types of log status. Known values are: "Enabled" and "Disabled".
+ :paramtype status: str or ~azure.mgmt.securityinsight.models.LogStatusType
+ :keyword schedule_interval: The schedule interval in seconds.
+ :paramtype schedule_interval: int
+ :keyword bulk_size: The bulk size for the log.
+ :paramtype bulk_size: int
+ :keyword filters: The filters for the log.
+ :paramtype filters: list[str]
+ """
+ super().__init__(**kwargs)
+ self.type = type
+ self.ingestion_type = ingestion_type
+ self.status = status
+ self.schedule_interval = schedule_interval
+ self.bulk_size = bulk_size
+ self.filters = filters
+
+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 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", "SubmissionMail", and "Nic".
+ :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 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: Any
+ ) -> None:
+ """
+ """
+ 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: Any
+ ) -> None:
+ """
+ """
+ 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 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", "SubmissionMail", and "Nic".
+ :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 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: Any
+ ) -> None:
+ """
+ """
+ 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: Any
+ ) -> None:
+ """
+ """
+ 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 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", "SubmissionMail", and "Nic".
+ :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 = {
+ '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: Any
+ ) -> None:
+ """
+ :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: Any
+ ) -> None:
+ """
+ :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 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", "SubmissionMail", and "Nic".
+ :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 = {
+ '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: 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 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: Any
+ ) -> None:
+ """
+ """
+ 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 server.
+
+ :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: Any
+ ) -> None:
+ """
+ :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 server.
+
+ :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
+ "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
+ "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
+ """
+
+ _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: Any
+ ) -> None:
+ """
+ :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 server.
+
+ :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
+ :vartype tenant_id: str
+ """
+
+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 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. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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.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: 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.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 server.
+
+ :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: Any
+ ) -> None:
+ """
+ :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 server.
+
+ :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: 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.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 server.
+
+ :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
+ "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
+ "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
+ """
+
+ _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: Any
+ ) -> None:
+ """
+ :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 server.
+
+ :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
+ :vartype tenant_id: str
+ """
+
+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 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. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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 = {
+ '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: 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 = '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 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.
+ :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: 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.
+ :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: Any
+ ) -> None:
+ """
+ :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: Any
+ ) -> None:
+ """
+ :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:
+ "Equals", "NotEquals", "LessThan", "LessThanEqual", "GreaterThan", "GreaterThanEqual",
+ "StringContains", "StringNotContains", "StringStartsWith", "StringNotStartsWith",
+ "StringEndsWith", "StringNotEndsWith", "StringIsEmpty", "IsNull", "IsTrue", "IsFalse",
+ "ArrayContains", "ArrayNotContains", "OnOrAfterRelative", "AfterRelative",
+ "OnOrBeforeRelative", "BeforeRelative", "OnOrAfterAbsolute", "AfterAbsolute",
+ "OnOrBeforeAbsolute", and "BeforeAbsolute".
+ :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: Any
+ ) -> None:
+ """
+ :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:
+ "Equals", "NotEquals", "LessThan", "LessThanEqual", "GreaterThan", "GreaterThanEqual",
+ "StringContains", "StringNotContains", "StringStartsWith", "StringNotStartsWith",
+ "StringEndsWith", "StringNotEndsWith", "StringIsEmpty", "IsNull", "IsTrue", "IsFalse",
+ "ArrayContains", "ArrayNotContains", "OnOrAfterRelative", "AfterRelative",
+ "OnOrBeforeRelative", "BeforeRelative", "OnOrAfterAbsolute", "AfterAbsolute",
+ "OnOrBeforeAbsolute", and "BeforeAbsolute".
+ :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 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 = {
+ '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: Any
+ ) -> None:
+ """
+ :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. 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: 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 = {
+ '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[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 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__(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. 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: 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 = {
+ '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[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 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__(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 server.
+
+ :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: 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 = 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 server.
+
+ :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: 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.tier = tier
+ self.name = name
+ self.email = email
+ self.link = link
+
+class MicrosoftPurviewInformationProtectionCheckRequirements(DataConnectorsCheckRequirements): # pylint: disable=name-too-long
+ """Represents MicrosoftPurviewInformationProtection requirements check request.
+
+ 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", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
+ """
+
+ _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: Any
+ ) -> None:
+ """
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_id: str
+ """
+ super().__init__(**kwargs)
+ self.kind: str = 'MicrosoftPurviewInformationProtection'
+ self.tenant_id = tenant_id
+
+class MicrosoftPurviewInformationProtectionCheckRequirementsProperties(DataConnectorTenantId): # pylint: disable=name-too-long
+ """MicrosoftPurviewInformationProtection requirements check 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. Required.
+ :vartype tenant_id: str
+ """
+
+class MicrosoftPurviewInformationProtectionConnectorDataTypes(_serialization.Model): # pylint: disable=name-too-long
+ """The available data types for Microsoft Purview Information Protection data connector.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar logs: Logs data type. Required.
+ :vartype logs:
+ ~azure.mgmt.securityinsight.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs
+ """
+
+ _validation = {
+ 'logs': {'required': True},
+ }
+
+ _attribute_map = {
+ "logs": {"key": "logs", "type": "MicrosoftPurviewInformationProtectionConnectorDataTypesLogs"},
+ }
+
+ def __init__(
+ self,
+ *,
+ logs: "_models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs",
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword logs: Logs data type. Required.
+ :paramtype logs:
+ ~azure.mgmt.securityinsight.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs
+ """
+ super().__init__(**kwargs)
+ self.logs = logs
+
+class MicrosoftPurviewInformationProtectionConnectorDataTypesLogs(DataConnectorDataTypeCommon): # pylint: disable=name-too-long
+ """Logs data type.
+
+ 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
+ """
+
+class MicrosoftPurviewInformationProtectionDataConnector(DataConnector): # pylint: disable=name-too-long
+ """Represents Microsoft Purview Information 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 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. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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.MicrosoftPurviewInformationProtectionConnectorDataTypes
+ """
+
+ _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": "MicrosoftPurviewInformationProtectionConnectorDataTypes"},
+ }
+
+ def __init__(
+ self,
+ *,
+ etag: Optional[str] = None,
+ tenant_id: Optional[str] = None,
+ data_types: Optional["_models.MicrosoftPurviewInformationProtectionConnectorDataTypes"] = 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.MicrosoftPurviewInformationProtectionConnectorDataTypes
+ """
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = 'MicrosoftPurviewInformationProtection'
+ self.tenant_id = tenant_id
+ self.data_types = data_types
+
+class MicrosoftPurviewInformationProtectionDataConnectorProperties(DataConnectorTenantId): # pylint: disable=name-too-long
+ """Microsoft Purview Information Protection 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. Required.
+ :vartype tenant_id: str
+ :ivar data_types: The available data types for the connector. Required.
+ :vartype data_types:
+ ~azure.mgmt.securityinsight.models.MicrosoftPurviewInformationProtectionConnectorDataTypes
+ """
+
+ _validation = {
+ 'tenant_id': {'required': True},
+ 'data_types': {'required': True},
+ }
+
+ _attribute_map = {
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "data_types": {"key": "dataTypes", "type": "MicrosoftPurviewInformationProtectionConnectorDataTypes"},
+ }
+
+ def __init__(
+ self,
+ *,
+ tenant_id: str,
+ data_types: "_models.MicrosoftPurviewInformationProtectionConnectorDataTypes",
+ **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.MicrosoftPurviewInformationProtectionConnectorDataTypes
+ """
+ super().__init__(tenant_id=tenant_id, **kwargs)
+ self.data_types = data_types
+
+class MicrosoftSecurityIncidentCreationAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes,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 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 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: 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", "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): # pylint: disable=name-too-long
+ """MicrosoftSecurityIncidentCreation rule common property bag.
+
+ 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", "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: Any
+ ) -> None:
+ """
+ :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): # pylint: disable=name-too-long
+ """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 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", "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: Any
+ ) -> None:
+ """
+ :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,name-too-long
+ """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 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 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: 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 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,name-too-long
+ """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: 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 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__(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
+
+class MLBehaviorAnalyticsAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
+ """Represents MLBehaviorAnalytics 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 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 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 sub_techniques: The sub-techniques of the alert rule.
+ :vartype sub_techniques: list[str]
+ """
+
+ _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},
+ 'sub_techniques': {'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]"},
+ "sub_techniques": {"key": "properties.subTechniques", "type": "[str]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ etag: Optional[str] = None,
+ 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 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 = '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
+ self.sub_techniques = None
+
+class MLBehaviorAnalyticsAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
+ """Represents MLBehaviorAnalytics 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 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 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
+ """
+
+ _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"},
+ "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: 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 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): # pylint: disable=name-too-long
+ """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 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 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: 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 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
+
+class MSTICheckRequirements(DataConnectorsCheckRequirements):
+ """Represents Microsoft Threat Intelligence requirements check request.
+
+ 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", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
+ """
+
+ _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: Any
+ ) -> None:
"""
- 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
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_id: str
+ """
+ super().__init__(**kwargs)
+ self.kind: str = 'MicrosoftThreatIntelligence'
+ self.tenant_id = tenant_id
+
+class MSTICheckRequirementsProperties(DataConnectorTenantId):
+ """Microsoft Threat Intelligence requirements check properties.
+ All required parameters must be populated in order to send to server.
-class MetadataPatch(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
- """Metadata patch request body.
+ :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
+ :vartype tenant_id: str
+ """
+
+class MSTIDataConnector(DataConnector):
+ """Represents Microsoft Threat Intelligence 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
@@ -13830,66 +18555,26 @@ class MetadataPatch(ResourceWithEtag): # pylint: disable=too-many-instance-attr
: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]
+ :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -13898,242 +18583,200 @@ class MetadataPatch(ResourceWithEtag): # pylint: disable=too-many-instance-attr
"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]"},
+ "kind": {"key": "kind", "type": "str"},
+ "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "data_types": {"key": "properties.dataTypes", "type": "MSTIDataConnectorDataTypes"},
}
- def __init__( # pylint: disable=too-many-locals
+ def __init__(
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
- ):
+ 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 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]
+ :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.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
+ 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 Platforms 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 Platforms
+ 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 Platforms
+ 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 Platforms 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. Required. 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. Required.
+ :vartype lookback_period: str
+ """
+ _validation = {
+ 'state': {'required': True},
+ 'lookback_period': {'required': True},
+ }
-class MetadataSource(_serialization.Model):
- """The original source of the content item, where it comes from.
+ _attribute_map = {
+ "state": {"key": "state", "type": "str"},
+ "lookback_period": {"key": "lookbackPeriod", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ state: Union[str, "_models.DataTypeState"],
+ lookback_period: str,
+ **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: The lookback period for the feed to be imported. Required.
+ :paramtype lookback_period: str
+ """
+ super().__init__(state=state, **kwargs)
+ self.lookback_period = lookback_period
- All required parameters must be populated in order to send to Azure.
+class MSTIDataConnectorProperties(DataConnectorTenantId):
+ """Microsoft Threat Intelligence data connector properties.
- :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
+ 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 data_types: The available data types for the connector. Required.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.MSTIDataConnectorDataTypes
"""
_validation = {
- "kind": {"required": True},
+ 'tenant_id': {'required': True},
+ 'data_types': {'required': True},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "source_id": {"key": "sourceId", "type": "str"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "data_types": {"key": "dataTypes", "type": "MSTIDataConnectorDataTypes"},
}
def __init__(
self,
*,
- kind: Union[str, "_models.SourceKind"],
- name: Optional[str] = None,
- source_id: Optional[str] = None,
- **kwargs
- ):
+ tenant_id: str,
+ data_types: "_models.MSTIDataConnectorDataTypes",
+ **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
+ :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
"""
- super().__init__(**kwargs)
- self.kind = kind
- self.name = name
- self.source_id = source_id
-
+ super().__init__(tenant_id=tenant_id, **kwargs)
+ self.data_types = data_types
-class MetadataSupport(_serialization.Model):
- """Support information for the content item.
+class MtpCheckRequirements(DataConnectorsCheckRequirements):
+ """Represents MTP (Microsoft Threat Protection) requirements check 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 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
+ :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
+ "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
+ "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
"""
_validation = {
- "tier": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
- "tier": {"key": "tier", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "email": {"key": "email", "type": "str"},
- "link": {"key": "link", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ "tenant_id": {"key": "properties.tenantId", "type": "str"},
}
def __init__(
self,
*,
- tier: Union[str, "_models.SupportTier"],
- name: Optional[str] = None,
- email: Optional[str] = None,
- link: Optional[str] = None,
- **kwargs
- ):
+ tenant_id: 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
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_id: str
"""
super().__init__(**kwargs)
- self.tier = tier
- self.name = name
- self.email = email
- self.link = link
+ self.kind: str = 'MicrosoftThreatProtection'
+ self.tenant_id = tenant_id
+
+class MTPCheckRequirementsProperties(DataConnectorTenantId):
+ """MTP (Microsoft Threat Protection) requirements check properties.
+ All required parameters must be populated in order to send to server.
-class MicrosoftSecurityIncidentCreationAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
- """Represents MicrosoftSecurityIncidentCreation rule.
+ :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
+ :vartype tenant_id: str
+ """
+
+class MTPDataConnector(DataConnector):
+ """Represents MTP (Microsoft 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
@@ -14145,41 +18788,28 @@ class MicrosoftSecurityIncidentCreationAlertRule(AlertRule): # pylint: disable=
: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
+ :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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.MTPDataConnectorDataTypes
+ :ivar filtered_providers: The available filtered providers for the connector.
+ :vartype filtered_providers: ~azure.mgmt.securityinsight.models.MtpFilteredProviders
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "last_modified_utc": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -14189,247 +18819,182 @@ class MicrosoftSecurityIncidentCreationAlertRule(AlertRule): # pylint: disable=
"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"},
+ "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "data_types": {"key": "properties.dataTypes", "type": "MTPDataConnectorDataTypes"},
+ "filtered_providers": {"key": "properties.filteredProviders", "type": "MtpFilteredProviders"},
}
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
- ):
+ tenant_id: Optional[str] = None,
+ data_types: Optional["_models.MTPDataConnectorDataTypes"] = None,
+ filtered_providers: Optional["_models.MtpFilteredProviders"] = None,
+ **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", "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
+ :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
+ :keyword filtered_providers: The available filtered providers for the connector.
+ :paramtype filtered_providers: ~azure.mgmt.securityinsight.models.MtpFilteredProviders
"""
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
+ self.kind: str = 'MicrosoftThreatProtection'
+ self.tenant_id = tenant_id
+ self.data_types = data_types
+ self.filtered_providers = filtered_providers
+class MTPDataConnectorDataTypes(_serialization.Model):
+ """The available data types for Microsoft Threat Protection Platforms data connector.
-class MicrosoftSecurityIncidentCreationAlertRuleCommonProperties(_serialization.Model):
- """MicrosoftSecurityIncidentCreation rule common property bag.
+ All required parameters must be populated in order to send to server.
+
+ :ivar incidents: Incidents data type for Microsoft Threat Protection Platforms data connector.
+ Required.
+ :vartype incidents: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypesIncidents
+ :ivar alerts: Alerts data type for Microsoft Threat Protection Platforms data connector.
+ :vartype alerts: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypesAlerts
+ """
+
+ _validation = {
+ 'incidents': {'required': True},
+ }
+
+ _attribute_map = {
+ "incidents": {"key": "incidents", "type": "MTPDataConnectorDataTypesIncidents"},
+ "alerts": {"key": "alerts", "type": "MTPDataConnectorDataTypesAlerts"},
+ }
+
+ def __init__(
+ self,
+ *,
+ incidents: "_models.MTPDataConnectorDataTypesIncidents",
+ alerts: Optional["_models.MTPDataConnectorDataTypesAlerts"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword incidents: Incidents data type for Microsoft Threat Protection Platforms data
+ connector. Required.
+ :paramtype incidents: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypesIncidents
+ :keyword alerts: Alerts data type for Microsoft Threat Protection Platforms data connector.
+ :paramtype alerts: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypesAlerts
+ """
+ super().__init__(**kwargs)
+ self.incidents = incidents
+ self.alerts = alerts
+
+class MTPDataConnectorDataTypesAlerts(DataConnectorDataTypeCommon):
+ """Alerts data type for Microsoft Threat Protection Platforms 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. Required. Known
+ values are: "Enabled" and "Disabled".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ """
+
+class MTPDataConnectorDataTypesIncidents(DataConnectorDataTypeCommon):
+ """Incidents data type for Microsoft Threat Protection Platforms 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. Required. Known
+ values are: "Enabled" and "Disabled".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ """
+
+class MTPDataConnectorProperties(DataConnectorTenantId):
+ """MTP (Microsoft Threat Protection) 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 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 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 filtered_providers: The available filtered providers for the connector.
+ :vartype filtered_providers: ~azure.mgmt.securityinsight.models.MtpFilteredProviders
"""
_validation = {
- "product_filter": {"required": True},
+ 'tenant_id': {'required': True},
+ 'data_types': {'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]"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "data_types": {"key": "dataTypes", "type": "MTPDataConnectorDataTypes"},
+ "filtered_providers": {"key": "filteredProviders", "type": "MtpFilteredProviders"},
}
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
- ):
+ tenant_id: str,
+ data_types: "_models.MTPDataConnectorDataTypes",
+ filtered_providers: Optional["_models.MtpFilteredProviders"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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 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 filtered_providers: The available filtered providers for the connector.
+ :paramtype filtered_providers: ~azure.mgmt.securityinsight.models.MtpFilteredProviders
"""
- 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.
+ super().__init__(tenant_id=tenant_id, **kwargs)
+ self.data_types = data_types
+ self.filtered_providers = filtered_providers
- Variables are only populated by the server, and will be ignored when sending a request.
+class MtpFilteredProviders(_serialization.Model):
+ """Represents the connector's Filtered providers.
- 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 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
+ :ivar alerts: Alerts filtered providers. When filters are not applied, all alerts will stream
+ through the MTP pipeline, still in private preview for all products EXCEPT MDA and MDI, which
+ are in GA state. Required.
+ :vartype alerts: list[str or ~azure.mgmt.securityinsight.models.MtpProvider]
"""
_validation = {
- "product_filter": {"required": True},
- "display_name": {"required": True},
- "enabled": {"required": True},
- "last_modified_utc": {"readonly": True},
+ 'alerts': {'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]"},
- "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"},
+ "alerts": {"key": "alerts", "type": "[str]"},
}
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
- ):
+ alerts: List[Union[str, "_models.MtpProvider"]],
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword alerts: Alerts filtered providers. When filters are not applied, all alerts will
+ stream through the MTP pipeline, still in private preview for all products EXCEPT MDA and MDI,
+ which are in GA state. Required.
+ :paramtype alerts: list[str or ~azure.mgmt.securityinsight.models.MtpProvider]
"""
- 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
-
+ super().__init__(**kwargs)
+ self.alerts = alerts
-class MicrosoftSecurityIncidentCreationAlertRuleTemplate(
- AlertRuleTemplate
-): # pylint: disable=too-many-instance-attributes
- """Represents MicrosoftSecurityIncidentCreation rule template.
+class NicEntity(Entity):
+ """Represents an network interface 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
@@ -14439,49 +19004,36 @@ class MicrosoftSecurityIncidentCreationAlertRuleTemplate(
: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]
+ :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.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 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]
"""
_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},
+ '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 = {
@@ -14490,201 +19042,109 @@ class MicrosoftSecurityIncidentCreationAlertRuleTemplate(
"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]"},
+ "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]"},
}
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
- ):
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ 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
+
+class NicEntityProperties(EntityCommonProperties):
+ """Nic 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 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]
+ """
+
+ _validation = {
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'mac_address': {'readonly': True},
+ 'ip_address_entity_id': {'readonly': True},
+ 'vlans': {'readonly': 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]"},
+ }
+
+ def __init__(
+ self,
+ **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 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
-
+ self.mac_address = None
+ self.ip_address_entity_id = None
+ self.vlans = None
-class MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(
- AlertRuleTemplatePropertiesBase
-): # pylint: disable=too-many-instance-attributes
- """MicrosoftSecurityIncidentCreation rule template properties.
+class NoneAuthModel(CcpAuthConfig):
+ """Model for API authentication with no authentication method - public API.
- 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 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 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 = {
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
+ 'type': {'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"},
- "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]"},
+ "type": {"key": "type", "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
- ):
+ **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 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__(
- 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.type: str = 'None'
-class MLBehaviorAnalyticsAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
- """Represents MLBehaviorAnalytics alert rule.
+class NrtAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
+ """Represents NRT 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
@@ -14702,35 +19162,58 @@ class MLBehaviorAnalyticsAlertRule(AlertRule): # pylint: disable=too-many-insta
: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 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 sub_techniques: The sub-techniques of the alert rule.
+ :vartype sub_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.
: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 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 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 = {
- "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},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'last_modified_utc': {'readonly': True},
}
_attribute_map = {
@@ -14741,53 +19224,129 @@ class MLBehaviorAnalyticsAlertRule(AlertRule): # pylint: disable=too-many-insta
"etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "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]"},
+ "sub_techniques": {"key": "properties.subTechniques", "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"},
- "tactics": {"key": "properties.tactics", "type": "[str]"},
- "techniques": {"key": "properties.techniques", "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__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
etag: Optional[str] = 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,
+ sub_techniques: Optional[List[str]] = None,
+ display_name: Optional[str] = None,
enabled: Optional[bool] = None,
- **kwargs
- ):
+ 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: 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 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 sub_techniques: The sub-techniques of the alert rule.
+ :paramtype sub_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 = "MLBehaviorAnalytics"
+ self.kind: str = 'NRT'
self.alert_rule_template_name = alert_rule_template_name
- self.description = None
- self.display_name = None
+ self.template_version = template_version
+ self.description = description
+ self.query = query
+ self.tactics = tactics
+ self.techniques = techniques
+ self.sub_techniques = sub_techniques
+ self.display_name = display_name
self.enabled = enabled
self.last_modified_utc = None
- self.severity = None
- self.tactics = None
- self.techniques = 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 MLBehaviorAnalyticsAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
- """Represents MLBehaviorAnalytics alert rule template.
+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.
- 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
@@ -14822,19 +19381,36 @@ class MLBehaviorAnalyticsAlertRuleTemplate(AlertRuleTemplate): # pylint: disabl
: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]
"""
_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},
+ '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 = {
@@ -14848,14 +19424,18 @@ class MLBehaviorAnalyticsAlertRuleTemplate(AlertRuleTemplate): # pylint: disabl
"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]",
- },
+ "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]"},
}
def __init__(
@@ -14868,9 +19448,16 @@ def __init__(
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,
- **kwargs
- ):
+ 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: Any
+ ) -> None:
"""
:keyword alert_rules_created_by_template_count: the number of alert rules that were created by
this template.
@@ -14889,12 +19476,29 @@ def __init__(
: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]
"""
super().__init__(**kwargs)
- self.kind: str = "MLBehaviorAnalytics"
+ 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
@@ -14904,16 +19508,121 @@ def __init__(
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
+class QueryBasedAlertRuleTemplateProperties(_serialization.Model):
+ """Query based alert rule template base property bag.
-class MLBehaviorAnalyticsAlertRuleTemplateProperties(AlertRuleTemplateWithMitreProperties):
- """MLBehaviorAnalytics alert rule template properties.
+ :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.
+ _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]"},
+ }
+
+ 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: 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]
+ """
+ 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
- All required parameters must be populated in order to send to Azure.
+class NrtAlertRuleTemplateProperties(AlertRuleTemplateWithMitreProperties, QueryBasedAlertRuleTemplateProperties): # pylint: disable=too-many-instance-attributes
+ """NRT alert rule template properties.
+
+ 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]
: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
@@ -14935,18 +19644,22 @@ class MLBehaviorAnalyticsAlertRuleTemplateProperties(AlertRuleTemplateWithMitreP
: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},
+ 'last_updated_date_utc': {'readonly': True},
+ 'created_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"},
@@ -14956,76 +19669,248 @@ class MLBehaviorAnalyticsAlertRuleTemplateProperties(AlertRuleTemplateWithMitreP
"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
+ 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: 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
+ :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, 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
+ 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
+
+class OAuthModel(CcpAuthConfig): # pylint: disable=too-many-instance-attributes
+ """Model for API authentication with OAuth2.
+
+ 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 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 = {
+ 'type': {'required': True},
+ 'client_secret': {'required': True},
+ 'client_id': {'required': True},
+ 'grant_type': {'required': True},
+ 'token_endpoint': {'required': True},
+ }
+
+ _attribute_map = {
+ "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,
+ *,
+ 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__(
- 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
-
+ 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 MSTICheckRequirements(DataConnectorsCheckRequirements):
- """Represents Microsoft Threat Intelligence requirements check request.
+class Office365ProjectCheckRequirements(DataConnectorsCheckRequirements):
+ """Represents Office365 Project requirements check 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".
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
"""
_validation = {
- "kind": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -15033,50 +19918,78 @@ class MSTICheckRequirements(DataConnectorsCheckRequirements):
"tenant_id": {"key": "properties.tenantId", "type": "str"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ tenant_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword tenant_id: The tenant id to connect to, and get the data from.
:paramtype tenant_id: str
"""
super().__init__(**kwargs)
- self.kind: str = "MicrosoftThreatIntelligence"
+ self.kind: str = 'Office365Project'
self.tenant_id = tenant_id
+class Office365ProjectCheckRequirementsProperties(DataConnectorTenantId): # pylint: disable=name-too-long
+ """Office365 Project requirements check properties.
-class MSTICheckRequirementsProperties(DataConnectorTenantId):
- """Microsoft Threat Intelligence requirements check 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.
:vartype tenant_id: str
"""
+class Office365ProjectConnectorDataTypes(_serialization.Model):
+ """The available data types for Office Microsoft Project data connector.
+
+ 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
+ """
+
_validation = {
- "tenant_id": {"required": True},
+ 'logs': {'required': True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "logs": {"key": "logs", "type": "Office365ProjectConnectorDataTypesLogs"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ logs: "_models.Office365ProjectConnectorDataTypesLogs",
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
+ :keyword logs: Logs data type. Required.
+ :paramtype logs: ~azure.mgmt.securityinsight.models.Office365ProjectConnectorDataTypesLogs
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
+ super().__init__(**kwargs)
+ self.logs = logs
+class Office365ProjectConnectorDataTypesLogs(DataConnectorDataTypeCommon):
+ """Logs data type.
-class MSTIDataConnector(DataConnector):
- """Represents 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. Required. Known
+ values are: "Enabled" and "Disabled".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.DataTypeState
+ """
+
+class Office365ProjectDataConnector(DataConnector):
+ """Represents Office Microsoft Project 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
@@ -15091,23 +20004,23 @@ class MSTIDataConnector(DataConnector):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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.Office365ProjectConnectorDataTypes
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -15118,7 +20031,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": "Office365ProjectConnectorDataTypes"},
}
def __init__(
@@ -15126,246 +20039,320 @@ def __init__(
*,
etag: Optional[str] = None,
tenant_id: Optional[str] = None,
- data_types: Optional["_models.MSTIDataConnectorDataTypes"] = None,
- **kwargs
- ):
+ data_types: Optional["_models.Office365ProjectConnectorDataTypes"] = 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.Office365ProjectConnectorDataTypes
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "MicrosoftThreatIntelligence"
+ self.kind: str = 'Office365Project'
self.tenant_id = tenant_id
self.data_types = data_types
+class Office365ProjectDataConnectorProperties(DataConnectorTenantId):
+ """Office Microsoft Project data connector properties.
-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.
+ All required parameters must be populated in order to send to server.
- :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 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.Office365ProjectConnectorDataTypes
"""
_validation = {
- "bing_safety_phishing_url": {"required": True},
- "microsoft_emerging_threat_feed": {"required": True},
+ 'tenant_id': {'required': True},
+ 'data_types': {'required': True},
}
_attribute_map = {
- "bing_safety_phishing_url": {
- "key": "bingSafetyPhishingURL",
- "type": "MSTIDataConnectorDataTypesBingSafetyPhishingURL",
- },
- "microsoft_emerging_threat_feed": {
- "key": "microsoftEmergingThreatFeed",
- "type": "MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed",
- },
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "data_types": {"key": "dataTypes", "type": "Office365ProjectConnectorDataTypes"},
}
def __init__(
self,
*,
- bing_safety_phishing_url: "_models.MSTIDataConnectorDataTypesBingSafetyPhishingURL",
- microsoft_emerging_threat_feed: "_models.MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed",
- **kwargs
- ):
+ tenant_id: str,
+ data_types: "_models.Office365ProjectConnectorDataTypes",
+ **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 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.Office365ProjectConnectorDataTypes
"""
- super().__init__(**kwargs)
- self.bing_safety_phishing_url = bing_safety_phishing_url
- self.microsoft_emerging_threat_feed = microsoft_emerging_threat_feed
-
+ super().__init__(tenant_id=tenant_id, **kwargs)
+ self.data_types = data_types
-class MSTIDataConnectorDataTypesBingSafetyPhishingURL(DataConnectorDataTypeCommon):
- """Data type for Microsoft Threat Intelligence Platforms data connector.
+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.
+ 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 kind: Describes the kind of connector to be checked. Required. Known values are:
+ "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
+ "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
"""
_validation = {
- "state": {"required": True},
- "lookback_period": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
- "state": {"key": "state", "type": "str"},
- "lookback_period": {"key": "lookbackPeriod", "type": "str"},
+ "kind": {"key": "kind", "type": "str"},
+ "tenant_id": {"key": "properties.tenantId", "type": "str"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], lookback_period: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ tenant_id: 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 tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_id: str
"""
- super().__init__(state=state, **kwargs)
- self.lookback_period = lookback_period
+ super().__init__(**kwargs)
+ self.kind: str = 'OfficeATP'
+ self.tenant_id = tenant_id
+class OfficeATPCheckRequirementsProperties(DataConnectorTenantId):
+ """OfficeATP (Office 365 Advanced Threat Protection) requirements check properties.
-class MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed(DataConnectorDataTypeCommon):
- """Data type for Microsoft Threat Intelligence Platforms data connector.
+ All required parameters must be populated in order to send to server.
- 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 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
+class OfficeATPDataConnector(DataConnector):
+ """Represents OfficeATP (Office 365 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 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. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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 = 'OfficeATP'
+ self.tenant_id = tenant_id
+ self.data_types = data_types
-class MSTIDataConnectorProperties(DataConnectorTenantId):
- """Microsoft Threat Intelligence data connector properties.
+class OfficeATPDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsProperties):
+ """OfficeATP (Office 365 Advanced Threat Protection) 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 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
- :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},
+ 'tenant_id': {'required': True},
}
_attribute_map = {
+ "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
"tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "MSTIDataConnectorDataTypes"},
}
- def __init__(self, *, tenant_id: str, data_types: "_models.MSTIDataConnectorDataTypes", **kwargs):
+ def __init__(
+ self,
+ *,
+ tenant_id: str,
+ 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
: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
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
+ super().__init__(tenant_id=tenant_id, data_types=data_types, **kwargs)
self.data_types = data_types
+ self.tenant_id = tenant_id
+class OfficeConsent(Resource):
+ """Consent for Office365 tenant that already made.
-class MtpCheckRequirements(DataConnectorsCheckRequirements):
- """Represents MTP (Microsoft Threat Protection) requirements check request.
-
- 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.
+ :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 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
"""
_validation = {
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
+ "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"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ tenant_id: Optional[str] = None,
+ consent_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :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
"""
super().__init__(**kwargs)
- self.kind: str = "MicrosoftThreatProtection"
self.tenant_id = tenant_id
+ self.consent_id = consent_id
+class OfficeConsentList(_serialization.Model):
+ """List of all the office365 consents.
-class MTPCheckRequirementsProperties(DataConnectorTenantId):
- """MTP (Microsoft 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 office consents.
+ :vartype next_link: str
+ :ivar value: Array of the consents. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.OfficeConsent]
"""
_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": "[OfficeConsent]"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.OfficeConsent"],
+ **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 the consents. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.OfficeConsent]
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
-
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
-class MTPDataConnector(DataConnector):
- """Represents MTP (Microsoft Threat Protection) 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
@@ -15380,23 +20367,23 @@ class MTPDataConnector(DataConnector):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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.MTPDataConnectorDataTypes
+ :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},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -15407,7 +20394,7 @@ class MTPDataConnector(DataConnector):
"etag": {"key": "etag", "type": "str"},
"kind": {"key": "kind", "type": "str"},
"tenant_id": {"key": "properties.tenantId", "type": "str"},
- "data_types": {"key": "properties.dataTypes", "type": "MTPDataConnectorDataTypes"},
+ "data_types": {"key": "properties.dataTypes", "type": "OfficeDataConnectorDataTypes"},
}
def __init__(
@@ -15415,235 +20402,194 @@ def __init__(
*,
etag: Optional[str] = None,
tenant_id: Optional[str] = None,
- data_types: Optional["_models.MTPDataConnectorDataTypes"] = None,
- **kwargs
- ):
+ 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.MTPDataConnectorDataTypes
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "MicrosoftThreatProtection"
+ 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.
-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.
+ All required parameters must be populated in order to send to server.
- :ivar incidents: Data type for Microsoft Threat Protection Platforms data connector. Required.
- :vartype incidents: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypesIncidents
+ :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
"""
_validation = {
- "incidents": {"required": True},
+ 'exchange': {'required': True},
+ 'share_point': {'required': True},
+ 'teams': {'required': True},
}
_attribute_map = {
- "incidents": {"key": "incidents", "type": "MTPDataConnectorDataTypesIncidents"},
+ "exchange": {"key": "exchange", "type": "OfficeDataConnectorDataTypesExchange"},
+ "share_point": {"key": "sharePoint", "type": "OfficeDataConnectorDataTypesSharePoint"},
+ "teams": {"key": "teams", "type": "OfficeDataConnectorDataTypesTeams"},
}
- def __init__(self, *, incidents: "_models.MTPDataConnectorDataTypesIncidents", **kwargs):
+ def __init__(
+ self,
+ *,
+ exchange: "_models.OfficeDataConnectorDataTypesExchange",
+ share_point: "_models.OfficeDataConnectorDataTypesSharePoint",
+ teams: "_models.OfficeDataConnectorDataTypesTeams",
+ **kwargs: Any
+ ) -> None:
"""
- :keyword incidents: Data type for Microsoft Threat Protection Platforms data connector.
- Required.
- :paramtype incidents: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypesIncidents
+ :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
"""
super().__init__(**kwargs)
- self.incidents = incidents
-
+ self.exchange = exchange
+ self.share_point = share_point
+ self.teams = teams
-class MTPDataConnectorDataTypesIncidents(DataConnectorDataTypeCommon):
- """Data type for Microsoft Threat Protection Platforms data connector.
+class OfficeDataConnectorDataTypesExchange(DataConnectorDataTypeCommon):
+ """Exchange data type connection.
- 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
"""
- _validation = {
- "state": {"required": True},
- }
+class OfficeDataConnectorDataTypesSharePoint(DataConnectorDataTypeCommon):
+ """SharePoint data type connection.
- _attribute_map = {
- "state": {"key": "state", "type": "str"},
- }
+ All required parameters must be populated in order to send to server.
- 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)
+ :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
+ """
+class OfficeDataConnectorDataTypesTeams(DataConnectorDataTypeCommon):
+ """Teams data type connection.
-class MTPDataConnectorProperties(DataConnectorTenantId):
- """MTP (Microsoft Threat Protection) data connector properties.
+ 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
+ """
+
+class OfficeDataConnectorProperties(DataConnectorTenantId):
+ """Office 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.
:vartype tenant_id: str
:ivar data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.MTPDataConnectorDataTypes
+ :vartype data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes
"""
_validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
+ 'tenant_id': {'required': True},
+ 'data_types': {'required': True},
}
_attribute_map = {
"tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "MTPDataConnectorDataTypes"},
+ "data_types": {"key": "dataTypes", "type": "OfficeDataConnectorDataTypes"},
}
- def __init__(self, *, tenant_id: str, data_types: "_models.MTPDataConnectorDataTypes", **kwargs):
+ def __init__(
+ self,
+ *,
+ tenant_id: str,
+ data_types: "_models.OfficeDataConnectorDataTypes",
+ **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
+ :paramtype data_types: ~azure.mgmt.securityinsight.models.OfficeDataConnectorDataTypes
"""
super().__init__(tenant_id=tenant_id, **kwargs)
self.data_types = data_types
+class OfficeIRMCheckRequirements(DataConnectorsCheckRequirements):
+ """Represents OfficeIRM (Microsoft Insider Risk Management) requirements check request.
-class NicEntity(Entity):
- """Represents an network interface 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}.
- :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 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 kind: Describes the kind of connector to be checked. Required. Known values are:
+ "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
+ "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
"""
_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},
+ '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"},
- "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]"},
+ "tenant_id": {"key": "properties.tenantId", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ *,
+ tenant_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword tenant_id: The tenant id to connect to, and get the data from.
+ :paramtype tenant_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: str = 'OfficeIRM'
+ self.tenant_id = tenant_id
-class NicEntityProperties(EntityCommonProperties):
- """Nic entity property bag.
+class OfficeIRMCheckRequirementsProperties(DataConnectorTenantId):
+ """OfficeIRM (Microsoft Insider Risk Management) 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 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 tenant_id: The tenant id to connect to, and get the data from. Required.
+ :vartype tenant_id: str
"""
- _validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "mac_address": {"readonly": True},
- "ip_address_entity_id": {"readonly": True},
- "vlans": {"readonly": 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]"},
- }
-
- def __init__(self, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.mac_address = None
- self.ip_address_entity_id = None
- self.vlans = None
-
-
-class NrtAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
- """Represents NRT alert rule.
+class OfficeIRMDataConnector(DataConnector):
+ """Represents OfficeIRM (Microsoft Insider Risk Management) 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
@@ -15655,62 +20601,26 @@ 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".
- :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 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.
- :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]
+ :ivar kind: The data connector kind. Required. Known values are: "AzureActiveDirectory",
+ "AzureSecurityCenter", "MicrosoftCloudAppSecurity", "ThreatIntelligence",
+ "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM", "Office365Project",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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 = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "last_modified_utc": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -15720,126 +20630,166 @@ 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"},
- "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]"},
+ "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "data_types": {"key": "properties.dataTypes", "type": "AlertsDataTypeOfDataConnector"},
}
- def __init__( # pylint: disable=too-many-locals
+ def __init__(
self,
*,
etag: Optional[str] = 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
- ):
+ tenant_id: Optional[str] = None,
+ data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = 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 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]
+ :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 = "NRT"
- 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
+ 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 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.
+ :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: 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.
+ :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 server.
+
+ :ivar kind: Describes the kind of connector to be checked. Required. Known values are:
+ "AzureActiveDirectory", "AzureSecurityCenter", "MicrosoftCloudAppSecurity",
+ "ThreatIntelligence", "ThreatIntelligenceTaxii", "Office365", "OfficeATP", "OfficeIRM",
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
+ """
+
+ _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: Any
+ ) -> None:
+ """
+ :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 server.
+
+ :ivar tenant_id: The tenant id to connect to, and get the data from. Required.
+ :vartype tenant_id: str
+ """
+
+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 server.
+
+ :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: Any
+ ) -> None:
+ """
+ :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.
-class NrtAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
- """Represents NRT alert rule template.
+ 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
+ """
+
+class OfficePowerBIDataConnector(DataConnector):
+ """Represents Office Microsoft PowerBI 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
@@ -15849,61 +20799,28 @@ class NrtAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-insta
: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 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",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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.OfficePowerBIConnectorDataTypes
"""
_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},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -15911,485 +20828,931 @@ class NrtAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-insta
"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_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]"},
+ "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "data_types": {"key": "properties.dataTypes", "type": "OfficePowerBIConnectorDataTypes"},
}
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
- ):
+ etag: Optional[str] = None,
+ tenant_id: Optional[str] = None,
+ data_types: Optional["_models.OfficePowerBIConnectorDataTypes"] = 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 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
+ """
+ super().__init__(etag=etag, **kwargs)
+ self.kind: str = 'OfficePowerBI'
+ self.tenant_id = tenant_id
+ self.data_types = data_types
+
+class OfficePowerBIDataConnectorProperties(DataConnectorTenantId):
+ """Office Microsoft PowerBI 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. Required.
+ :vartype tenant_id: str
+ :ivar data_types: The available data types for the connector. Required.
+ :vartype data_types: ~azure.mgmt.securityinsight.models.OfficePowerBIConnectorDataTypes
+ """
+
+ _validation = {
+ 'tenant_id': {'required': True},
+ 'data_types': {'required': True},
+ }
+
+ _attribute_map = {
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "data_types": {"key": "dataTypes", "type": "OfficePowerBIConnectorDataTypes"},
+ }
+
+ def __init__(
+ self,
+ *,
+ tenant_id: str,
+ data_types: "_models.OfficePowerBIConnectorDataTypes",
+ **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.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"},
+ }
+
+ 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.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.operation = operation
+ self.provider = provider
+ self.resource = resource
+class OperationsList(_serialization.Model):
+ """Lists the operations available in the SecurityInsights RP.
-class QueryBasedAlertRuleTemplateProperties(_serialization.Model):
- """Query based alert rule template base property bag.
+ 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 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 = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': 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]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Operation]"},
}
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
- ):
+ value: List["_models.Operation"],
+ **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 value: Array of operations. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Operation]
"""
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
-
+ self.next_link = None
+ self.value = value
-class NrtAlertRuleTemplateProperties(
- AlertRuleTemplateWithMitreProperties, QueryBasedAlertRuleTemplateProperties
-): # pylint: disable=too-many-instance-attributes
- """NRT alert rule template properties.
+class OracleAuthModel(CcpAuthConfig):
+ """Model for API authentication for Oracle.
- 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 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 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 tenant_id: Oracle tenant ID. Required.
+ :vartype tenant_id: str
+ :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 = {
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
+ 'type': {'required': True},
+ 'tenant_id': {'required': True},
+ 'user_id': {'required': True},
+ 'public_fingerprint': {'required': True},
+ 'pem_file': {'required': True},
}
_attribute_map = {
- "query": {"key": "query", "type": "str"},
- "severity": {"key": "severity", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "user_id": {"key": "userId", "type": "str"},
+ "public_fingerprint": {"key": "publicFingerprint", "type": "str"},
+ "pem_file": {"key": "pemFile", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ tenant_id: str,
+ user_id: str,
+ public_fingerprint: str,
+ pem_file: str,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword tenant_id: Oracle tenant ID. Required.
+ :paramtype tenant_id: str
+ :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__(**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 PackageBaseProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
+ """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
+ """
+
+ _attribute_map = {
+ "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"},
- "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]"},
+ "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,
*,
- query: Optional[str] = None,
- severity: Optional[Union[str, "_models.AlertSeverity"]] = 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,
- 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
- ):
- """
- :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
- :keyword description: The description of the alert rule template.
- :paramtype description: str
- :keyword display_name: The display name for alert rule template.
+ 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 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 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 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__(
- 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
+ super().__init__(**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.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.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.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 Office365ProjectCheckRequirements(DataConnectorsCheckRequirements):
- """Represents Office365 Project requirements check request.
+ 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".
- :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 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 = {
- "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": "[PackageModel]"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **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.
- :paramtype tenant_id: str
+ :keyword value: Array of packages. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.PackageModel]
"""
super().__init__(**kwargs)
- self.kind: str = "Office365Project"
- self.tenant_id = tenant_id
-
+ self.next_link = None
+ self.value = value
-class Office365ProjectCheckRequirementsProperties(DataConnectorTenantId):
- """Office365 Project requirements check properties.
+class PackageModel(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
+ """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 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
"""
_validation = {
- "tenant_id": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "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"},
+ "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__(self, *, tenant_id: str, **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,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
+ :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
+ """
+ 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
+
+class PackageProperties(PackageBaseProperties): # pylint: disable=too-many-instance-attributes
+ """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 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]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ resource_provider: Optional[List["_models.PermissionsResourceProviderItem"]] = None,
+ customs: Optional[List["_models.PermissionsCustomsItem"]] = 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]
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
+ super().__init__(**kwargs)
+ self.resource_provider = resource_provider
+ self.customs = customs
+class PermissionsCustomsItem(Customs):
+ """PermissionsCustomsItem.
-class Office365ProjectConnectorDataTypes(_serialization.Model):
- """The available data types for Office Microsoft Project data connector.
+ :ivar name: Customs permissions name.
+ :vartype name: str
+ :ivar description: Customs permissions description.
+ :vartype description: str
+ """
- All required parameters must be populated in order to send to Azure.
+class ResourceProvider(_serialization.Model):
+ """Resource provider permissions required for the connector.
- :ivar logs: Logs data type. Required.
- :vartype logs: ~azure.mgmt.securityinsight.models.Office365ProjectConnectorDataTypesLogs
+ :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
"""
- _validation = {
- "logs": {"required": True},
- }
-
_attribute_map = {
- "logs": {"key": "logs", "type": "Office365ProjectConnectorDataTypesLogs"},
+ "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"},
}
- def __init__(self, *, logs: "_models.Office365ProjectConnectorDataTypesLogs", **kwargs):
+ 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: Any
+ ) -> None:
"""
- :keyword logs: Logs data type. Required.
- :paramtype logs: ~azure.mgmt.securityinsight.models.Office365ProjectConnectorDataTypesLogs
+ :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
"""
super().__init__(**kwargs)
- self.logs = logs
+ 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 PermissionsResourceProviderItem(ResourceProvider):
+ """PermissionsResourceProviderItem.
-class Office365ProjectConnectorDataTypesLogs(DataConnectorDataTypeCommon):
- """Logs data type.
+ :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
+ """
+
+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 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 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 = {
- "state": {"required": True},
+ 'logic_app_resource_id': {'required': True},
}
_attribute_map = {
- "state": {"key": "state", "type": "str"},
+ "logic_app_resource_id": {"key": "logicAppResourceId", "type": "str"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
+ def __init__(
+ self,
+ *,
+ logic_app_resource_id: str,
+ tenant_id: 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 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__(state=state, **kwargs)
-
+ super().__init__(**kwargs)
+ self.logic_app_resource_id = logic_app_resource_id
+ self.tenant_id = tenant_id
-class Office365ProjectDataConnector(DataConnector):
- """Represents Office Microsoft Project data connector.
+class ProcessEntity(Entity): # pylint: disable=too-many-instance-attributes
+ """Represents a process 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
@@ -16399,28 +21762,54 @@ class Office365ProjectDataConnector(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.Office365ProjectConnectorDataTypes
+ :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.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 = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"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 = {
@@ -16428,136 +21817,210 @@ class Office365ProjectDataConnector(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": "Office365ProjectConnectorDataTypes"},
+ "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,
*,
- etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.Office365ProjectConnectorDataTypes"] = None,
- **kwargs
- ):
+ elevation_token: Optional[Union[str, "_models.ElevationToken"]] = 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.Office365ProjectConnectorDataTypes
+ :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__(etag=etag, **kwargs)
- self.kind: str = "Office365Project"
- self.tenant_id = tenant_id
- self.data_types = data_types
-
+ 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 Office365ProjectDataConnectorProperties(DataConnectorTenantId):
- """Office Microsoft Project data connector properties.
+class ProcessEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
+ """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 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.Office365ProjectConnectorDataTypes
+ :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 = {
- "tenant_id": {"required": True},
- "data_types": {"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 = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "Office365ProjectConnectorDataTypes"},
+ "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, *, tenant_id: str, data_types: "_models.Office365ProjectConnectorDataTypes", **kwargs):
+ def __init__(
+ self,
+ *,
+ elevation_token: Optional[Union[str, "_models.ElevationToken"]] = 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.Office365ProjectConnectorDataTypes
+ :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__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
-
-
-class OfficeATPCheckRequirements(DataConnectorsCheckRequirements):
- """Represents OfficeATP (Office 365 Advanced Threat Protection) requirements check request.
+ 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
- All required parameters must be populated in order to send to Azure.
+class ProductPackageAdditionalProperties(_serialization.Model):
+ """product package additional 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 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 = {
- "kind": {"required": True},
- }
-
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "installed_version": {"key": "installedVersion", "type": "str"},
+ "metadata_resource_id": {"key": "metadataResourceId", "type": "str"},
+ "packaged_content": {"key": "packagedContent", "type": "object"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ 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.
- :paramtype tenant_id: 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__(**kwargs)
- self.kind: str = "OfficeATP"
- self.tenant_id = tenant_id
+ self.installed_version = installed_version
+ self.metadata_resource_id = metadata_resource_id
+ self.packaged_content = packaged_content
+class ProductPackageList(_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.ProductPackageModel]
"""
_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": "[ProductPackageModel]"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.ProductPackageModel"],
+ **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.ProductPackageModel]
"""
- 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 ProductPackageModel(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
+ """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,26 +22032,72 @@ 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
+ :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 = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
@@ -16597,159 +22106,438 @@ 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"},
+ "installed_version": {"key": "properties.installedVersion", "type": "str"},
+ "metadata_resource_id": {"key": "properties.metadataResourceId", "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,
+ 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 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
+ :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__(etag=etag, **kwargs)
- self.kind: str = "OfficeATP"
- self.tenant_id = tenant_id
- self.data_types = data_types
-
-
-class OfficeATPDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsProperties):
- """OfficeATP (Office 365 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
+ 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): # pylint: disable=too-many-instance-attributes
+ """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
"""
- _validation = {
- "tenant_id": {"required": True},
- }
-
_attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "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__(
- 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 OfficeConsent(Resource):
- """Consent for Office365 tenant that already made.
+ 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
- Variables are only populated by the server, and will be ignored when sending a request.
+class ProductTemplateAdditionalProperties(_serialization.Model):
+ """additional properties of product template.
- :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 packaged_content: The json of the ARM template to deploy.
+ :vartype packaged_content: JSON
"""
- _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"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
- "consent_id": {"key": "properties.consentId", "type": "str"},
+ "packaged_content": {"key": "packagedContent", "type": "object"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, consent_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ packaged_content: Optional[JSON] = None,
+ **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 packaged_content: The json of the ARM template to deploy.
+ :paramtype packaged_content: JSON
"""
super().__init__(**kwargs)
- self.tenant_id = tenant_id
- self.consent_id = consent_id
-
+ self.packaged_content = packaged_content
-class OfficeConsentList(_serialization.Model):
- """List of all the office365 consents.
+class ProductTemplateList(_serialization.Model):
+ """List of all the 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 next_link: URL to fetch the next set of office consents.
+ :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
- :ivar value: Array of the consents. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.OfficeConsent]
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'value': {'required': True},
+ 'next_link': {'readonly': True},
}
_attribute_map = {
+ "value": {"key": "value", "type": "[ProductTemplateModel]"},
"next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[OfficeConsent]"},
}
- def __init__(self, *, value: List["_models.OfficeConsent"], **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.ProductTemplateModel"],
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of the consents. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.OfficeConsent]
+ :keyword value: Array of templates. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.ProductTemplateModel]
"""
super().__init__(**kwargs)
- self.next_link = None
self.value = value
+ self.next_link = None
-
-class OfficeDataConnector(DataConnector):
- """Represents office data connector.
+class ProductTemplateModel(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
+ """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
@@ -16761,959 +22549,1459 @@ class OfficeDataConnector(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.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
- ):
- """
- :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.
-
- All required parameters must be populated in order to send to Azure.
-
- :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
- """
-
- _validation = {
- "exchange": {"required": True},
- "share_point": {"required": True},
- "teams": {"required": True},
- }
-
- _attribute_map = {
- "exchange": {"key": "exchange", "type": "OfficeDataConnectorDataTypesExchange"},
- "share_point": {"key": "sharePoint", "type": "OfficeDataConnectorDataTypesSharePoint"},
- "teams": {"key": "teams", "type": "OfficeDataConnectorDataTypesTeams"},
- }
-
- def __init__(
- self,
- *,
- exchange: "_models.OfficeDataConnectorDataTypesExchange",
- share_point: "_models.OfficeDataConnectorDataTypesSharePoint",
- teams: "_models.OfficeDataConnectorDataTypesTeams",
- **kwargs
- ):
- """
- :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
- """
- super().__init__(**kwargs)
- self.exchange = exchange
- self.share_point = share_point
- self.teams = teams
-
-
-class OfficeDataConnectorDataTypesExchange(DataConnectorDataTypeCommon):
- """Exchange 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)
-
-
-class OfficeDataConnectorDataTypesSharePoint(DataConnectorDataTypeCommon):
- """SharePoint 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)
-
-
-class OfficeDataConnectorDataTypesTeams(DataConnectorDataTypeCommon):
- """Teams 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)
-
-
-class OfficeDataConnectorProperties(DataConnectorTenantId):
- """Office 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.OfficeDataConnectorDataTypes
+ :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", and
+ "AutomationRule".
+ :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 = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'is_deprecated': {'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"},
+ "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__(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,
+ 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 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: 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", and
+ "AutomationRule".
+ :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__(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.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 OfficeIRMCheckRequirements(DataConnectorsCheckRequirements):
- """Represents OfficeIRM (Microsoft Insider Risk Management) requirements check request.
+class TemplateBaseProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
+ """Template 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 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", and
+ "AutomationRule".
+ :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 = {
- "kind": {"required": True},
+ 'is_deprecated': {'readonly': 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"},
+ "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__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__( # pylint: disable=too-many-locals
+ self,
+ *,
+ 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 tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: 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 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", and
+ "AutomationRule".
+ :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 = "OfficeIRM"
- self.tenant_id = tenant_id
-
-
-class OfficeIRMCheckRequirementsProperties(DataConnectorTenantId):
- """OfficeIRM (Microsoft Insider Risk Management) 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.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 OfficeIRMDataConnector(DataConnector):
- """Represents OfficeIRM (Microsoft Insider Risk Management) data connector.
+class ProductTemplateProperties(TemplateBaseProperties, ProductTemplateAdditionalProperties): # pylint: disable=too-many-instance-attributes
+ """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.AlertsDataTypeOfDataConnector
+ :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", and
+ "AutomationRule".
+ :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": "AlertsDataTypeOfDataConnector"},
+ "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,
*,
- 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 = "OfficeIRM"
- self.tenant_id = tenant_id
- self.data_types = data_types
-
+ 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", and
+ "AutomationRule".
+ :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__(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 OfficeIRMDataConnectorProperties(DataConnectorTenantId, DataConnectorWithAlertsProperties):
- """OfficeIRM (Microsoft Insider Risk Management) data connector properties.
+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.
+ 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.
- :vartype tenant_id: str
+ :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 = {
- "tenant_id": {"required": True},
+ 'condition_type': {'required': True},
}
_attribute_map = {
- "data_types": {"key": "dataTypes", "type": "AlertsDataTypeOfDataConnector"},
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "condition_type": {"key": "conditionType", "type": "str"},
+ "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyArrayChangedValuesCondition"},
}
def __init__(
- self, *, tenant_id: str, data_types: Optional["_models.AlertsDataTypeOfDataConnector"] = None, **kwargs
- ):
+ self,
+ *,
+ condition_properties: Optional["_models.AutomationRulePropertyArrayChangedValuesCondition"] = 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.
- :paramtype tenant_id: str
+ :keyword condition_properties:
+ :paramtype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayChangedValuesCondition
"""
- 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.
+ super().__init__(**kwargs)
+ self.condition_type: str = 'PropertyArrayChanged'
+ self.condition_properties = condition_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
+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 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.AutomationRulePropertyArrayValuesCondition
"""
_validation = {
- "kind": {"required": True},
+ 'condition_type': {'required': True},
}
_attribute_map = {
- "kind": {"key": "kind", "type": "str"},
- "tenant_id": {"key": "properties.tenantId", "type": "str"},
+ "condition_type": {"key": "conditionType", "type": "str"},
+ "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyArrayValuesCondition"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ condition_properties: Optional["_models.AutomationRulePropertyArrayValuesCondition"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from.
- :paramtype tenant_id: str
+ :keyword condition_properties:
+ :paramtype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayValuesCondition
"""
super().__init__(**kwargs)
- self.kind: str = "OfficePowerBI"
- self.tenant_id = tenant_id
-
+ self.condition_type: str = 'PropertyArray'
+ self.condition_properties = condition_properties
-class OfficePowerBICheckRequirementsProperties(DataConnectorTenantId):
- """Office PowerBI requirements check properties.
+class PropertyChangedConditionProperties(AutomationRuleCondition):
+ """Describes an automation rule condition that evaluates a property's value change.
- 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 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 = {
- "tenant_id": {"required": True},
+ 'condition_type': {'required': True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "condition_type": {"key": "conditionType", "type": "str"},
+ "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyValuesChangedCondition"},
}
- def __init__(self, *, tenant_id: str, **kwargs):
+ def __init__(
+ self,
+ *,
+ condition_properties: Optional["_models.AutomationRulePropertyValuesChangedCondition"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword tenant_id: The tenant id to connect to, and get the data from. Required.
- :paramtype tenant_id: str
+ :keyword condition_properties:
+ :paramtype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesChangedCondition
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
-
+ super().__init__(**kwargs)
+ self.condition_type: str = 'PropertyChanged'
+ self.condition_properties = condition_properties
-class OfficePowerBIConnectorDataTypes(_serialization.Model):
- """The available data types for Office Microsoft PowerBI data connector.
+class PropertyConditionProperties(AutomationRuleCondition):
+ """Describes an automation rule condition that evaluates a 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 logs: Logs data type. Required.
- :vartype logs: ~azure.mgmt.securityinsight.models.OfficePowerBIConnectorDataTypesLogs
+ :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 = {
- "logs": {"required": True},
+ 'condition_type': {'required': True},
}
_attribute_map = {
- "logs": {"key": "logs", "type": "OfficePowerBIConnectorDataTypesLogs"},
+ "condition_type": {"key": "conditionType", "type": "str"},
+ "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyValuesCondition"},
}
- def __init__(self, *, logs: "_models.OfficePowerBIConnectorDataTypesLogs", **kwargs):
+ def __init__(
+ self,
+ *,
+ condition_properties: Optional["_models.AutomationRulePropertyValuesCondition"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword logs: Logs data type. Required.
- :paramtype logs: ~azure.mgmt.securityinsight.models.OfficePowerBIConnectorDataTypesLogs
+ :keyword condition_properties:
+ :paramtype condition_properties:
+ ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesCondition
"""
super().__init__(**kwargs)
- self.logs = logs
-
+ self.condition_type: str = 'Property'
+ self.condition_properties = condition_properties
-class OfficePowerBIConnectorDataTypesLogs(DataConnectorDataTypeCommon):
- """Logs data type.
+class PullRequest(_serialization.Model):
+ """Information regarding pull request for protected branches.
- 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 url: URL of pull request.
+ :vartype url: str
+ :ivar state: State of the pull request. Known values are: "Active", "InProgress", "Dismissed",
+ "CompletedByUser", and "CompletedBySystem".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.State
"""
_validation = {
- "state": {"required": True},
+ 'url': {'readonly': True},
+ 'state': {'readonly': True},
}
_attribute_map = {
+ "url": {"key": "url", "type": "str"},
"state": {"key": "state", "type": "str"},
}
- def __init__(self, *, state: Union[str, "_models.DataTypeState"], **kwargs):
+ def __init__(
+ self,
+ **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
"""
- super().__init__(state=state, **kwargs)
-
-
-class OfficePowerBIDataConnector(DataConnector):
- """Represents Office Microsoft PowerBI data connector.
-
- Variables are only populated by the server, and will be ignored when sending a request.
+ super().__init__(**kwargs)
+ self.url = None
+ self.state = None
- All required parameters must be populated in order to send to Azure.
+class Query(_serialization.Model):
+ """Represents a query to run on the TI objects in the workspace.
- :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 condition: Represents a condition used to query for TI objects.
+ :vartype condition: ~azure.mgmt.securityinsight.models.QueryCondition
+ :ivar sort_by: Specifies how to sort the query results.
+ :vartype sort_by: ~azure.mgmt.securityinsight.models.QuerySortBy
+ :ivar max_page_size: Represents the maximum size of the page that will be returned from the
+ query API.
+ :vartype max_page_size: int
+ :ivar min_page_size: Represents the minimum size of the page that will be returned from the
+ query API.
+ :vartype min_page_size: int
"""
- _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": "OfficePowerBIConnectorDataTypes"},
+ "condition": {"key": "condition", "type": "QueryCondition"},
+ "sort_by": {"key": "sortBy", "type": "QuerySortBy"},
+ "max_page_size": {"key": "maxPageSize", "type": "int"},
+ "min_page_size": {"key": "minPageSize", "type": "int"},
}
def __init__(
self,
*,
- etag: Optional[str] = None,
- tenant_id: Optional[str] = None,
- data_types: Optional["_models.OfficePowerBIConnectorDataTypes"] = 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.OfficePowerBIConnectorDataTypes
- """
- super().__init__(etag=etag, **kwargs)
- self.kind: str = "OfficePowerBI"
- self.tenant_id = tenant_id
- self.data_types = data_types
-
+ condition: Optional["_models.QueryCondition"] = None,
+ sort_by: Optional["_models.QuerySortBy"] = None,
+ max_page_size: Optional[int] = None,
+ min_page_size: Optional[int] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword condition: Represents a condition used to query for TI objects.
+ :paramtype condition: ~azure.mgmt.securityinsight.models.QueryCondition
+ :keyword sort_by: Specifies how to sort the query results.
+ :paramtype sort_by: ~azure.mgmt.securityinsight.models.QuerySortBy
+ :keyword max_page_size: Represents the maximum size of the page that will be returned from the
+ query API.
+ :paramtype max_page_size: int
+ :keyword min_page_size: Represents the minimum size of the page that will be returned from the
+ query API.
+ :paramtype min_page_size: int
+ """
+ super().__init__(**kwargs)
+ self.condition = condition
+ self.sort_by = sort_by
+ self.max_page_size = max_page_size
+ self.min_page_size = min_page_size
-class OfficePowerBIDataConnectorProperties(DataConnectorTenantId):
- """Office Microsoft PowerBI data connector properties.
+class QueryCondition(_serialization.Model):
+ """Represents a condition used to query for TI objects.
- 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 data_types: The available data types for the connector. Required.
- :vartype data_types: ~azure.mgmt.securityinsight.models.OfficePowerBIConnectorDataTypes
+ :ivar stix_object_type: The STIX type for the objects returned by this query.
+ :vartype stix_object_type: str
+ :ivar clauses: The list of clauses to be evaluated in disjunction or conjunction base on the
+ specified top level connective operator. Required.
+ :vartype clauses: list[~azure.mgmt.securityinsight.models.ConditionClause]
+ :ivar condition_connective: The top level connective operator for this condition. Known values
+ are: "And", "Or", "And", and "Or".
+ :vartype condition_connective: str or ~azure.mgmt.securityinsight.models.Connective
"""
_validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
+ 'clauses': {'required': True},
}
_attribute_map = {
- "tenant_id": {"key": "tenantId", "type": "str"},
- "data_types": {"key": "dataTypes", "type": "OfficePowerBIConnectorDataTypes"},
+ "stix_object_type": {"key": "stixObjectType", "type": "str"},
+ "clauses": {"key": "clauses", "type": "[ConditionClause]"},
+ "condition_connective": {"key": "conditionConnective", "type": "str"},
}
- def __init__(self, *, tenant_id: str, data_types: "_models.OfficePowerBIConnectorDataTypes", **kwargs):
+ def __init__(
+ self,
+ *,
+ clauses: List["_models.ConditionClause"],
+ stix_object_type: Optional[str] = None,
+ condition_connective: Optional[Union[str, "_models.Connective"]] = 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.OfficePowerBIConnectorDataTypes
+ :keyword stix_object_type: The STIX type for the objects returned by this query.
+ :paramtype stix_object_type: str
+ :keyword clauses: The list of clauses to be evaluated in disjunction or conjunction base on the
+ specified top level connective operator. Required.
+ :paramtype clauses: list[~azure.mgmt.securityinsight.models.ConditionClause]
+ :keyword condition_connective: The top level connective operator for this condition. Known
+ values are: "And", "Or", "And", and "Or".
+ :paramtype condition_connective: str or ~azure.mgmt.securityinsight.models.Connective
"""
- super().__init__(tenant_id=tenant_id, **kwargs)
- self.data_types = data_types
-
+ super().__init__(**kwargs)
+ self.stix_object_type = stix_object_type
+ self.clauses = clauses
+ self.condition_connective = condition_connective
-class Operation(_serialization.Model):
- """Operation provided by provider.
+class QuerySortBy(_serialization.Model):
+ """Specifies how to sort the query results.
- :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
+ :ivar direction: The direction to sort the results by. Known values are: "ASC" and "DESC".
+ :vartype direction: str or ~azure.mgmt.securityinsight.models.SortingDirection
+ :ivar field: Represents the field to sort the results by.
+ :vartype field: str
"""
_attribute_map = {
- "display": {"key": "display", "type": "OperationDisplay"},
- "name": {"key": "name", "type": "str"},
- "origin": {"key": "origin", "type": "str"},
- "is_data_action": {"key": "isDataAction", "type": "bool"},
+ "direction": {"key": "direction", "type": "str"},
+ "field": {"key": "field", "type": "str"},
}
def __init__(
self,
*,
- display: Optional["_models.OperationDisplay"] = None,
- name: Optional[str] = None,
- origin: Optional[str] = None,
- is_data_action: Optional[bool] = None,
- **kwargs
- ):
+ direction: Optional[Union[str, "_models.SortingDirection"]] = None,
+ field: Optional[str] = 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
+ :keyword direction: The direction to sort the results by. Known values are: "ASC" and "DESC".
+ :paramtype direction: str or ~azure.mgmt.securityinsight.models.SortingDirection
+ :keyword field: Represents the field to sort the results by.
+ :paramtype field: str
"""
super().__init__(**kwargs)
- self.display = display
- self.name = name
- self.origin = origin
- self.is_data_action = is_data_action
+ self.direction = direction
+ self.field = field
+class Recommendation(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
+ """Recommendation object.
-class OperationDisplay(_serialization.Model):
- """Properties of the operation.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar description: Description of the operation.
+ :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 recommendation_type_id: Id of the recommendation type.
+ :vartype recommendation_type_id: str
+ :ivar state: State of the recommendation. Known values are: "Active", "InProgress",
+ "Dismissed", "CompletedByUser", and "CompletedBySystem".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.State
+ :ivar title: Title of the recommendation.
+ :vartype title: str
+ :ivar description: Description of the recommendation.
:vartype description: str
- :ivar operation: Operation name.
- :vartype operation: str
- :ivar provider: Provider name.
- :vartype provider: str
- :ivar resource: Resource name.
- :vartype resource: str
+ :ivar creation_time_utc: The time stamp (UTC) when the recommendation was created.
+ :vartype creation_time_utc: ~datetime.datetime
+ :ivar last_evaluated_time_utc: The time stamp (UTC) when the recommendation was last evaluated.
+ :vartype last_evaluated_time_utc: ~datetime.datetime
+ :ivar last_modified_time_utc: The time stamp (UTC) when the recommendation was last modified.
+ :vartype last_modified_time_utc: ~datetime.datetime
+ :ivar suggestions: List of suggestions to take for this recommendation.
+ :vartype suggestions: list[~azure.mgmt.securityinsight.models.RecommendedSuggestion]
+ :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]
"""
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ }
+
_attribute_map = {
- "description": {"key": "description", "type": "str"},
- "operation": {"key": "operation", "type": "str"},
- "provider": {"key": "provider", "type": "str"},
- "resource": {"key": "resource", "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"},
+ "recommendation_type_id": {"key": "properties.recommendationTypeId", "type": "str"},
+ "state": {"key": "properties.state", "type": "str"},
+ "title": {"key": "properties.title", "type": "str"},
+ "description": {"key": "properties.description", "type": "str"},
+ "creation_time_utc": {"key": "properties.creationTimeUtc", "type": "iso-8601"},
+ "last_evaluated_time_utc": {"key": "properties.lastEvaluatedTimeUtc", "type": "iso-8601"},
+ "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
+ "suggestions": {"key": "properties.suggestions", "type": "[RecommendedSuggestion]"},
+ "resource_id": {"key": "properties.resourceId", "type": "str"},
+ "additional_properties": {"key": "properties.additionalProperties", "type": "{str}"},
}
def __init__(
self,
*,
+ etag: Optional[str] = None,
+ recommendation_type_id: Optional[str] = None,
+ state: Optional[Union[str, "_models.State"]] = None,
+ title: Optional[str] = None,
description: Optional[str] = None,
- operation: Optional[str] = None,
- provider: Optional[str] = None,
- resource: Optional[str] = None,
- **kwargs
- ):
+ creation_time_utc: Optional[datetime.datetime] = None,
+ last_evaluated_time_utc: Optional[datetime.datetime] = None,
+ last_modified_time_utc: Optional[datetime.datetime] = None,
+ suggestions: Optional[List["_models.RecommendedSuggestion"]] = None,
+ resource_id: Optional[str] = None,
+ additional_properties: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword description: Description of the operation.
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword recommendation_type_id: Id of the recommendation type.
+ :paramtype recommendation_type_id: str
+ :keyword state: State of the recommendation. Known values are: "Active", "InProgress",
+ "Dismissed", "CompletedByUser", and "CompletedBySystem".
+ :paramtype state: str or ~azure.mgmt.securityinsight.models.State
+ :keyword title: Title of the recommendation.
+ :paramtype title: str
+ :keyword description: Description of the recommendation.
: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 creation_time_utc: The time stamp (UTC) when the recommendation was created.
+ :paramtype creation_time_utc: ~datetime.datetime
+ :keyword last_evaluated_time_utc: The time stamp (UTC) when the recommendation was last
+ evaluated.
+ :paramtype last_evaluated_time_utc: ~datetime.datetime
+ :keyword last_modified_time_utc: The time stamp (UTC) when the recommendation was last
+ modified.
+ :paramtype last_modified_time_utc: ~datetime.datetime
+ :keyword suggestions: List of suggestions to take for this recommendation.
+ :paramtype suggestions: list[~azure.mgmt.securityinsight.models.RecommendedSuggestion]
+ :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]
"""
- super().__init__(**kwargs)
+ super().__init__(etag=etag, **kwargs)
+ self.recommendation_type_id = recommendation_type_id
+ self.state = state
+ self.title = title
self.description = description
- self.operation = operation
- self.provider = provider
- self.resource = resource
-
+ self.creation_time_utc = creation_time_utc
+ self.last_evaluated_time_utc = last_evaluated_time_utc
+ self.last_modified_time_utc = last_modified_time_utc
+ self.suggestions = suggestions
+ self.resource_id = resource_id
+ self.additional_properties = additional_properties
-class OperationsList(_serialization.Model):
- """Lists the operations available in the SecurityInsights RP.
+class RecommendationList(_serialization.Model):
+ """A list of recommendations.
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 operations.
+ :ivar value: An list of recommendations. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.Recommendation]
+ :ivar next_link: Link to next page of resources.
:vartype next_link: str
- :ivar value: Array of operations. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Operation]
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'value': {'required': True},
+ 'next_link': {'readonly': True},
}
_attribute_map = {
+ "value": {"key": "value", "type": "[Recommendation]"},
"next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[Operation]"},
}
- def __init__(self, *, value: List["_models.Operation"], **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.Recommendation"],
+ **kwargs: Any
+ ) -> None:
"""
- :keyword value: Array of operations. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Operation]
+ :keyword value: An list of recommendations. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Recommendation]
"""
super().__init__(**kwargs)
- self.next_link = None
self.value = value
+ self.next_link = None
+class RecommendationPatch(_serialization.Model):
+ """Recommendation Fields to update.
-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]
+ :ivar properties: Recommendation Fields Properties to update.
+ :vartype properties: ~azure.mgmt.securityinsight.models.RecommendationPatchProperties
"""
_attribute_map = {
- "resource_provider": {"key": "resourceProvider", "type": "[PermissionsResourceProviderItem]"},
- "customs": {"key": "customs", "type": "[PermissionsCustomsItem]"},
+ "properties": {"key": "properties", "type": "RecommendationPatchProperties"},
}
def __init__(
self,
*,
- resource_provider: Optional[List["_models.PermissionsResourceProviderItem"]] = None,
- customs: Optional[List["_models.PermissionsCustomsItem"]] = None,
- **kwargs
- ):
+ properties: Optional["_models.RecommendationPatchProperties"] = 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 properties: Recommendation Fields Properties to update.
+ :paramtype properties: ~azure.mgmt.securityinsight.models.RecommendationPatchProperties
"""
super().__init__(**kwargs)
- self.resource_provider = resource_provider
- self.customs = customs
-
+ self.properties = properties
-class PermissionsCustomsItem(Customs):
- """PermissionsCustomsItem.
+class RecommendationPatchProperties(_serialization.Model):
+ """Recommendation Fields Properties to update.
- :ivar name: Customs permissions name.
- :vartype name: str
- :ivar description: Customs permissions description.
- :vartype description: str
+ :ivar state: State of the recommendation. Known values are: "Active", "InProgress",
+ "Dismissed", "CompletedByUser", and "CompletedBySystem".
+ :vartype state: str or ~azure.mgmt.securityinsight.models.State
"""
_attribute_map = {
- "name": {"key": "name", "type": "str"},
- "description": {"key": "description", "type": "str"},
+ "state": {"key": "state", "type": "str"},
}
- def __init__(self, *, name: Optional[str] = None, description: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ state: Optional[Union[str, "_models.State"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword name: Customs permissions name.
- :paramtype name: str
- :keyword description: Customs permissions description.
- :paramtype description: str
+ :keyword state: State of the recommendation. Known values are: "Active", "InProgress",
+ "Dismissed", "CompletedByUser", and "CompletedBySystem".
+ :paramtype state: str or ~azure.mgmt.securityinsight.models.State
"""
- super().__init__(name=name, description=description, **kwargs)
+ super().__init__(**kwargs)
+ self.state = state
+class RecommendedSuggestion(_serialization.Model):
+ """What suggestions should be taken to complete the recommendation.
-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 suggestion_type_id: Id of the suggestion type. Required.
+ :vartype suggestion_type_id: str
+ :ivar title: Title of the suggestion. Required.
+ :vartype title: str
+ :ivar description: Description of the suggestion. Required.
+ :vartype description: str
+ :ivar action: Action of the suggestion. Required.
+ :vartype action: str
+ :ivar additional_properties: Collection of additional properties for the suggestion.
+ :vartype additional_properties: dict[str, str]
"""
+ _validation = {
+ 'suggestion_type_id': {'required': True},
+ 'title': {'required': True},
+ 'description': {'required': True},
+ 'action': {'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"},
+ "suggestion_type_id": {"key": "suggestionTypeId", "type": "str"},
+ "title": {"key": "title", "type": "str"},
+ "description": {"key": "description", "type": "str"},
+ "action": {"key": "action", "type": "str"},
+ "additional_properties": {"key": "additionalProperties", "type": "{str}"},
}
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
- ):
+ suggestion_type_id: str,
+ title: str,
+ description: str,
+ action: str,
+ additional_properties: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword suggestion_type_id: Id of the suggestion type. Required.
+ :paramtype suggestion_type_id: str
+ :keyword title: Title of the suggestion. Required.
+ :paramtype title: str
+ :keyword description: Description of the suggestion. Required.
+ :paramtype description: str
+ :keyword action: Action of the suggestion. Required.
+ :paramtype action: str
+ :keyword additional_properties: Collection of additional properties for the suggestion.
+ :paramtype additional_properties: dict[str, str]
"""
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.suggestion_type_id = suggestion_type_id
+ self.title = title
+ self.description = description
+ self.action = action
+ self.additional_properties = additional_properties
-class PermissionsResourceProviderItem(ResourceProvider):
- """PermissionsResourceProviderItem.
+class ReevaluateResponse(_serialization.Model):
+ """Reevaluate response object.
- :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 last_evaluated_time_utc: The time stamp (UTC) when the recommendation was last evaluated.
+ :vartype last_evaluated_time_utc: ~datetime.datetime
"""
_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"},
+ "last_evaluated_time_utc": {"key": "lastEvaluatedTimeUtc", "type": "iso-8601"},
}
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
- ):
+ last_evaluated_time_utc: Optional[datetime.datetime] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword last_evaluated_time_utc: The time stamp (UTC) when the recommendation was last
+ evaluated.
+ :paramtype last_evaluated_time_utc: ~datetime.datetime
+ """
+ super().__init__(**kwargs)
+ self.last_evaluated_time_utc = last_evaluated_time_utc
+
+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 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", "SubmissionMail", and "Nic".
+ :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 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 = {
+ '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},
+ }
+
+ _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"},
+ }
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
"""
- :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
"""
- super().__init__(
- provider=provider,
- permissions_display_text=permissions_display_text,
- provider_display_name=provider_display_name,
- scope=scope,
- required_permissions=required_permissions,
- **kwargs
- )
+ super().__init__(**kwargs)
+ self.kind: str = 'RegistryKey'
+ self.additional_data = None
+ self.friendly_name = None
+ self.hive = None
+ self.key = None
+class RegistryKeyEntityProperties(EntityCommonProperties):
+ """RegistryKey entity property bag.
-class PlaybookActionProperties(_serialization.Model):
- """PlaybookActionProperties.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :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
+ :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 = {
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'hive': {'readonly': True},
+ 'key': {'readonly': True},
+ }
+
_attribute_map = {
- "logic_app_resource_id": {"key": "logicAppResourceId", "type": "str"},
- "tenant_id": {"key": "tenantId", "type": "str"},
+ "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, *, logic_app_resource_id: Optional[str] = None, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
"""
- :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
"""
super().__init__(**kwargs)
- self.logic_app_resource_id = logic_app_resource_id
- self.tenant_id = tenant_id
-
+ self.hive = None
+ self.key = None
-class ProcessEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a process entity.
+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.
- 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
@@ -17727,50 +24015,37 @@ class ProcessEntity(Entity): # pylint: disable=too-many-instance-attributes
"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
+ :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 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 = {
- "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},
+ '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 = {
@@ -17781,40 +24056,29 @@ 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"},
+ "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, *, elevation_token: Optional[Union[str, "_models.ElevationToken"]] = None, **kwargs):
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
"""
- :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.kind: str = 'RegistryValue'
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
-
+ self.key_entity_id = None
+ self.value_data = None
+ self.value_name = None
+ self.value_type = None
-class ProcessEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
- """Process entity property bag.
+class RegistryValueEntityProperties(EntityCommonProperties):
+ """RegistryValue entity property bag.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -17824,507 +24088,735 @@ class ProcessEntityProperties(EntityCommonProperties): # pylint: disable=too-ma
: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 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 = {
+ '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 = {
+ "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,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.key_entity_id = None
+ self.value_data = None
+ self.value_name = None
+ self.value_type = None
+
+class Relation(ResourceWithEtag):
+ """Represents a relation between two 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. 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 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': {'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"},
+ "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,
+ *,
+ 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__(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.
+
+ 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]
"""
- _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},
+ _validation = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Relation]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: List["_models.Relation"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :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 Relationship(TIObject): # pylint: disable=too-many-instance-attributes
+ """Represents a relationship 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 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 TI object. Required. Known values are: "AttackPattern", "Identity",
+ "Indicator", "Relationship", and "ThreatActor".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.TIObjectKind
+ :ivar data: The core STIX object that this TI object represents.
+ :vartype data: dict[str, any]
+ :ivar created_by: The UserInfo of the user/entity which originally created this TI object.
+ :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar source: The source name for this TI object.
+ :vartype source: str
+ :ivar first_ingested_time_utc: The timestamp for the first time this object was ingested.
+ :vartype first_ingested_time_utc: ~datetime.datetime
+ :ivar last_ingested_time_utc: The timestamp for the last time this object was ingested.
+ :vartype last_ingested_time_utc: ~datetime.datetime
+ :ivar ingestion_rules_version: The ID of the rules version that was active when this TI object
+ was last ingested.
+ :vartype ingestion_rules_version: str
+ :ivar last_update_method: The name of the method/application that initiated the last write to
+ this TI object.
+ :vartype last_update_method: str
+ :ivar last_modified_by: The UserInfo of the user/entity which last modified this TI object.
+ :vartype last_modified_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar last_updated_date_time_utc: The timestamp for the last time this TI object was updated.
+ :vartype last_updated_date_time_utc: ~datetime.datetime
+ :ivar relationship_hints: A dictionary used to help follow relationships from this object to
+ other STIX objects. The keys are field names from the STIX object (in the 'data' field), and
+ the values are lists of sources that can be prepended to the object ID in order to efficiently
+ locate the target TI object.
+ :vartype relationship_hints: list[~azure.mgmt.securityinsight.models.RelationshipHint]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'data': {'readonly': True},
+ 'created_by': {'readonly': True},
+ 'source': {'readonly': True},
+ 'first_ingested_time_utc': {'readonly': True},
+ 'last_ingested_time_utc': {'readonly': True},
+ 'ingestion_rules_version': {'readonly': True},
+ 'last_update_method': {'readonly': True},
+ 'last_modified_by': {'readonly': True},
+ 'last_updated_date_time_utc': {'readonly': True},
+ 'relationship_hints': {'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"},
+ "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"},
+ "data": {"key": "properties.data", "type": "{object}"},
+ "created_by": {"key": "properties.createdBy", "type": "UserInfo"},
+ "source": {"key": "properties.source", "type": "str"},
+ "first_ingested_time_utc": {"key": "properties.firstIngestedTimeUtc", "type": "iso-8601"},
+ "last_ingested_time_utc": {"key": "properties.lastIngestedTimeUtc", "type": "iso-8601"},
+ "ingestion_rules_version": {"key": "properties.ingestionRulesVersion", "type": "str"},
+ "last_update_method": {"key": "properties.lastUpdateMethod", "type": "str"},
+ "last_modified_by": {"key": "properties.lastModifiedBy", "type": "UserInfo"},
+ "last_updated_date_time_utc": {"key": "properties.lastUpdatedDateTimeUtc", "type": "iso-8601"},
+ "relationship_hints": {"key": "properties.relationshipHints", "type": "[RelationshipHint]"},
}
- def __init__(self, *, elevation_token: Optional[Union[str, "_models.ElevationToken"]] = None, **kwargs):
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
"""
- :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
-
+ self.kind: str = 'Relationship'
-class PropertyArrayChangedConditionProperties(AutomationRuleCondition):
- """Describes an automation rule condition that evaluates an array property's value change.
+class RelationshipHint(_serialization.Model):
+ """An object used to help follow relationships from this object to other STIX objects.
- 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
+ :ivar field_name:
+ :vartype field_name: str
+ :ivar source:
+ :vartype source: str
"""
- _validation = {
- "condition_type": {"required": True},
+ _attribute_map = {
+ "field_name": {"key": "fieldName", "type": "str"},
+ "source": {"key": "source", "type": "str"},
}
+ def __init__(
+ self,
+ *,
+ field_name: Optional[str] = None,
+ source: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword field_name:
+ :paramtype field_name: str
+ :keyword source:
+ :paramtype source: str
+ """
+ super().__init__(**kwargs)
+ self.field_name = field_name
+ self.source = source
+
+class Repo(_serialization.Model):
+ """Represents a repository.
+
+ :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 = {
- "condition_type": {"key": "conditionType", "type": "str"},
- "condition_properties": {
- "key": "conditionProperties",
- "type": "AutomationRulePropertyArrayChangedValuesCondition",
- },
+ "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,
*,
- condition_properties: Optional["_models.AutomationRulePropertyArrayChangedValuesCondition"] = None,
- **kwargs
- ):
+ url: Optional[str] = None,
+ full_name: Optional[str] = None,
+ installation_id: Optional[int] = None,
+ branches: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword condition_properties:
- :paramtype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayChangedValuesCondition
+ :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.condition_type: str = "PropertyArrayChanged"
- self.condition_properties = condition_properties
+ 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 PropertyArrayConditionProperties(AutomationRuleCondition):
- """Describes an automation rule condition that evaluates an array property's value.
+ 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 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 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 = {
- "condition_type": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
- "condition_type": {"key": "conditionType", "type": "str"},
- "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyArrayValuesCondition"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[Repo]"},
}
def __init__(
- self, *, condition_properties: Optional["_models.AutomationRulePropertyArrayValuesCondition"] = None, **kwargs
- ):
+ self,
+ *,
+ value: List["_models.Repo"],
+ **kwargs: Any
+ ) -> None:
"""
- :keyword condition_properties:
- :paramtype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyArrayValuesCondition
+ :keyword value: Array of repositories. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.Repo]
"""
super().__init__(**kwargs)
- self.condition_type: str = "PropertyArray"
- self.condition_properties = condition_properties
-
-
-class PropertyChangedConditionProperties(AutomationRuleCondition):
- """Describes an automation rule condition that evaluates a property's value change.
+ self.next_link = None
+ self.value = value
- All required parameters must be populated in order to send to Azure.
+class ReportActionStatusPayload(_serialization.Model):
+ """Report the status of an action that was performed by the agent.
- :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
+ :ivar action_id: The action ID to perform.
+ :vartype action_id: str
+ :ivar action_status: The status of the action that was performed by the agent.
+ :vartype action_status: str
+ :ivar failure_reason: The reason of the failure of the action. Empty if the action is
+ successful.
+ :vartype failure_reason: str
"""
- _validation = {
- "condition_type": {"required": True},
- }
-
_attribute_map = {
- "condition_type": {"key": "conditionType", "type": "str"},
- "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyValuesChangedCondition"},
+ "action_id": {"key": "actionId", "type": "str"},
+ "action_status": {"key": "actionStatus", "type": "str"},
+ "failure_reason": {"key": "failureReason", "type": "str"},
}
def __init__(
- self, *, condition_properties: Optional["_models.AutomationRulePropertyValuesChangedCondition"] = None, **kwargs
- ):
+ self,
+ *,
+ action_id: Optional[str] = None,
+ action_status: Optional[str] = None,
+ failure_reason: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword condition_properties:
- :paramtype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesChangedCondition
+ :keyword action_id: The action ID to perform.
+ :paramtype action_id: str
+ :keyword action_status: The status of the action that was performed by the agent.
+ :paramtype action_status: str
+ :keyword failure_reason: The reason of the failure of the action. Empty if the action is
+ successful.
+ :paramtype failure_reason: str
"""
super().__init__(**kwargs)
- self.condition_type: str = "PropertyChanged"
- self.condition_properties = condition_properties
+ self.action_id = action_id
+ self.action_status = action_status
+ self.failure_reason = failure_reason
+class Repository(_serialization.Model):
+ """metadata of a repository.
-class PropertyConditionProperties(AutomationRuleCondition):
- """Describes an automation rule condition that evaluates a property's value.
+ 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 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 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 = {
- "condition_type": {"required": True},
+ 'url': {'required': True},
+ 'branch': {'required': True},
+ 'deployment_logs_url': {'readonly': True},
}
_attribute_map = {
- "condition_type": {"key": "conditionType", "type": "str"},
- "condition_properties": {"key": "conditionProperties", "type": "AutomationRulePropertyValuesCondition"},
+ "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, *, condition_properties: Optional["_models.AutomationRulePropertyValuesCondition"] = None, **kwargs
- ):
+ self,
+ *,
+ url: str,
+ branch: str,
+ display_url: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :keyword condition_properties:
- :paramtype condition_properties:
- ~azure.mgmt.securityinsight.models.AutomationRulePropertyValuesCondition
+ :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.condition_type: str = "Property"
- self.condition_properties = condition_properties
-
+ self.url = url
+ self.branch = branch
+ self.display_url = display_url
+ self.deployment_logs_url = None
-class Recommendation(_serialization.Model): # pylint: disable=too-many-instance-attributes
- """Recommendation object.
+class RepositoryAccess(_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: id of recommendation. Required.
- :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 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": {"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},
+ 'kind': {'required': 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]"},
+ "kind": {"key": "kind", "type": "str"},
+ "code": {"key": "code", "type": "str"},
"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"},
+ "client_id": {"key": "clientId", "type": "str"},
+ "token": {"key": "token", "type": "str"},
+ "installation_id": {"key": "installationId", "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
+ 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.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
+ super().__init__(**kwargs)
+ self.kind = kind
+ self.code = code
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
+ self.client_id = client_id
+ self.token = token
+ self.installation_id = installation_id
+class RepositoryAccessProperties(_serialization.Model):
+ """Credentials to access repository.
-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 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 = {
+ 'kind': {'required': True},
+ }
+
_attribute_map = {
- "value": {"key": "value", "type": "[Recommendation]"},
+ "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, *, value: Optional[List["_models.Recommendation"]] = None, **kwargs):
- """
- :keyword value: An list of recommendations.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Recommendation]
+ 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.value = value
+ self.kind = kind
+ self.code = code
+ self.state = state
+ self.client_id = client_id
+ self.token = token
+ self.installation_id = installation_id
+class RepositoryResourceInfo(_serialization.Model):
+ """Resources created in user's repository for the source-control.
-class RecommendationPatch(_serialization.Model):
- """Recommendation Fields to update.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :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 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 = {
+ 'git_hub_resource_info': {'readonly': True},
+ 'azure_dev_ops_resource_info': {'readonly': True},
+ }
+
_attribute_map = {
- "state": {"key": "state", "type": "str"},
- "hide_until_time_utc": {"key": "hideUntilTimeUtc", "type": "iso-8601"},
+ "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,
*,
- state: Optional[Union[str, "_models.State"]] = None,
- hide_until_time_utc: Optional[datetime.datetime] = None,
- **kwargs
- ):
+ webhook: Optional["_models.Webhook"] = None,
+ **kwargs: Any
+ ) -> None:
"""
- :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
+ :keyword webhook: The webhook object created for the source-control.
+ :paramtype webhook: ~azure.mgmt.securityinsight.models.Webhook
"""
super().__init__(**kwargs)
- self.state = state
- self.hide_until_time_utc = hide_until_time_utc
-
-
-class RecommendedAction(_serialization.Model):
- """What actions should be taken to complete the recommendation.
+ self.webhook = webhook
+ self.git_hub_resource_info = None
+ self.azure_dev_ops_resource_info = None
- All required parameters must be populated in order to send to Azure.
+class RequiredPermissions(_serialization.Model):
+ """Required permissions for the connector.
- :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 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
"""
- _validation = {
- "link_text": {"required": True},
- "link_url": {"required": True},
+ _attribute_map = {
+ "action": {"key": "action", "type": "bool"},
+ "write": {"key": "write", "type": "bool"},
+ "read": {"key": "read", "type": "bool"},
+ "delete": {"key": "delete", "type": "bool"},
}
+ def __init__(
+ self,
+ *,
+ action: Optional[bool] = None,
+ write: Optional[bool] = None,
+ read: Optional[bool] = None,
+ delete: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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
+ """
+ super().__init__(**kwargs)
+ self.action = action
+ self.write = write
+ self.read = read
+ self.delete = delete
+
+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 = {
- "link_text": {"key": "linkText", "type": "str"},
- "link_url": {"key": "linkUrl", "type": "str"},
- "state": {"key": "state", "type": "str"},
+ "read": {"key": "read", "type": "bool"},
+ "write": {"key": "write", "type": "bool"},
+ "delete": {"key": "delete", "type": "bool"},
+ "action": {"key": "action", "type": "bool"},
}
def __init__(
- self, *, link_text: str, link_url: str, state: Optional[Union[str, "_models.Priority"]] = None, **kwargs
- ):
+ self,
+ *,
+ read: Optional[bool] = None,
+ write: Optional[bool] = None,
+ delete: Optional[bool] = None,
+ action: Optional[bool] = None,
+ **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 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.link_text = link_text
- self.link_url = link_url
- self.state = state
-
+ self.read = read
+ self.write = write
+ self.delete = delete
+ self.action = action
-class RegistryKeyEntity(Entity):
- """Represents a registry key entity.
+class RestApiPollerDataConnector(DataConnector): # pylint: disable=too-many-instance-attributes
+ """Represents Rest Api Poller 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
@@ -18334,36 +24826,44 @@ class RegistryKeyEntity(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 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 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",
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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 = {
- "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},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -18371,514 +24871,1114 @@ class RegistryKeyEntity(Entity):
"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"},
- "hive": {"key": "properties.hive", "type": "str"},
- "key": {"key": "properties.key", "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, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.kind: str = "RegistryKey"
- self.additional_data = None
- self.friendly_name = None
- self.hive = None
- self.key = None
+ 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 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.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 RestApiPollerRequestConfig(_serialization.Model): # pylint: disable=too-many-instance-attributes
+ """The request configuration.
-class RegistryKeyEntityProperties(EntityCommonProperties):
- """RegistryKey entity property bag.
+ 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.
+ :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
+ """
- :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 = {
+ 'api_endpoint': {'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"},
+ "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,
+ *,
+ 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 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.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 RestApiPollerRequestPagingConfig(_serialization.Model):
+ """The request paging configuration.
+
+ 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 = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "hive": {"readonly": True},
- "key": {"readonly": True},
+ 'paging_type': {'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"},
+ "paging_type": {"key": "pagingType", "type": "str"},
+ "page_size": {"key": "pageSize", "type": "int"},
+ "page_size_parameter_name": {"key": "pageSizeParameterName", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ 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.hive = None
- self.key = None
+ 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.
-class RegistryValueEntity(Entity): # pylint: disable=too-many-instance-attributes
- """Represents a registry value entity.
+ 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.
+ :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
+ """
- All required parameters must be populated in order to send to Azure.
+ _validation = {
+ 'paging_type': {'required': True},
+ }
- :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
+ _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,
+ *,
+ 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__(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 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 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 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 = {
- "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},
+ 'paging_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"},
- "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"},
+ "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, **kwargs):
- """ """
- 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
-
+ 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__(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 RegistryValueEntityProperties(EntityCommonProperties):
- """RegistryValue entity property bag.
+class RestApiPollerRequestPagingNextPageUrlConfig(RestApiPollerRequestPagingConfig): # pylint: disable=name-too-long
+ """The request paging configuration for NextPageUrl paging type parameters.
- 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 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 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 = {
- "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},
+ 'paging_type': {'required': 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"},
+ "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, **kwargs):
- """ """
- super().__init__(**kwargs)
- self.key_entity_id = None
- self.value_data = None
- self.value_name = None
- self.value_type = None
-
+ def __init__(
+ self,
+ *,
+ 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__(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 Relation(ResourceWithEtag):
- """Represents a relation between two resources.
+class RestApiPollerRequestPagingOffsetConfig(RestApiPollerRequestPagingConfig):
+ """The request paging configuration for Offset paging type parameters.
- 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 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 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 = {
- "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},
+ 'paging_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"},
- "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"},
+ "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, *, etag: Optional[str] = None, related_resource_id: Optional[str] = None, **kwargs):
- """
- :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
+ def __init__(
+ self,
+ *,
+ 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__(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.
+ 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
- Variables are only populated by the server, and will be ignored when sending a request.
+class RestApiPollerRequestPagingTokenConfig(RestApiPollerRequestPagingConfig):
+ """The request paging configuration for NextPageToken and PersistentToken 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 relations.
- :vartype next_link: str
- :ivar value: Array of relations. Required.
- :vartype value: list[~azure.mgmt.securityinsight.models.Relation]
+ :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 = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'paging_type': {'required': True},
}
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[Relation]"},
+ "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, *, value: List["_models.Relation"], **kwargs):
- """
- :keyword value: Array of relations. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Relation]
+ def __init__(
+ self,
+ *,
+ 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.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.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 SystemsConfigurationConnector(_serialization.Model):
+ """Base Model for SAP System Connector.
-class Repo(_serialization.Model):
- """Represents a repository.
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ RfcConnector, SapControlConnector
- :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 type: Represents the types of SAP systems. Required. Known values are: "Rfc" and
+ "SapControl".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.SystemConfigurationConnectorType
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
- "url": {"key": "url", "type": "str"},
- "full_name": {"key": "fullName", "type": "str"},
- "branches": {"key": "branches", "type": "[str]"},
+ "type": {"key": "type", "type": "str"},
+ }
+
+ _subtype_map = {
+ 'type': {'Rfc': 'RfcConnector', 'SapControl': 'SapControlConnector'}
+ }
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.type: Optional[str] = None
+
+class RfcConnector(SystemsConfigurationConnector): # pylint: disable=too-many-instance-attributes
+ """Describes the Rfc connector.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar type: Represents the types of SAP systems. Required. Known values are: "Rfc" and
+ "SapControl".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.SystemConfigurationConnectorType
+ :ivar abap_server_host: FQDN, hostname, or IP address of the ABAP server.
+ :vartype abap_server_host: str
+ :ivar message_server_host: FQDN, hostname, or IP address of the Message server.
+ :vartype message_server_host: str
+ :ivar group: Logon group of the message server.
+ :vartype group: str
+ :ivar message_server_service: Port number, or service name (from /etc/services) of the message
+ server.
+ :vartype message_server_service: str
+ :ivar snc_qop: SNC QOP.
+ Options are 1, 2, 3, 8, 9.
+ :vartype snc_qop: str
+ :ivar code_page: The SAP code page used for character encoding.
+ Example - 1100.
+ :vartype code_page: str
+ :ivar system_number: System number of the ABAP server. Required.
+ :vartype system_number: str
+ :ivar system_id: System ID of the ABAP server.
+ Example - A4H. Required.
+ :vartype system_id: str
+ :ivar client: Client number of the ABAP server.
+ Example - 001. Required.
+ :vartype client: str
+ :ivar authentication_type: The authentication type to SAP. Known values are:
+ "UsernamePassword", "Snc", and "SncWithUsernamePassword".
+ :vartype authentication_type: str or ~azure.mgmt.securityinsight.models.SapAuthenticationType
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ 'snc_qop': {'pattern': r'^[1,2,3,8,9]$'},
+ 'code_page': {'pattern': r'^(?:[a-zA-Z0-9]{4}|UTF-8)$'},
+ 'system_number': {'required': True, 'min_length': 1, 'pattern': r'^\d{1,3}$'},
+ 'system_id': {'required': True, 'min_length': 1, 'pattern': r'^[a-zA-Z0-9]{3}$'},
+ 'client': {'required': True, 'min_length': 1, 'pattern': r'^[0-9]{3}$'},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "abap_server_host": {"key": "abapServerHost", "type": "str"},
+ "message_server_host": {"key": "messageServerHost", "type": "str"},
+ "group": {"key": "group", "type": "str"},
+ "message_server_service": {"key": "messageServerService", "type": "str"},
+ "snc_qop": {"key": "sncQop", "type": "str"},
+ "code_page": {"key": "codePage", "type": "str"},
+ "system_number": {"key": "systemNumber", "type": "str"},
+ "system_id": {"key": "systemId", "type": "str"},
+ "client": {"key": "client", "type": "str"},
+ "authentication_type": {"key": "authenticationType", "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]
- """
- super().__init__(**kwargs)
- self.url = url
- self.full_name = full_name
- self.branches = branches
-
-
-class RepoList(_serialization.Model):
- """List all the source controls.
-
- Variables are only populated by the server, and will be ignored when sending a request.
+ system_number: str,
+ system_id: str,
+ client: str,
+ abap_server_host: Optional[str] = None,
+ message_server_host: Optional[str] = None,
+ group: Optional[str] = None,
+ message_server_service: Optional[str] = None,
+ snc_qop: Optional[str] = None,
+ code_page: Optional[str] = None,
+ authentication_type: Optional[Union[str, "_models.SapAuthenticationType"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword abap_server_host: FQDN, hostname, or IP address of the ABAP server.
+ :paramtype abap_server_host: str
+ :keyword message_server_host: FQDN, hostname, or IP address of the Message server.
+ :paramtype message_server_host: str
+ :keyword group: Logon group of the message server.
+ :paramtype group: str
+ :keyword message_server_service: Port number, or service name (from /etc/services) of the
+ message server.
+ :paramtype message_server_service: str
+ :keyword snc_qop: SNC QOP.
+ Options are 1, 2, 3, 8, 9.
+ :paramtype snc_qop: str
+ :keyword code_page: The SAP code page used for character encoding.
+ Example - 1100.
+ :paramtype code_page: str
+ :keyword system_number: System number of the ABAP server. Required.
+ :paramtype system_number: str
+ :keyword system_id: System ID of the ABAP server.
+ Example - A4H. Required.
+ :paramtype system_id: str
+ :keyword client: Client number of the ABAP server.
+ Example - 001. Required.
+ :paramtype client: str
+ :keyword authentication_type: The authentication type to SAP. Known values are:
+ "UsernamePassword", "Snc", and "SncWithUsernamePassword".
+ :paramtype authentication_type: str or ~azure.mgmt.securityinsight.models.SapAuthenticationType
+ """
+ super().__init__(**kwargs)
+ self.type: str = 'Rfc'
+ self.abap_server_host = abap_server_host
+ self.message_server_host = message_server_host
+ self.group = group
+ self.message_server_service = message_server_service
+ self.snc_qop = snc_qop
+ self.code_page = code_page
+ self.system_number = system_number
+ self.system_id = system_id
+ self.client = client
+ self.authentication_type = authentication_type
+
+class SapAgentConfiguration(AgentConfiguration):
+ """Describes the configuration of a SAP Docker agent.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar type: Type of the agent. Required. "SAP"
+ :vartype type: str or ~azure.mgmt.securityinsight.models.AgentType
+ :ivar agent_container_name: The name of the docker agent.
+ only letters with numbers, underscores and hyphens are allowed
+ example: "my-agent".
+ :vartype agent_container_name: str
+ :ivar sdk_path: The SDK path (a file not a folder) on the agent machine.
+ example: "/path/to/nwrfc750P_8-70002755.zip".
+ :vartype sdk_path: str
+ :ivar snc_path: The SNC path (a folder not a file) on the agent machine.
+ example: "/path/to/snc".
+ :vartype snc_path: str
+ :ivar key_vault_resource_id: The key vault resource id to access the key vault.
+ example:
+ "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.KeyVault/vaults/myVault". # pylint: disable=line-too-long
+ :vartype key_vault_resource_id: str
+ :ivar key_vault_authentication_mode: The key mode of the agent.
+ ManagedIdentity|ApplicationIdentity are the options. Known values are: "ManagedIdentity" and
+ "ServicePrincipal".
+ :vartype key_vault_authentication_mode: str or
+ ~azure.mgmt.securityinsight.models.KeyVaultAuthenticationMode
+ :ivar secret_source: The secret source of the agent.
+ AzureKeyVault is the option. "AzureKeyVault"
+ :vartype secret_source: str or ~azure.mgmt.securityinsight.models.SecretSource
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ 'agent_container_name': {'pattern': r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'},
+ 'sdk_path': {'pattern': r'^/(([^/]+/)*nwrfc75.*\.zip$)|^((?:[a-zA-Z]:)?(?:\\|\\\\)(?:[^\\/:*?"<>|\r\n]+\\)*nwrfc75.*\.zip)$'},
+ 'snc_path': {'pattern': r'^\/(?:[^/]+\/)*[^/]+$|^(?:[a-zA-Z]:)?(?:\\|\\\\)(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$'},
+ 'key_vault_resource_id': {'pattern': r'^\/?subscriptions\/([^\/]+)\/resourceGroups\/([^\/]+)\/providers\/Microsoft\.KeyVault\/vaults\/([^\/]+)$'},
+ }
- All required parameters must be populated in order to send to Azure.
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "agent_container_name": {"key": "agentContainerName", "type": "str"},
+ "sdk_path": {"key": "sdkPath", "type": "str"},
+ "snc_path": {"key": "sncPath", "type": "str"},
+ "key_vault_resource_id": {"key": "keyVaultResourceId", "type": "str"},
+ "key_vault_authentication_mode": {"key": "keyVaultAuthenticationMode", "type": "str"},
+ "secret_source": {"key": "secretSource", "type": "str"},
+ }
- :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]
+ def __init__(
+ self,
+ *,
+ agent_container_name: Optional[str] = None,
+ sdk_path: Optional[str] = None,
+ snc_path: Optional[str] = None,
+ key_vault_resource_id: Optional[str] = None,
+ key_vault_authentication_mode: Optional[Union[str, "_models.KeyVaultAuthenticationMode"]] = None,
+ secret_source: Optional[Union[str, "_models.SecretSource"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword agent_container_name: The name of the docker agent.
+ only letters with numbers, underscores and hyphens are allowed
+ example: "my-agent".
+ :paramtype agent_container_name: str
+ :keyword sdk_path: The SDK path (a file not a folder) on the agent machine.
+ example: "/path/to/nwrfc750P_8-70002755.zip".
+ :paramtype sdk_path: str
+ :keyword snc_path: The SNC path (a folder not a file) on the agent machine.
+ example: "/path/to/snc".
+ :paramtype snc_path: str
+ :keyword key_vault_resource_id: The key vault resource id to access the key vault.
+ example:
+ "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.KeyVault/vaults/myVault". # pylint: disable=line-too-long
+ :paramtype key_vault_resource_id: str
+ :keyword key_vault_authentication_mode: The key mode of the agent.
+ ManagedIdentity|ApplicationIdentity are the options. Known values are: "ManagedIdentity" and
+ "ServicePrincipal".
+ :paramtype key_vault_authentication_mode: str or
+ ~azure.mgmt.securityinsight.models.KeyVaultAuthenticationMode
+ :keyword secret_source: The secret source of the agent.
+ AzureKeyVault is the option. "AzureKeyVault"
+ :paramtype secret_source: str or ~azure.mgmt.securityinsight.models.SecretSource
+ """
+ super().__init__(**kwargs)
+ self.type: str = 'SAP'
+ self.agent_container_name = agent_container_name
+ self.sdk_path = sdk_path
+ self.snc_path = snc_path
+ self.key_vault_resource_id = key_vault_resource_id
+ self.key_vault_authentication_mode = key_vault_authentication_mode
+ self.secret_source = secret_source
+
+class SapControlConnector(SystemsConfigurationConnector):
+ """Describes the SapControl connector configuration.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar type: Represents the types of SAP systems. Required. Known values are: "Rfc" and
+ "SapControl".
+ :vartype type: str or ~azure.mgmt.securityinsight.models.SystemConfigurationConnectorType
+ :ivar server: The server name.
+ FQDN or IP address. Required.
+ :vartype server: str
+ :ivar instance: The instance number. Only 2 digits are allowed. Required.
+ :vartype instance: str
+ :ivar timezone: The timezone.
+ example: "GMT+0" or "GMT-8"
+ default: "GMT+0".
+ :vartype timezone: str
+ :ivar port: The port of the SOAP connection to SAP Control.
+ :vartype port: str
+ :ivar https_configuration: Represents the types of HTTPS configuration to connect to the
+ SapControl service. Known values are: "HttpOnly", "HttpsWithSslVerification", and
+ "HttpsWithoutSslVerification".
+ :vartype https_configuration: str or ~azure.mgmt.securityinsight.models.HttpsConfigurationType
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'type': {'required': True},
+ 'server': {'required': True, 'min_length': 1, 'pattern': r'^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\.)+[a-zA-Z]{2,}$|^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'},
+ 'instance': {'required': True, 'min_length': 1, 'pattern': r'^\d{2}$'},
+ 'timezone': {'pattern': r'^GMT[+-]\d+$'},
+ 'port': {'pattern': r'^\d{1,5}$'},
}
_attribute_map = {
- "next_link": {"key": "nextLink", "type": "str"},
- "value": {"key": "value", "type": "[Repo]"},
+ "type": {"key": "type", "type": "str"},
+ "server": {"key": "server", "type": "str"},
+ "instance": {"key": "instance", "type": "str"},
+ "timezone": {"key": "timezone", "type": "str"},
+ "port": {"key": "port", "type": "str"},
+ "https_configuration": {"key": "httpsConfiguration", "type": "str"},
}
- def __init__(self, *, value: List["_models.Repo"], **kwargs):
- """
- :keyword value: Array of repositories. Required.
- :paramtype value: list[~azure.mgmt.securityinsight.models.Repo]
- """
- super().__init__(**kwargs)
- self.next_link = None
- self.value = value
+ def __init__(
+ self,
+ *,
+ server: str,
+ instance: str,
+ timezone: str = "GMT+0",
+ port: Optional[str] = None,
+ https_configuration: Optional[Union[str, "_models.HttpsConfigurationType"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword server: The server name.
+ FQDN or IP address. Required.
+ :paramtype server: str
+ :keyword instance: The instance number. Only 2 digits are allowed. Required.
+ :paramtype instance: str
+ :keyword timezone: The timezone.
+ example: "GMT+0" or "GMT-8"
+ default: "GMT+0".
+ :paramtype timezone: str
+ :keyword port: The port of the SOAP connection to SAP Control.
+ :paramtype port: str
+ :keyword https_configuration: Represents the types of HTTPS configuration to connect to the
+ SapControl service. Known values are: "HttpOnly", "HttpsWithSslVerification", and
+ "HttpsWithoutSslVerification".
+ :paramtype https_configuration: str or
+ ~azure.mgmt.securityinsight.models.HttpsConfigurationType
+ """
+ super().__init__(**kwargs)
+ self.type: str = 'SapControl'
+ self.server = server
+ self.instance = instance
+ self.timezone = timezone
+ self.port = port
+ self.https_configuration = https_configuration
+class SapSolutionUsageStatistic(BillingStatistic):
+ """Billing statistic about the Microsoft Sentinel solution for SAP Usage.
-class Repository(_serialization.Model):
- """metadata of a repository.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :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 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: Resource Etag.
+ :vartype etag: str
+ :ivar kind: The kind of the billing statistic. Required. "SapSolutionUsage"
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.BillingStatisticKind
+ :ivar active_system_id_count: The latest count of active SAP system IDs under the Microsoft
+ Sentinel solution for SAP Usage.
+ :vartype active_system_id_count: int
"""
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'etag': {'readonly': True},
+ 'kind': {'required': True},
+ 'active_system_id_count': {'readonly': 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]"},
+ "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"},
+ "active_system_id_count": {"key": "properties.activeSystemIdCount", "type": "int"},
}
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
- ):
+ **kwargs: Any
+ ) -> None:
"""
- :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]
"""
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
+ self.kind: str = 'SapSolutionUsage'
+ self.active_system_id_count = None
+class SystemsConfiguration(_serialization.Model):
+ """The configuration of the system.
-class RepositoryResourceInfo(_serialization.Model):
- """Resources created in user's repository for the source-control.
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ SapSystemsConfiguration
- :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 type: Represents the types of configuration for a system. Required. "SAP"
+ :vartype type: str or ~azure.mgmt.securityinsight.models.ConfigurationType
"""
+ _validation = {
+ '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"},
+ "type": {"key": "type", "type": "str"},
+ }
+
+ _subtype_map = {
+ 'type': {'SAP': 'SapSystemsConfiguration'}
}
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
- ):
+ **kwargs: Any
+ ) -> None:
"""
- :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
"""
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
+ self.type: Optional[str] = None
+class SapSystemsConfiguration(SystemsConfiguration):
+ """Describes the SAP configuration.
-class RequiredPermissions(_serialization.Model):
- """Required permissions for the connector.
+ All required parameters must be populated in order to send to server.
- :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
+ :ivar type: Represents the types of configuration for a system. Required. "SAP"
+ :vartype type: str or ~azure.mgmt.securityinsight.models.ConfigurationType
+ :ivar azure_resource_id: azure resource id
+ example:
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM". # pylint: disable=line-too-long
+ :vartype azure_resource_id: str
+ :ivar connector: Base Model for SAP System Connector. Required.
+ :vartype connector: ~azure.mgmt.securityinsight.models.SystemsConfigurationConnector
+ :ivar logs: The logs configuration.
+ :vartype logs: list[~azure.mgmt.securityinsight.models.Log]
"""
+ _validation = {
+ 'type': {'required': True},
+ 'azure_resource_id': {'pattern': r'^\/?subscriptions\/([^\/]+)\/resourceGroups\/([^\/]+)\/providers\/([^\/]+)\/([^\/]+)\/([^\/]+)$'},
+ 'connector': {'required': True},
+ }
+
_attribute_map = {
- "action": {"key": "action", "type": "bool"},
- "write": {"key": "write", "type": "bool"},
- "read": {"key": "read", "type": "bool"},
- "delete": {"key": "delete", "type": "bool"},
+ "type": {"key": "type", "type": "str"},
+ "azure_resource_id": {"key": "azureResourceId", "type": "str"},
+ "connector": {"key": "connector", "type": "SystemsConfigurationConnector"},
+ "logs": {"key": "logs", "type": "[Log]"},
}
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
+ connector: "_models.SystemsConfigurationConnector",
+ azure_resource_id: Optional[str] = None,
+ logs: Optional[List["_models.Log"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword azure_resource_id: azure resource id
+ example:
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM". # pylint: disable=line-too-long
+ :paramtype azure_resource_id: str
+ :keyword connector: Base Model for SAP System Connector. Required.
+ :paramtype connector: ~azure.mgmt.securityinsight.models.SystemsConfigurationConnector
+ :keyword logs: The logs configuration.
+ :paramtype logs: list[~azure.mgmt.securityinsight.models.Log]
"""
super().__init__(**kwargs)
- self.action = action
- self.write = write
- self.read = read
- self.delete = delete
-
+ self.type: str = 'SAP'
+ self.azure_resource_id = azure_resource_id
+ self.connector = connector
+ self.logs = logs
class ScheduledAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
"""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
@@ -18943,18 +26043,20 @@ class ScheduledAlertRule(AlertRule): # pylint: disable=too-many-instance-attrib
:vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
:ivar techniques: The techniques of the alert rule.
:vartype techniques: list[str]
+ :ivar sub_techniques: The sub-techniques of the alert rule.
+ :vartype sub_techniques: list[str]
: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
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
- "last_modified_utc": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'last_modified_utc': {'readonly': True},
}
_attribute_map = {
@@ -18985,6 +26087,7 @@ class ScheduledAlertRule(AlertRule): # pylint: disable=too-many-instance-attrib
"suppression_enabled": {"key": "properties.suppressionEnabled", "type": "bool"},
"tactics": {"key": "properties.tactics", "type": "[str]"},
"techniques": {"key": "properties.techniques", "type": "[str]"},
+ "sub_techniques": {"key": "properties.subTechniques", "type": "[str]"},
"incident_configuration": {"key": "properties.incidentConfiguration", "type": "IncidentConfiguration"},
}
@@ -19012,9 +26115,10 @@ def __init__( # pylint: disable=too-many-locals
suppression_enabled: Optional[bool] = None,
tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
techniques: Optional[List[str]] = None,
+ sub_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
@@ -19067,12 +26171,14 @@ def __init__( # pylint: disable=too-many-locals
:paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
:keyword techniques: The techniques of the alert rule.
:paramtype techniques: list[str]
+ :keyword sub_techniques: The sub-techniques of the alert rule.
+ :paramtype sub_techniques: list[str]
: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
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "Scheduled"
+ self.kind: str = 'Scheduled'
self.query = query
self.query_frequency = query_frequency
self.query_period = query_period
@@ -19094,9 +26200,9 @@ def __init__( # pylint: disable=too-many-locals
self.suppression_enabled = suppression_enabled
self.tactics = tactics
self.techniques = techniques
+ self.sub_techniques = sub_techniques
self.incident_configuration = incident_configuration
-
class ScheduledAlertRuleCommonProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
"""Scheduled alert rule template property bag.
@@ -19156,8 +26262,8 @@ def __init__(
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
@@ -19200,13 +26306,12 @@ def __init__(
self.alert_details_override = alert_details_override
self.sentinel_entities_mappings = sentinel_entities_mappings
-
class ScheduledAlertRuleProperties(ScheduledAlertRuleCommonProperties): # pylint: disable=too-many-instance-attributes
"""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
@@ -19257,17 +26362,19 @@ class ScheduledAlertRuleProperties(ScheduledAlertRuleCommonProperties): # pylin
:vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
:ivar techniques: The techniques of the alert rule.
:vartype techniques: list[str]
+ :ivar sub_techniques: The sub-techniques of the alert rule.
+ :vartype sub_techniques: list[str]
: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
"""
_validation = {
- "display_name": {"required": True},
- "enabled": {"required": True},
- "last_modified_utc": {"readonly": True},
- "suppression_duration": {"required": True},
- "suppression_enabled": {"required": True},
+ 'display_name': {'required': True},
+ 'enabled': {'required': True},
+ 'last_modified_utc': {'readonly': True},
+ 'suppression_duration': {'required': True},
+ 'suppression_enabled': {'required': True},
}
_attribute_map = {
@@ -19292,6 +26399,7 @@ class ScheduledAlertRuleProperties(ScheduledAlertRuleCommonProperties): # pylin
"suppression_enabled": {"key": "suppressionEnabled", "type": "bool"},
"tactics": {"key": "tactics", "type": "[str]"},
"techniques": {"key": "techniques", "type": "[str]"},
+ "sub_techniques": {"key": "subTechniques", "type": "[str]"},
"incident_configuration": {"key": "incidentConfiguration", "type": "IncidentConfiguration"},
}
@@ -19318,9 +26426,10 @@ def __init__(
description: Optional[str] = None,
tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
techniques: Optional[List[str]] = None,
+ sub_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
@@ -19371,24 +26480,13 @@ def __init__(
:paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
:keyword techniques: The techniques of the alert rule.
:paramtype techniques: list[str]
+ :keyword sub_techniques: The sub-techniques of the alert rule.
+ :paramtype sub_techniques: list[str]
: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
"""
- super().__init__(
- query=query,
- query_frequency=query_frequency,
- query_period=query_period,
- severity=severity,
- trigger_operator=trigger_operator,
- trigger_threshold=trigger_threshold,
- event_grouping_settings=event_grouping_settings,
- custom_details=custom_details,
- entity_mappings=entity_mappings,
- alert_details_override=alert_details_override,
- sentinel_entities_mappings=sentinel_entities_mappings,
- **kwargs
- )
+ super().__init__(query=query, query_frequency=query_frequency, query_period=query_period, severity=severity, trigger_operator=trigger_operator, trigger_threshold=trigger_threshold, event_grouping_settings=event_grouping_settings, 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
self.template_version = template_version
self.description = description
@@ -19399,18 +26497,18 @@ def __init__(
self.suppression_enabled = suppression_enabled
self.tactics = tactics
self.techniques = techniques
+ self.sub_techniques = sub_techniques
self.incident_configuration = incident_configuration
-
class ScheduledAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
"""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
@@ -19459,6 +26557,8 @@ class ScheduledAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many
:vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
:ivar techniques: The techniques of the alert rule.
:vartype techniques: list[str]
+ :ivar sub_techniques: The sub-techniques of the alert rule.
+ :vartype sub_techniques: list[str]
:ivar version: The version of this template - in format , where all are numbers. For
example <1.0.2>.
:vartype version: str
@@ -19477,13 +26577,13 @@ class ScheduledAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many
"""
_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},
+ '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 = {
@@ -19497,10 +26597,7 @@ class ScheduledAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many
"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]",
- },
+ "required_data_connectors": {"key": "properties.requiredDataConnectors", "type": "[AlertRuleTemplateDataSource]"},
"status": {"key": "properties.status", "type": "str"},
"query": {"key": "properties.query", "type": "str"},
"query_frequency": {"key": "properties.queryFrequency", "type": "duration"},
@@ -19510,6 +26607,7 @@ class ScheduledAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many
"trigger_threshold": {"key": "properties.triggerThreshold", "type": "int"},
"tactics": {"key": "properties.tactics", "type": "[str]"},
"techniques": {"key": "properties.techniques", "type": "[str]"},
+ "sub_techniques": {"key": "properties.subTechniques", "type": "[str]"},
"version": {"key": "properties.version", "type": "str"},
"event_grouping_settings": {"key": "properties.eventGroupingSettings", "type": "EventGroupingSettings"},
"custom_details": {"key": "properties.customDetails", "type": "{str}"},
@@ -19534,14 +26632,15 @@ def __init__( # pylint: disable=too-many-locals
trigger_threshold: Optional[int] = None,
tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
techniques: Optional[List[str]] = None,
+ sub_techniques: Optional[List[str]] = None,
version: Optional[str] = None,
event_grouping_settings: Optional["_models.EventGroupingSettings"] = None,
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.
@@ -19575,6 +26674,8 @@ def __init__( # pylint: disable=too-many-locals
:paramtype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
:keyword techniques: The techniques of the alert rule.
:paramtype techniques: list[str]
+ :keyword sub_techniques: The sub-techniques of the alert rule.
+ :paramtype sub_techniques: list[str]
:keyword version: The version of this template - in format , where all are numbers. For
example <1.0.2>.
:paramtype version: str
@@ -19592,7 +26693,7 @@ def __init__( # pylint: disable=too-many-locals
list[~azure.mgmt.securityinsight.models.SentinelEntityMapping]
"""
super().__init__(**kwargs)
- self.kind: str = "Scheduled"
+ self.kind: str = 'Scheduled'
self.alert_rules_created_by_template_count = alert_rules_created_by_template_count
self.created_date_utc = None
self.last_updated_date_utc = None
@@ -19608,6 +26709,7 @@ def __init__( # pylint: disable=too-many-locals
self.trigger_threshold = trigger_threshold
self.tactics = tactics
self.techniques = techniques
+ self.sub_techniques = sub_techniques
self.version = version
self.event_grouping_settings = event_grouping_settings
self.custom_details = custom_details
@@ -19615,16 +26717,15 @@ def __init__( # pylint: disable=too-many-locals
self.alert_details_override = alert_details_override
self.sentinel_entities_mappings = sentinel_entities_mappings
-
class SecurityAlert(Entity): # pylint: disable=too-many-instance-attributes
"""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
@@ -19638,7 +26739,7 @@ class SecurityAlert(Entity): # pylint: disable=too-many-instance-attributes
"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
+ :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]
@@ -19712,37 +26813,37 @@ class SecurityAlert(Entity): # pylint: disable=too-many-instance-attributes
"""
_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},
- "alert_display_name": {"readonly": True},
- "alert_type": {"readonly": True},
- "compromised_entity": {"readonly": True},
- "confidence_level": {"readonly": True},
- "confidence_reasons": {"readonly": True},
- "confidence_score": {"readonly": True},
- "confidence_score_status": {"readonly": True},
- "description": {"readonly": True},
- "end_time_utc": {"readonly": True},
- "intent": {"readonly": True},
- "provider_alert_id": {"readonly": True},
- "processing_end_time": {"readonly": True},
- "product_component_name": {"readonly": True},
- "product_name": {"readonly": True},
- "product_version": {"readonly": True},
- "remediation_steps": {"readonly": True},
- "start_time_utc": {"readonly": True},
- "status": {"readonly": True},
- "system_alert_id": {"readonly": True},
- "tactics": {"readonly": True},
- "time_generated": {"readonly": True},
- "vendor_name": {"readonly": True},
- "alert_link": {"readonly": True},
- "resource_identifiers": {"readonly": 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},
+ 'alert_display_name': {'readonly': True},
+ 'alert_type': {'readonly': True},
+ 'compromised_entity': {'readonly': True},
+ 'confidence_level': {'readonly': True},
+ 'confidence_reasons': {'readonly': True},
+ 'confidence_score': {'readonly': True},
+ 'confidence_score_status': {'readonly': True},
+ 'description': {'readonly': True},
+ 'end_time_utc': {'readonly': True},
+ 'intent': {'readonly': True},
+ 'provider_alert_id': {'readonly': True},
+ 'processing_end_time': {'readonly': True},
+ 'product_component_name': {'readonly': True},
+ 'product_name': {'readonly': True},
+ 'product_version': {'readonly': True},
+ 'remediation_steps': {'readonly': True},
+ 'start_time_utc': {'readonly': True},
+ 'status': {'readonly': True},
+ 'system_alert_id': {'readonly': True},
+ 'tactics': {'readonly': True},
+ 'time_generated': {'readonly': True},
+ 'vendor_name': {'readonly': True},
+ 'alert_link': {'readonly': True},
+ 'resource_identifiers': {'readonly': True},
}
_attribute_map = {
@@ -19757,10 +26858,7 @@ class SecurityAlert(Entity): # pylint: disable=too-many-instance-attributes
"alert_type": {"key": "properties.alertType", "type": "str"},
"compromised_entity": {"key": "properties.compromisedEntity", "type": "str"},
"confidence_level": {"key": "properties.confidenceLevel", "type": "str"},
- "confidence_reasons": {
- "key": "properties.confidenceReasons",
- "type": "[SecurityAlertPropertiesConfidenceReasonsItem]",
- },
+ "confidence_reasons": {"key": "properties.confidenceReasons", "type": "[SecurityAlertPropertiesConfidenceReasonsItem]"},
"confidence_score": {"key": "properties.confidenceScore", "type": "float"},
"confidence_score_status": {"key": "properties.confidenceScoreStatus", "type": "str"},
"description": {"key": "properties.description", "type": "str"},
@@ -19784,15 +26882,18 @@ 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".
:paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
"""
super().__init__(**kwargs)
- self.kind: str = "SecurityAlert"
+ self.kind: str = 'SecurityAlert'
self.additional_data = None
self.friendly_name = None
self.alert_display_name = None
@@ -19821,7 +26922,6 @@ def __init__( # pylint: disable=too-many-locals
self.alert_link = None
self.resource_identifiers = None
-
class SecurityAlertProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
"""SecurityAlert entity property bag.
@@ -19900,32 +27000,32 @@ class SecurityAlertProperties(EntityCommonProperties): # pylint: disable=too-ma
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "alert_display_name": {"readonly": True},
- "alert_type": {"readonly": True},
- "compromised_entity": {"readonly": True},
- "confidence_level": {"readonly": True},
- "confidence_reasons": {"readonly": True},
- "confidence_score": {"readonly": True},
- "confidence_score_status": {"readonly": True},
- "description": {"readonly": True},
- "end_time_utc": {"readonly": True},
- "intent": {"readonly": True},
- "provider_alert_id": {"readonly": True},
- "processing_end_time": {"readonly": True},
- "product_component_name": {"readonly": True},
- "product_name": {"readonly": True},
- "product_version": {"readonly": True},
- "remediation_steps": {"readonly": True},
- "start_time_utc": {"readonly": True},
- "status": {"readonly": True},
- "system_alert_id": {"readonly": True},
- "tactics": {"readonly": True},
- "time_generated": {"readonly": True},
- "vendor_name": {"readonly": True},
- "alert_link": {"readonly": True},
- "resource_identifiers": {"readonly": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'alert_display_name': {'readonly': True},
+ 'alert_type': {'readonly': True},
+ 'compromised_entity': {'readonly': True},
+ 'confidence_level': {'readonly': True},
+ 'confidence_reasons': {'readonly': True},
+ 'confidence_score': {'readonly': True},
+ 'confidence_score_status': {'readonly': True},
+ 'description': {'readonly': True},
+ 'end_time_utc': {'readonly': True},
+ 'intent': {'readonly': True},
+ 'provider_alert_id': {'readonly': True},
+ 'processing_end_time': {'readonly': True},
+ 'product_component_name': {'readonly': True},
+ 'product_name': {'readonly': True},
+ 'product_version': {'readonly': True},
+ 'remediation_steps': {'readonly': True},
+ 'start_time_utc': {'readonly': True},
+ 'status': {'readonly': True},
+ 'system_alert_id': {'readonly': True},
+ 'tactics': {'readonly': True},
+ 'time_generated': {'readonly': True},
+ 'vendor_name': {'readonly': True},
+ 'alert_link': {'readonly': True},
+ 'resource_identifiers': {'readonly': True},
}
_attribute_map = {
@@ -19959,8 +27059,11 @@ 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".
@@ -19993,8 +27096,7 @@ def __init__( # pylint: disable=too-many-locals
self.alert_link = None
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.
@@ -20006,8 +27108,8 @@ class SecurityAlertPropertiesConfidenceReasonsItem(_serialization.Model):
"""
_validation = {
- "reason": {"readonly": True},
- "reason_type": {"readonly": True},
+ 'reason': {'readonly': True},
+ 'reason_type': {'readonly': True},
}
_attribute_map = {
@@ -20015,19 +27117,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.
+ 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".
@@ -20061,15 +27166,15 @@ class SecurityAlertTimelineItem(EntityTimelineItem): # pylint: disable=too-many
"""
_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},
+ '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 = {
@@ -20100,8 +27205,8 @@ def __init__(
product_name: Optional[str] = None,
description: Optional[str] = None,
techniques: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword azure_resource_id: The alert azure resource id. Required.
:paramtype azure_resource_id: str
@@ -20126,7 +27231,7 @@ def __init__(
:paramtype techniques: list[str]
"""
super().__init__(**kwargs)
- self.kind: str = "SecurityAlert"
+ self.kind: str = 'SecurityAlert'
self.azure_resource_id = azure_resource_id
self.product_name = product_name
self.description = description
@@ -20139,16 +27244,15 @@ def __init__(
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
@@ -20162,7 +27266,7 @@ class SecurityGroupEntity(Entity):
"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
+ :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]
@@ -20180,16 +27284,16 @@ class SecurityGroupEntity(Entity):
"""
_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},
- "distinguished_name": {"readonly": True},
- "object_guid": {"readonly": True},
- "sid": {"readonly": 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},
+ 'distinguished_name': {'readonly': True},
+ 'object_guid': {'readonly': True},
+ 'sid': {'readonly': True},
}
_attribute_map = {
@@ -20205,17 +27309,20 @@ 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"
+ self.kind: str = 'SecurityGroup'
self.additional_data = None
self.friendly_name = None
self.distinguished_name = None
self.object_guid = None
self.sid = None
-
class SecurityGroupEntityProperties(EntityCommonProperties):
"""SecurityGroup entity property bag.
@@ -20238,11 +27345,11 @@ class SecurityGroupEntityProperties(EntityCommonProperties):
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "distinguished_name": {"readonly": True},
- "object_guid": {"readonly": True},
- "sid": {"readonly": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'distinguished_name': {'readonly': True},
+ 'object_guid': {'readonly': True},
+ 'sid': {'readonly': True},
}
_attribute_map = {
@@ -20253,14 +27360,17 @@ 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
self.object_guid = None
self.sid = None
-
class SecurityMLAnalyticsSettingsDataSource(_serialization.Model):
"""security ml analytics settings data sources.
@@ -20275,7 +27385,13 @@ 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
@@ -20286,13 +27402,12 @@ def __init__(self, *, connector_id: Optional[str] = None, data_types: Optional[L
self.connector_id = connector_id
self.data_types = data_types
-
class SecurityMLAnalyticsSettingsList(_serialization.Model):
"""List all the SecurityMLAnalyticsSettings.
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
@@ -20301,8 +27416,8 @@ class SecurityMLAnalyticsSettingsList(_serialization.Model):
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
@@ -20310,7 +27425,12 @@ class SecurityMLAnalyticsSettingsList(_serialization.Model):
"value": {"key": "value", "type": "[SecurityMLAnalyticsSetting]"},
}
- def __init__(self, *, value: List["_models.SecurityMLAnalyticsSetting"], **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.SecurityMLAnalyticsSetting"],
+ **kwargs: Any
+ ) -> None:
"""
:keyword value: Array of SecurityMLAnalyticsSettings. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.SecurityMLAnalyticsSetting]
@@ -20319,7 +27439,6 @@ def __init__(self, *, value: List["_models.SecurityMLAnalyticsSetting"], **kwarg
self.next_link = None
self.value = value
-
class SentinelEntityMapping(_serialization.Model):
"""A single sentinel entity mapping.
@@ -20331,7 +27450,12 @@ class SentinelEntityMapping(_serialization.Model):
"column_name": {"key": "columnName", "type": "str"},
}
- def __init__(self, *, column_name: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ column_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword column_name: the column name to be mapped to the SentinelEntities.
:paramtype column_name: str
@@ -20339,14 +27463,13 @@ def __init__(self, *, column_name: Optional[str] = None, **kwargs):
super().__init__(**kwargs)
self.column_name = column_name
-
class SentinelOnboardingState(ResourceWithEtag):
"""Sentinel onboarding state.
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
@@ -20363,10 +27486,10 @@ class SentinelOnboardingState(ResourceWithEtag):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
@@ -20378,7 +27501,13 @@ 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
@@ -20388,25 +27517,29 @@ def __init__(self, *, etag: Optional[str] = None, customer_managed_key: Optional
super().__init__(etag=etag, **kwargs)
self.customer_managed_key = customer_managed_key
-
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]
"""
_validation = {
- "value": {"required": True},
+ 'value': {'required': True},
}
_attribute_map = {
"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]
@@ -20414,40 +27547,182 @@ def __init__(self, *, value: List["_models.SentinelOnboardingState"], **kwargs):
super().__init__(**kwargs)
self.value = value
+class ServicePrincipal(_serialization.Model):
+ """Service principal metadata.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :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 = {
+ 'id': {'readonly': True},
+ 'tenant_id': {'readonly': True},
+ 'app_id': {'readonly': True},
+ }
+
+ _attribute_map = {
+ "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,
+ *,
+ credentials_expire_on: Optional[datetime.datetime] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword credentials_expire_on: Expiration time of service principal credentials.
+ :paramtype credentials_expire_on: ~datetime.datetime
+ """
+ super().__init__(**kwargs)
+ 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 SettingList(_serialization.Model):
"""List of all the settings.
- 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.
+
+ All required parameters must be populated in order to send to server.
:ivar value: Array of settings. Required.
:vartype value: list[~azure.mgmt.securityinsight.models.Settings]
+ :ivar next_link: URL to fetch the next set of settings.
+ :vartype next_link: str
"""
_validation = {
- "value": {"required": True},
+ 'value': {'required': True},
+ 'next_link': {'readonly': True},
}
_attribute_map = {
"value": {"key": "value", "type": "[Settings]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
- def __init__(self, *, value: List["_models.Settings"], **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.Settings"],
+ **kwargs: Any
+ ) -> None:
"""
:keyword value: Array of settings. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.Settings]
"""
super().__init__(**kwargs)
self.value = value
-
+ self.next_link = None
class SourceControl(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
"""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,29 +27739,44 @@ 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 = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ 'id': {'readonly': True},
+ '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,69 +27792,70 @@ 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):
"""List all the source controls.
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
@@ -20573,8 +27864,8 @@ class SourceControlList(_serialization.Model):
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
@@ -20582,7 +27873,12 @@ 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]
@@ -20591,16 +27887,15 @@ def __init__(self, *, value: List["_models.SourceControl"], **kwargs):
self.next_link = None
self.value = value
-
class SubmissionMailEntity(Entity): # pylint: disable=too-many-instance-attributes
"""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
@@ -20614,7 +27909,7 @@ class SubmissionMailEntity(Entity): # pylint: disable=too-many-instance-attribu
"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
+ :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]
@@ -20645,23 +27940,23 @@ class SubmissionMailEntity(Entity): # pylint: disable=too-many-instance-attribu
"""
_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_id": {"readonly": True},
- "submission_id": {"readonly": True},
- "submitter": {"readonly": True},
- "submission_date": {"readonly": True},
- "timestamp": {"readonly": True},
- "recipient": {"readonly": True},
- "sender": {"readonly": True},
- "sender_ip": {"readonly": True},
- "subject": {"readonly": True},
- "report_type": {"readonly": 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},
+ 'network_message_id': {'readonly': True},
+ 'submission_id': {'readonly': True},
+ 'submitter': {'readonly': True},
+ 'submission_date': {'readonly': True},
+ 'timestamp': {'readonly': True},
+ 'recipient': {'readonly': True},
+ 'sender': {'readonly': True},
+ 'sender_ip': {'readonly': True},
+ 'subject': {'readonly': True},
+ 'report_type': {'readonly': True},
}
_attribute_map = {
@@ -20684,10 +27979,14 @@ 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"
+ self.kind: str = 'SubmissionMail'
self.additional_data = None
self.friendly_name = None
self.network_message_id = None
@@ -20701,7 +28000,6 @@ def __init__(self, **kwargs):
self.subject = None
self.report_type = None
-
class SubmissionMailEntityProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
"""Submission mail entity property bag.
@@ -20737,18 +28035,18 @@ class SubmissionMailEntityProperties(EntityCommonProperties): # pylint: disable
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "network_message_id": {"readonly": True},
- "submission_id": {"readonly": True},
- "submitter": {"readonly": True},
- "submission_date": {"readonly": True},
- "timestamp": {"readonly": True},
- "recipient": {"readonly": True},
- "sender": {"readonly": True},
- "sender_ip": {"readonly": True},
- "subject": {"readonly": True},
- "report_type": {"readonly": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'network_message_id': {'readonly': True},
+ 'submission_id': {'readonly': True},
+ 'submitter': {'readonly': True},
+ 'submission_date': {'readonly': True},
+ 'timestamp': {'readonly': True},
+ 'recipient': {'readonly': True},
+ 'sender': {'readonly': True},
+ 'sender_ip': {'readonly': True},
+ 'subject': {'readonly': True},
+ 'report_type': {'readonly': True},
}
_attribute_map = {
@@ -20766,8 +28064,12 @@ 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
self.submission_id = None
@@ -20780,165 +28082,954 @@ def __init__(self, **kwargs):
self.subject = None
self.report_type = None
+class SystemData(_serialization.Model):
+ """Metadata pertaining to creation and last modification of the resource.
+
+ :ivar created_by: The identity that created the resource.
+ :vartype created_by: str
+ :ivar created_by_type: The type of identity that created the resource. Known values are:
+ "User", "Application", "ManagedIdentity", and "Key".
+ :vartype created_by_type: str or ~azure.mgmt.securityinsight.models.CreatedByType
+ :ivar created_at: The timestamp of resource creation (UTC).
+ :vartype created_at: ~datetime.datetime
+ :ivar last_modified_by: The identity that last modified the resource.
+ :vartype last_modified_by: str
+ :ivar last_modified_by_type: The type of identity that last modified the resource. Known values
+ are: "User", "Application", "ManagedIdentity", and "Key".
+ :vartype last_modified_by_type: str or ~azure.mgmt.securityinsight.models.CreatedByType
+ :ivar last_modified_at: The timestamp of resource last modification (UTC).
+ :vartype last_modified_at: ~datetime.datetime
+ """
+
+ _attribute_map = {
+ "created_by": {"key": "createdBy", "type": "str"},
+ "created_by_type": {"key": "createdByType", "type": "str"},
+ "created_at": {"key": "createdAt", "type": "iso-8601"},
+ "last_modified_by": {"key": "lastModifiedBy", "type": "str"},
+ "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"},
+ "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"},
+ }
+
+ def __init__(
+ self,
+ *,
+ created_by: Optional[str] = None,
+ created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
+ created_at: Optional[datetime.datetime] = None,
+ last_modified_by: Optional[str] = None,
+ last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
+ last_modified_at: Optional[datetime.datetime] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword created_by: The identity that created the resource.
+ :paramtype created_by: str
+ :keyword created_by_type: The type of identity that created the resource. Known values are:
+ "User", "Application", "ManagedIdentity", and "Key".
+ :paramtype created_by_type: str or ~azure.mgmt.securityinsight.models.CreatedByType
+ :keyword created_at: The timestamp of resource creation (UTC).
+ :paramtype created_at: ~datetime.datetime
+ :keyword last_modified_by: The identity that last modified the resource.
+ :paramtype last_modified_by: str
+ :keyword last_modified_by_type: The type of identity that last modified the resource. Known
+ values are: "User", "Application", "ManagedIdentity", and "Key".
+ :paramtype last_modified_by_type: str or ~azure.mgmt.securityinsight.models.CreatedByType
+ :keyword last_modified_at: The timestamp of resource last modification (UTC).
+ :paramtype last_modified_at: ~datetime.datetime
+ """
+ super().__init__(**kwargs)
+ self.created_by = created_by
+ self.created_by_type = created_by_type
+ self.created_at = created_at
+ self.last_modified_by = last_modified_by
+ self.last_modified_by_type = last_modified_by_type
+ self.last_modified_at = last_modified_at
+
+class SystemResource(ResourceWithEtag):
+ """Describes the system within the agent.
+
+ 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 status: The status of the system. Known values are: "Running" and "Stopped".
+ :vartype status: str or ~azure.mgmt.securityinsight.models.SystemStatusType
+ :ivar configuration: The configuration of the system. Required.
+ :vartype configuration: ~azure.mgmt.securityinsight.models.SystemsConfiguration
+ :ivar display_name: Required.
+ :vartype display_name: str
+ :ivar last_modified_time_utc:
+ :vartype last_modified_time_utc: ~datetime.datetime
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'configuration': {'required': True},
+ 'display_name': {'required': True, 'min_length': 1},
+ '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"},
+ "status": {"key": "properties.status", "type": "str"},
+ "configuration": {"key": "properties.configuration", "type": "SystemsConfiguration"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "last_modified_time_utc": {"key": "properties.lastModifiedTimeUtc", "type": "iso-8601"},
+ }
+
+ def __init__(
+ self,
+ *,
+ configuration: "_models.SystemsConfiguration",
+ display_name: str,
+ etag: Optional[str] = None,
+ status: Optional[Union[str, "_models.SystemStatusType"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword status: The status of the system. Known values are: "Running" and "Stopped".
+ :paramtype status: str or ~azure.mgmt.securityinsight.models.SystemStatusType
+ :keyword configuration: The configuration of the system. Required.
+ :paramtype configuration: ~azure.mgmt.securityinsight.models.SystemsConfiguration
+ :keyword display_name: Required.
+ :paramtype display_name: str
+ """
+ super().__init__(etag=etag, **kwargs)
+ self.status = status
+ self.configuration = configuration
+ self.display_name = display_name
+ self.last_modified_time_utc = None
+
+class SystemsList(_serialization.Model):
+ """List of Agent's Systems.
+
+ :ivar value:
+ :vartype value: list[~azure.mgmt.securityinsight.models.SystemResource]
+ :ivar next_link:
+ :vartype next_link: str
+ """
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[SystemResource]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: Optional[List["_models.SystemResource"]] = None,
+ next_link: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value:
+ :paramtype value: list[~azure.mgmt.securityinsight.models.SystemResource]
+ :keyword next_link:
+ :paramtype next_link: str
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
+
+class TeamInformation(_serialization.Model):
+ """Describes team information.
+
+ 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: Any
+ ) -> None:
+ """
+ """
+ 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 server.
+
+ :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]
+ """
+
+ _validation = {
+ 'team_name': {'required': 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]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ team_name: str,
+ team_description: Optional[str] = None,
+ group_ids: Optional[List[str]] = None,
+ member_ids: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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]
+ """
+ super().__init__(**kwargs)
+ self.team_name = team_name
+ self.team_description = team_description
+ self.group_ids = group_ids
+ self.member_ids = member_ids
+
+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 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 = {
+ 'dependant_templates': {'readonly': True},
+ }
+
+ _attribute_map = {
+ "main_template": {"key": "mainTemplate", "type": "object"},
+ "dependant_templates": {"key": "dependantTemplates", "type": "[TemplateProperties]"},
+ }
+
+ 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.main_template = main_template
+ self.dependant_templates = None
+
+class TemplateList(_serialization.Model):
+ """List of all the template.
-class SystemData(_serialization.Model):
- """Metadata pertaining to creation and last modification of the resource.
+ Variables are only populated by the server, and will be ignored when sending a request.
- :ivar created_by: The identity that created the resource.
- :vartype created_by: str
- :ivar created_by_type: The type of identity that created the resource. Known values are:
- "User", "Application", "ManagedIdentity", and "Key".
- :vartype created_by_type: str or ~azure.mgmt.securityinsight.models.CreatedByType
- :ivar created_at: The timestamp of resource creation (UTC).
- :vartype created_at: ~datetime.datetime
- :ivar last_modified_by: The identity that last modified the resource.
- :vartype last_modified_by: str
- :ivar last_modified_by_type: The type of identity that last modified the resource. Known values
- are: "User", "Application", "ManagedIdentity", and "Key".
- :vartype last_modified_by_type: str or ~azure.mgmt.securityinsight.models.CreatedByType
- :ivar last_modified_at: The timestamp of resource last modification (UTC).
- :vartype last_modified_at: ~datetime.datetime
+ 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 = {
+ 'value': {'required': True},
+ 'next_link': {'readonly': True},
+ }
+
_attribute_map = {
- "created_by": {"key": "createdBy", "type": "str"},
- "created_by_type": {"key": "createdByType", "type": "str"},
- "created_at": {"key": "createdAt", "type": "iso-8601"},
- "last_modified_by": {"key": "lastModifiedBy", "type": "str"},
- "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"},
- "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"},
+ "value": {"key": "value", "type": "[TemplateModel]"},
+ "next_link": {"key": "nextLink", "type": "str"},
}
def __init__(
self,
*,
- created_by: Optional[str] = None,
- created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
- created_at: Optional[datetime.datetime] = None,
- last_modified_by: Optional[str] = None,
- last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
- last_modified_at: Optional[datetime.datetime] = None,
- **kwargs
- ):
+ value: List["_models.TemplateModel"],
+ **kwargs: Any
+ ) -> None:
"""
- :keyword created_by: The identity that created the resource.
- :paramtype created_by: str
- :keyword created_by_type: The type of identity that created the resource. Known values are:
- "User", "Application", "ManagedIdentity", and "Key".
- :paramtype created_by_type: str or ~azure.mgmt.securityinsight.models.CreatedByType
- :keyword created_at: The timestamp of resource creation (UTC).
- :paramtype created_at: ~datetime.datetime
- :keyword last_modified_by: The identity that last modified the resource.
- :paramtype last_modified_by: str
- :keyword last_modified_by_type: The type of identity that last modified the resource. Known
- values are: "User", "Application", "ManagedIdentity", and "Key".
- :paramtype last_modified_by_type: str or ~azure.mgmt.securityinsight.models.CreatedByType
- :keyword last_modified_at: The timestamp of resource last modification (UTC).
- :paramtype last_modified_at: ~datetime.datetime
+ :keyword value: Array of templates. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.TemplateModel]
"""
super().__init__(**kwargs)
- self.created_by = created_by
- self.created_by_type = created_by_type
- self.created_at = created_at
- self.last_modified_by = last_modified_by
- self.last_modified_by_type = last_modified_by_type
- self.last_modified_at = last_modified_at
-
+ self.value = value
+ self.next_link = None
-class TeamInformation(_serialization.Model):
- """Describes team information.
+class TemplateModel(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
+ """Template resource definition.
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.
+ :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 description: The description of the team.
- :vartype description: 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 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", and
+ "AutomationRule".
+ :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 = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'is_deprecated': {'readonly': True},
+ 'dependant_templates': {'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"},
+ "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"},
+ "main_template": {"key": "properties.mainTemplate", "type": "object"},
+ "dependant_templates": {"key": "properties.dependantTemplates", "type": "[TemplateProperties]"},
+ }
+
+ def __init__( # pylint: disable=too-many-locals
+ self,
+ *,
+ etag: Optional[str] = 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,
+ main_template: Optional[JSON] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :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 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", and
+ "AutomationRule".
+ :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.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 TemplateProperties(TemplateBaseProperties, TemplateAdditionalProperties): # pylint: disable=too-many-instance-attributes
+ """Template property bag.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :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 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", and
+ "AutomationRule".
+ :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 = {
- "team_id": {"readonly": True},
- "primary_channel_url": {"readonly": True},
- "team_creation_time_utc": {"readonly": True},
- "name": {"readonly": True},
- "description": {"readonly": True},
+ 'dependant_templates': {'readonly': True},
+ 'is_deprecated': {'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"},
+ "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__(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
-
+ def __init__( # pylint: disable=too-many-locals
+ self,
+ *,
+ 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,
+ 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 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", and
+ "AutomationRule".
+ :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__(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.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 TeamProperties(_serialization.Model):
- """Describes team properties.
+class ThreatActor(TIObject): # pylint: disable=too-many-instance-attributes
+ """Represents a threat actor 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 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]
- """
+ All required parameters must be populated in order to send to server.
- _validation = {
- "team_name": {"required": True},
+ :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 TI object. Required. Known values are: "AttackPattern", "Identity",
+ "Indicator", "Relationship", and "ThreatActor".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.TIObjectKind
+ :ivar data: The core STIX object that this TI object represents.
+ :vartype data: dict[str, any]
+ :ivar created_by: The UserInfo of the user/entity which originally created this TI object.
+ :vartype created_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar source: The source name for this TI object.
+ :vartype source: str
+ :ivar first_ingested_time_utc: The timestamp for the first time this object was ingested.
+ :vartype first_ingested_time_utc: ~datetime.datetime
+ :ivar last_ingested_time_utc: The timestamp for the last time this object was ingested.
+ :vartype last_ingested_time_utc: ~datetime.datetime
+ :ivar ingestion_rules_version: The ID of the rules version that was active when this TI object
+ was last ingested.
+ :vartype ingestion_rules_version: str
+ :ivar last_update_method: The name of the method/application that initiated the last write to
+ this TI object.
+ :vartype last_update_method: str
+ :ivar last_modified_by: The UserInfo of the user/entity which last modified this TI object.
+ :vartype last_modified_by: ~azure.mgmt.securityinsight.models.UserInfo
+ :ivar last_updated_date_time_utc: The timestamp for the last time this TI object was updated.
+ :vartype last_updated_date_time_utc: ~datetime.datetime
+ :ivar relationship_hints: A dictionary used to help follow relationships from this object to
+ other STIX objects. The keys are field names from the STIX object (in the 'data' field), and
+ the values are lists of sources that can be prepended to the object ID in order to efficiently
+ locate the target TI object.
+ :vartype relationship_hints: list[~azure.mgmt.securityinsight.models.RelationshipHint]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
+ 'data': {'readonly': True},
+ 'created_by': {'readonly': True},
+ 'source': {'readonly': True},
+ 'first_ingested_time_utc': {'readonly': True},
+ 'last_ingested_time_utc': {'readonly': True},
+ 'ingestion_rules_version': {'readonly': True},
+ 'last_update_method': {'readonly': True},
+ 'last_modified_by': {'readonly': True},
+ 'last_updated_date_time_utc': {'readonly': True},
+ 'relationship_hints': {'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]"},
+ "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"},
+ "data": {"key": "properties.data", "type": "{object}"},
+ "created_by": {"key": "properties.createdBy", "type": "UserInfo"},
+ "source": {"key": "properties.source", "type": "str"},
+ "first_ingested_time_utc": {"key": "properties.firstIngestedTimeUtc", "type": "iso-8601"},
+ "last_ingested_time_utc": {"key": "properties.lastIngestedTimeUtc", "type": "iso-8601"},
+ "ingestion_rules_version": {"key": "properties.ingestionRulesVersion", "type": "str"},
+ "last_update_method": {"key": "properties.lastUpdateMethod", "type": "str"},
+ "last_modified_by": {"key": "properties.lastModifiedBy", "type": "UserInfo"},
+ "last_updated_date_time_utc": {"key": "properties.lastUpdatedDateTimeUtc", "type": "iso-8601"},
+ "relationship_hints": {"key": "properties.relationshipHints", "type": "[RelationshipHint]"},
}
def __init__(
self,
- *,
- team_name: str,
- team_description: Optional[str] = None,
- group_ids: Optional[List[str]] = None,
- member_ids: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
- :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]
"""
super().__init__(**kwargs)
- self.team_name = team_name
- self.team_description = team_description
- self.group_ids = group_ids
- self.member_ids = member_ids
-
+ self.kind: str = 'ThreatActor'
class ThreatIntelligence(_serialization.Model):
"""ThreatIntelligence property bag.
@@ -20961,12 +29052,12 @@ class ThreatIntelligence(_serialization.Model):
"""
_validation = {
- "confidence": {"readonly": True},
- "provider_name": {"readonly": True},
- "report_link": {"readonly": True},
- "threat_description": {"readonly": True},
- "threat_name": {"readonly": True},
- "threat_type": {"readonly": 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 = {
@@ -20978,8 +29069,12 @@ class ThreatIntelligence(_serialization.Model):
"threat_type": {"key": "threatType", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
super().__init__(**kwargs)
self.confidence = None
self.provider_name = None
@@ -20988,16 +29083,15 @@ def __init__(self, **kwargs):
self.threat_name = None
self.threat_type = None
-
class ThreatIntelligenceAlertRule(AlertRule): # pylint: disable=too-many-instance-attributes
"""Represents Threat Intelligence 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
@@ -21030,20 +29124,23 @@ class ThreatIntelligenceAlertRule(AlertRule): # pylint: disable=too-many-instan
:vartype tactics: list[str or ~azure.mgmt.securityinsight.models.AttackTactic]
:ivar techniques: The techniques of the alert rule.
:vartype techniques: list[str]
+ :ivar sub_techniques: The sub-techniques of the alert rule.
+ :vartype sub_techniques: list[str]
"""
_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},
+ '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},
+ 'sub_techniques': {'readonly': True},
}
_attribute_map = {
@@ -21061,6 +29158,7 @@ class ThreatIntelligenceAlertRule(AlertRule): # pylint: disable=too-many-instan
"severity": {"key": "properties.severity", "type": "str"},
"tactics": {"key": "properties.tactics", "type": "[str]"},
"techniques": {"key": "properties.techniques", "type": "[str]"},
+ "sub_techniques": {"key": "properties.subTechniques", "type": "[str]"},
}
def __init__(
@@ -21069,8 +29167,8 @@ def __init__(
etag: Optional[str] = None,
alert_rule_template_name: Optional[str] = None,
enabled: Optional[bool] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -21081,7 +29179,7 @@ def __init__(
:paramtype enabled: bool
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "ThreatIntelligence"
+ self.kind: str = 'ThreatIntelligence'
self.alert_rule_template_name = alert_rule_template_name
self.description = None
self.display_name = None
@@ -21090,17 +29188,17 @@ def __init__(
self.severity = None
self.tactics = None
self.techniques = None
-
+ self.sub_techniques = None
class ThreatIntelligenceAlertRuleTemplate(AlertRuleTemplate): # pylint: disable=too-many-instance-attributes
"""Represents Threat Intelligence 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
@@ -21141,13 +29239,13 @@ class ThreatIntelligenceAlertRuleTemplate(AlertRuleTemplate): # pylint: disable
"""
_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},
+ '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 = {
@@ -21161,10 +29259,7 @@ class ThreatIntelligenceAlertRuleTemplate(AlertRuleTemplate): # pylint: disable
"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]",
- },
+ "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]"},
@@ -21182,8 +29277,8 @@ def __init__(
tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
techniques: Optional[List[str]] = None,
severity: Optional[Union[str, "_models.AlertSeverity"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword alert_rules_created_by_template_count: the number of alert rules that were created by
this template.
@@ -21207,7 +29302,7 @@ def __init__(
:paramtype severity: str or ~azure.mgmt.securityinsight.models.AlertSeverity
"""
super().__init__(**kwargs)
- self.kind: str = "ThreatIntelligence"
+ 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
@@ -21219,13 +29314,12 @@ def __init__(
self.techniques = techniques
self.severity = severity
-
-class ThreatIntelligenceAlertRuleTemplateProperties(AlertRuleTemplateWithMitreProperties):
+class ThreatIntelligenceAlertRuleTemplateProperties(AlertRuleTemplateWithMitreProperties): # pylint: disable=name-too-long
"""Threat Intelligence 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.
+ 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.
@@ -21254,9 +29348,9 @@ class ThreatIntelligenceAlertRuleTemplateProperties(AlertRuleTemplateWithMitrePr
"""
_validation = {
- "last_updated_date_utc": {"readonly": True},
- "created_date_utc": {"readonly": True},
- "severity": {"required": True},
+ 'last_updated_date_utc': {'readonly': True},
+ 'created_date_utc': {'readonly': True},
+ 'severity': {'required': True},
}
_attribute_map = {
@@ -21283,8 +29377,8 @@ def __init__(
status: Optional[Union[str, "_models.TemplateStatus"]] = None,
tactics: Optional[List[Union[str, "_models.AttackTactic"]]] = None,
techniques: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword alert_rules_created_by_template_count: the number of alert rules that were created by
this template.
@@ -21307,19 +29401,9 @@ def __init__(
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
- )
+ 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
-
class ThreatIntelligenceAppendTags(_serialization.Model):
"""Array of tags to be appended to the threat intelligence indicator.
@@ -21331,7 +29415,12 @@ 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]
@@ -21339,6 +29428,34 @@ def __init__(self, *, threat_intelligence_tags: Optional[List[str]] = None, **kw
super().__init__(**kwargs)
self.threat_intelligence_tags = threat_intelligence_tags
+class ThreatIntelligenceCount(_serialization.Model):
+ """Count of all the threat intelligence objects on the workspace that match the provided 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.
+
+ :ivar count: Count of all the threat intelligence objects on the workspace that match the
+ provided query. Required.
+ :vartype count: int
+ """
+
+ _validation = {
+ 'count': {'required': True, 'readonly': True},
+ }
+
+ _attribute_map = {
+ "count": {"key": "count", "type": "int"},
+ }
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.count = None
class ThreatIntelligenceExternalReference(_serialization.Model):
"""Describes external reference.
@@ -21371,8 +29488,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
@@ -21392,7 +29509,6 @@ def __init__(
self.url = url
self.hashes = hashes
-
class ThreatIntelligenceFilteringCriteria(_serialization.Model): # pylint: disable=too-many-instance-attributes
"""Filtering criteria for querying threat intelligence indicators.
@@ -21456,8 +29572,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
@@ -21501,7 +29617,6 @@ def __init__(
self.keywords = keywords
self.skip_token = skip_token
-
class ThreatIntelligenceGranularMarkingModel(_serialization.Model):
"""Describes threat granular marking model entity.
@@ -21525,8 +29640,8 @@ def __init__(
language: Optional[str] = None,
marking_ref: Optional[int] = None,
selectors: Optional[List[str]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword language: Language granular marking model.
:paramtype language: str
@@ -21540,7 +29655,6 @@ def __init__(
self.marking_ref = marking_ref
self.selectors = selectors
-
class ThreatIntelligenceInformation(ResourceWithEtag):
"""Threat intelligence information object.
@@ -21549,10 +29663,10 @@ class ThreatIntelligenceInformation(ResourceWithEtag):
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
@@ -21565,15 +29679,15 @@ class ThreatIntelligenceInformation(ResourceWithEtag):
: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
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.ThreatIntelligenceResourceInnerKind
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -21585,26 +29699,32 @@ class ThreatIntelligenceInformation(ResourceWithEtag):
"kind": {"key": "kind", "type": "str"},
}
- _subtype_map = {"kind": {"indicator": "ThreatIntelligenceIndicatorModel"}}
+ _subtype_map = {
+ 'kind': {'indicator': 'ThreatIntelligenceIndicatorModel'}
+ }
- 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
"""
super().__init__(etag=etag, **kwargs)
- self.kind: Optional[str] = None
-
+ 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.
+ 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
@@ -21617,7 +29737,7 @@ class ThreatIntelligenceIndicatorModel(ThreatIntelligenceInformation): # pylint
: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
+ :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]
@@ -21687,13 +29807,13 @@ class ThreatIntelligenceIndicatorModel(ThreatIntelligenceInformation): # 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},
+ '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 = {
@@ -21720,10 +29840,7 @@ class ThreatIntelligenceIndicatorModel(ThreatIntelligenceInformation): # pylint
"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]",
- },
+ "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"},
@@ -21770,8 +29887,8 @@ 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
@@ -21837,7 +29954,7 @@ def __init__( # pylint: disable=too-many-locals
:paramtype extensions: dict[str, any]
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "indicator"
+ self.kind: str = 'indicator'
self.additional_data = None
self.friendly_name = None
self.threat_intelligence_tags = threat_intelligence_tags
@@ -21869,7 +29986,6 @@ def __init__( # pylint: disable=too-many-locals
self.modified = modified
self.extensions = extensions
-
class ThreatIntelligenceIndicatorProperties(EntityCommonProperties): # pylint: disable=too-many-instance-attributes
"""Describes threat intelligence entity properties.
@@ -21944,8 +30060,8 @@ class ThreatIntelligenceIndicatorProperties(EntityCommonProperties): # pylint:
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
}
_attribute_map = {
@@ -22012,8 +30128,8 @@ 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 threat_intelligence_tags: List of tags.
:paramtype threat_intelligence_tags: list[str]
@@ -22106,13 +30222,12 @@ def __init__( # pylint: disable=too-many-locals
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.
+ 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
@@ -22121,8 +30236,8 @@ class ThreatIntelligenceInformationList(_serialization.Model):
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
@@ -22130,7 +30245,12 @@ class ThreatIntelligenceInformationList(_serialization.Model):
"value": {"key": "value", "type": "[ThreatIntelligenceInformation]"},
}
- def __init__(self, *, value: List["_models.ThreatIntelligenceInformation"], **kwargs):
+ def __init__(
+ self,
+ *,
+ value: List["_models.ThreatIntelligenceInformation"],
+ **kwargs: Any
+ ) -> None:
"""
:keyword value: Array of threat intelligence information objects. Required.
:paramtype value: list[~azure.mgmt.securityinsight.models.ThreatIntelligenceInformation]
@@ -22139,7 +30259,6 @@ def __init__(self, *, value: List["_models.ThreatIntelligenceInformation"], **kw
self.next_link = None
self.value = value
-
class ThreatIntelligenceKillChainPhase(_serialization.Model):
"""Describes threat kill chain phase entity.
@@ -22154,7 +30273,13 @@ class ThreatIntelligenceKillChainPhase(_serialization.Model):
"phase_name": {"key": "phaseName", "type": "str"},
}
- def __init__(self, *, kill_chain_name: Optional[str] = None, phase_name: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ kill_chain_name: Optional[str] = None,
+ phase_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword kill_chain_name: Kill chainName name.
:paramtype kill_chain_name: str
@@ -22165,6 +30290,44 @@ def __init__(self, *, kill_chain_name: Optional[str] = None, phase_name: Optiona
self.kill_chain_name = kill_chain_name
self.phase_name = phase_name
+class ThreatIntelligenceList(_serialization.Model):
+ """List all the threat intelligence objects on the workspace that match the provided 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.
+
+ :ivar next_link: URL to fetch the next set of threat intelligence objects.
+ :vartype next_link: str
+ :ivar value: Array of threat intelligence objects on the workspace that match the provided
+ query. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.TIObject]
+ """
+
+ _validation = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[TIObject]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: List["_models.TIObject"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Array of threat intelligence objects on the workspace that match the provided
+ query. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.TIObject]
+ """
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
class ThreatIntelligenceMetric(_serialization.Model):
"""Describes threat intelligence metric.
@@ -22196,8 +30359,8 @@ def __init__(
threat_type_metrics: Optional[List["_models.ThreatIntelligenceMetricEntity"]] = None,
pattern_type_metrics: Optional[List["_models.ThreatIntelligenceMetricEntity"]] = None,
source_metrics: Optional[List["_models.ThreatIntelligenceMetricEntity"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword last_updated_time_utc: Last updated indicator metric.
:paramtype last_updated_time_utc: str
@@ -22217,7 +30380,6 @@ def __init__(
self.pattern_type_metrics = pattern_type_metrics
self.source_metrics = source_metrics
-
class ThreatIntelligenceMetricEntity(_serialization.Model):
"""Describes threat intelligence metric entity.
@@ -22232,7 +30394,13 @@ class ThreatIntelligenceMetricEntity(_serialization.Model):
"metric_value": {"key": "metricValue", "type": "int"},
}
- def __init__(self, *, metric_name: Optional[str] = None, metric_value: Optional[int] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ metric_name: Optional[str] = None,
+ metric_value: Optional[int] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword metric_name: Metric name.
:paramtype metric_name: str
@@ -22243,7 +30411,6 @@ def __init__(self, *, metric_name: Optional[str] = None, metric_value: Optional[
self.metric_name = metric_name
self.metric_value = metric_value
-
class ThreatIntelligenceMetrics(_serialization.Model):
"""Threat intelligence metrics.
@@ -22255,7 +30422,12 @@ class ThreatIntelligenceMetrics(_serialization.Model):
"properties": {"key": "properties", "type": "ThreatIntelligenceMetric"},
}
- def __init__(self, *, properties: Optional["_models.ThreatIntelligenceMetric"] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ properties: Optional["_models.ThreatIntelligenceMetric"] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword properties: Threat intelligence metrics.
:paramtype properties: ~azure.mgmt.securityinsight.models.ThreatIntelligenceMetric
@@ -22263,25 +30435,29 @@ def __init__(self, *, properties: Optional["_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.
+ All required parameters must be populated in order to send to server.
: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},
+ 'value': {'required': True},
}
_attribute_map = {
"value": {"key": "value", "type": "[ThreatIntelligenceMetrics]"},
}
- def __init__(self, *, value: List["_models.ThreatIntelligenceMetrics"], **kwargs):
+ 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]
@@ -22289,7 +30465,6 @@ def __init__(self, *, value: List["_models.ThreatIntelligenceMetrics"], **kwargs
super().__init__(**kwargs)
self.value = value
-
class ThreatIntelligenceParsedPattern(_serialization.Model):
"""Describes parsed pattern entity.
@@ -22310,8 +30485,8 @@ def __init__(
*,
pattern_type_key: Optional[str] = None,
pattern_type_values: Optional[List["_models.ThreatIntelligenceParsedPatternTypeValue"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword pattern_type_key: Pattern type key.
:paramtype pattern_type_key: str
@@ -22323,7 +30498,6 @@ def __init__(
self.pattern_type_key = pattern_type_key
self.pattern_type_values = pattern_type_values
-
class ThreatIntelligenceParsedPatternTypeValue(_serialization.Model):
"""Describes threat kill chain phase entity.
@@ -22338,7 +30512,13 @@ class ThreatIntelligenceParsedPatternTypeValue(_serialization.Model):
"value": {"key": "value", "type": "str"},
}
- def __init__(self, *, value_type: Optional[str] = None, value: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ value_type: Optional[str] = None,
+ value: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword value_type: Type of the value.
:paramtype value_type: str
@@ -22349,7 +30529,6 @@ def __init__(self, *, value_type: Optional[str] = None, value: Optional[str] = N
self.value_type = value_type
self.value = value
-
class ThreatIntelligenceSortingCriteria(_serialization.Model):
"""List of available columns for sorting.
@@ -22357,8 +30536,7 @@ class ThreatIntelligenceSortingCriteria(_serialization.Model):
: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
+ :vartype sort_order: str or ~azure.mgmt.securityinsight.models.ThreatIntelligenceSortingOrder
"""
_attribute_map = {
@@ -22370,41 +30548,39 @@ def __init__(
self,
*,
item_key: Optional[str] = None,
- sort_order: Optional[Union[str, "_models.ThreatIntelligenceSortingCriteriaEnum"]] = None,
- **kwargs
- ):
+ sort_order: Optional[Union[str, "_models.ThreatIntelligenceSortingOrder"]] = 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
+ :paramtype sort_order: str or ~azure.mgmt.securityinsight.models.ThreatIntelligenceSortingOrder
"""
super().__init__(**kwargs)
self.item_key = item_key
self.sort_order = sort_order
-
class TICheckRequirements(DataConnectorsCheckRequirements):
"""Threat Intelligence Platforms data connector check requirements.
- 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".
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
"""
_validation = {
- "kind": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -22412,50 +30588,38 @@ class TICheckRequirements(DataConnectorsCheckRequirements):
"tenant_id": {"key": "properties.tenantId", "type": "str"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ tenant_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword tenant_id: The tenant id to connect to, and get the data from.
:paramtype tenant_id: str
"""
super().__init__(**kwargs)
- self.kind: str = "ThreatIntelligence"
+ self.kind: str = 'ThreatIntelligence'
self.tenant_id = tenant_id
-
class TICheckRequirementsProperties(DataConnectorTenantId):
"""Threat Intelligence Platforms data connector required 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.
: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 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
@@ -22470,10 +30634,10 @@ class TIDataConnector(DataConnector):
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
@@ -22484,11 +30648,11 @@ class TIDataConnector(DataConnector):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -22510,8 +30674,8 @@ def __init__(
tenant_id: Optional[str] = None,
tip_lookback_period: Optional[datetime.datetime] = None,
data_types: Optional["_models.TIDataConnectorDataTypes"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -22523,30 +30687,34 @@ def __init__(
:paramtype data_types: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypes
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "ThreatIntelligence"
+ 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.
+ All required parameters must be populated in order to send to server.
:ivar indicators: Data type for indicators connection. Required.
:vartype indicators: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypesIndicators
"""
_validation = {
- "indicators": {"required": True},
+ 'indicators': {'required': True},
}
_attribute_map = {
"indicators": {"key": "indicators", "type": "TIDataConnectorDataTypesIndicators"},
}
- def __init__(self, *, indicators: "_models.TIDataConnectorDataTypesIndicators", **kwargs):
+ def __init__(
+ self,
+ *,
+ indicators: "_models.TIDataConnectorDataTypesIndicators",
+ **kwargs: Any
+ ) -> None:
"""
:keyword indicators: Data type for indicators connection. Required.
:paramtype indicators: ~azure.mgmt.securityinsight.models.TIDataConnectorDataTypesIndicators
@@ -22554,38 +30722,20 @@ def __init__(self, *, indicators: "_models.TIDataConnectorDataTypesIndicators",
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.
+ 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
"""
- _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 TIDataConnectorProperties(DataConnectorTenantId):
"""TI (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.
:vartype tenant_id: str
@@ -22596,8 +30746,8 @@ class TIDataConnectorProperties(DataConnectorTenantId):
"""
_validation = {
- "tenant_id": {"required": True},
- "data_types": {"required": True},
+ 'tenant_id': {'required': True},
+ 'data_types': {'required': True},
}
_attribute_map = {
@@ -22612,8 +30762,8 @@ def __init__(
tenant_id: str,
data_types: "_models.TIDataConnectorDataTypes",
tip_lookback_period: Optional[datetime.datetime] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword tenant_id: The tenant id to connect to, and get the data from. Required.
:paramtype tenant_id: str
@@ -22626,11 +30776,10 @@ def __init__(
self.tip_lookback_period = tip_lookback_period
self.data_types = data_types
-
class TimelineAggregation(_serialization.Model):
"""timeline aggregation information per 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 count: the total items found for a kind. Required.
:vartype count: int
@@ -22640,8 +30789,8 @@ class TimelineAggregation(_serialization.Model):
"""
_validation = {
- "count": {"required": True},
- "kind": {"required": True},
+ 'count': {'required': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -22649,7 +30798,13 @@ class TimelineAggregation(_serialization.Model):
"kind": {"key": "kind", "type": "str"},
}
- def __init__(self, *, count: int, kind: Union[str, "_models.EntityTimelineKind"], **kwargs):
+ def __init__(
+ self,
+ *,
+ count: int,
+ kind: Union[str, "_models.EntityTimelineKind"],
+ **kwargs: Any
+ ) -> None:
"""
:keyword count: the total items found for a kind. Required.
:paramtype count: int
@@ -22661,11 +30816,10 @@ def __init__(self, *, count: int, kind: Union[str, "_models.EntityTimelineKind"]
self.count = count
self.kind = kind
-
class TimelineError(_serialization.Model):
"""Timeline Query Errors.
- 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".
@@ -22677,8 +30831,8 @@ class TimelineError(_serialization.Model):
"""
_validation = {
- "kind": {"required": True},
- "error_message": {"required": True},
+ 'kind': {'required': True},
+ 'error_message': {'required': True},
}
_attribute_map = {
@@ -22693,8 +30847,8 @@ def __init__(
kind: Union[str, "_models.EntityTimelineKind"],
error_message: str,
query_id: Optional[str] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword kind: the query kind. Required. Known values are: "Activity", "Bookmark",
"SecurityAlert", and "Anomaly".
@@ -22709,11 +30863,10 @@ def __init__(
self.query_id = query_id
self.error_message = error_message
-
class TimelineResultsMetadata(_serialization.Model):
"""Expansion result metadata.
- 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 total_count: the total items found for the timeline request. Required.
:vartype total_count: int
@@ -22724,8 +30877,8 @@ class TimelineResultsMetadata(_serialization.Model):
"""
_validation = {
- "total_count": {"required": True},
- "aggregations": {"required": True},
+ 'total_count': {'required': True},
+ 'aggregations': {'required': True},
}
_attribute_map = {
@@ -22740,8 +30893,8 @@ def __init__(
total_count: int,
aggregations: List["_models.TimelineAggregation"],
errors: Optional[List["_models.TimelineError"]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword total_count: the total items found for the timeline request. Required.
:paramtype total_count: int
@@ -22755,26 +30908,25 @@ def __init__(
self.aggregations = aggregations
self.errors = errors
-
class TiTaxiiCheckRequirements(DataConnectorsCheckRequirements):
"""Threat Intelligence TAXII data connector check requirements.
- 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".
+ "Office365Project", "MicrosoftPurviewInformationProtection", "OfficePowerBI",
+ "AmazonWebServicesCloudTrail", "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
"""
_validation = {
- "kind": {"required": True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -22782,50 +30934,38 @@ class TiTaxiiCheckRequirements(DataConnectorsCheckRequirements):
"tenant_id": {"key": "properties.tenantId", "type": "str"},
}
- def __init__(self, *, tenant_id: Optional[str] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ tenant_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword tenant_id: The tenant id to connect to, and get the data from.
:paramtype tenant_id: str
"""
super().__init__(**kwargs)
- self.kind: str = "ThreatIntelligenceTaxii"
+ self.kind: str = 'ThreatIntelligenceTaxii'
self.tenant_id = tenant_id
-
class TiTaxiiCheckRequirementsProperties(DataConnectorTenantId):
"""Threat Intelligence TAXII data connector required 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.
: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 TiTaxiiDataConnector(DataConnector): # pylint: disable=too-many-instance-attributes
"""Data connector to pull Threat intelligence data from TAXII 2.0/2.1 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.
+ 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
@@ -22840,10 +30980,10 @@ class TiTaxiiDataConnector(DataConnector): # pylint: disable=too-many-instance-
: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".
+ "MicrosoftPurviewInformationProtection", "OfficePowerBI", "AmazonWebServicesCloudTrail",
+ "AmazonWebServicesS3", "AzureAdvancedThreatProtection",
+ "MicrosoftDefenderAdvancedThreatProtection", "Dynamics365", "MicrosoftThreatProtection",
+ "MicrosoftThreatIntelligence", "GenericUI", "APIPolling", "IOT", "GCP", 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
@@ -22869,11 +31009,11 @@ class TiTaxiiDataConnector(DataConnector): # pylint: disable=too-many-instance-
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -22909,8 +31049,8 @@ def __init__(
taxii_lookback_period: Optional[datetime.datetime] = None,
polling_frequency: Optional[Union[str, "_models.PollingFrequency"]] = None,
data_types: Optional["_models.TiTaxiiDataConnectorDataTypes"] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -22937,7 +31077,7 @@ def __init__(
:paramtype data_types: ~azure.mgmt.securityinsight.models.TiTaxiiDataConnectorDataTypes
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "ThreatIntelligenceTaxii"
+ self.kind: str = 'ThreatIntelligenceTaxii'
self.tenant_id = tenant_id
self.workspace_id = workspace_id
self.friendly_name = friendly_name
@@ -22949,11 +31089,10 @@ def __init__(
self.polling_frequency = polling_frequency
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.
+ All required parameters must be populated in order to send to server.
:ivar taxii_client: Data type for TAXII connector. Required.
:vartype taxii_client:
@@ -22961,14 +31100,19 @@ class TiTaxiiDataConnectorDataTypes(_serialization.Model):
"""
_validation = {
- "taxii_client": {"required": True},
+ 'taxii_client': {'required': True},
}
_attribute_map = {
"taxii_client": {"key": "taxiiClient", "type": "TiTaxiiDataConnectorDataTypesTaxiiClient"},
}
- def __init__(self, *, taxii_client: "_models.TiTaxiiDataConnectorDataTypesTaxiiClient", **kwargs):
+ def __init__(
+ self,
+ *,
+ taxii_client: "_models.TiTaxiiDataConnectorDataTypesTaxiiClient",
+ **kwargs: Any
+ ) -> None:
"""
:keyword taxii_client: Data type for TAXII connector. Required.
:paramtype taxii_client:
@@ -22977,38 +31121,20 @@ def __init__(self, *, taxii_client: "_models.TiTaxiiDataConnectorDataTypesTaxiiC
super().__init__(**kwargs)
self.taxii_client = taxii_client
-
class TiTaxiiDataConnectorDataTypesTaxiiClient(DataConnectorDataTypeCommon):
"""Data type for TAXII connector.
- 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
"""
- _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.
+ 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
@@ -23035,9 +31161,9 @@ class TiTaxiiDataConnectorProperties(DataConnectorTenantId):
"""
_validation = {
- "tenant_id": {"required": True},
- "polling_frequency": {"required": True},
- "data_types": {"required": True},
+ 'tenant_id': {'required': True},
+ 'polling_frequency': {'required': True},
+ 'data_types': {'required': True},
}
_attribute_map = {
@@ -23066,8 +31192,8 @@ def __init__(
user_name: Optional[str] = None,
password: Optional[str] = None,
taxii_lookback_period: Optional[datetime.datetime] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword tenant_id: The tenant id to connect to, and get the data from. Required.
:paramtype tenant_id: str
@@ -23103,16 +31229,142 @@ def __init__(
self.polling_frequency = polling_frequency
self.data_types = data_types
+class TriggeredAnalyticsRuleRun(ResourceWithEtag):
+ """The triggered analytics rule run.
+
+ 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 execution_time_utc: Required.
+ :vartype execution_time_utc: ~datetime.datetime
+ :ivar rule_id: Required.
+ :vartype rule_id: str
+ :ivar triggered_analytics_rule_run_id: Required.
+ :vartype triggered_analytics_rule_run_id: str
+ :ivar provisioning_state: The triggered analytics rule run provisioning state. Required. Known
+ values are: "Accepted", "InProgress", "Succeeded", "Failed", and "Canceled".
+ :vartype provisioning_state: str or ~azure.mgmt.securityinsight.models.ProvisioningState
+ :ivar rule_run_additional_data: Dictionary of :code:``.
+ :vartype rule_run_additional_data: dict[str, any]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'execution_time_utc': {'required': True},
+ 'rule_id': {'required': True},
+ 'triggered_analytics_rule_run_id': {'required': True},
+ 'provisioning_state': {'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"},
+ "execution_time_utc": {"key": "properties.executionTimeUtc", "type": "iso-8601"},
+ "rule_id": {"key": "properties.ruleId", "type": "str"},
+ "triggered_analytics_rule_run_id": {"key": "properties.triggeredAnalyticsRuleRunId", "type": "str"},
+ "provisioning_state": {"key": "properties.provisioningState", "type": "str"},
+ "rule_run_additional_data": {"key": "properties.ruleRunAdditionalData", "type": "{object}"},
+ }
+
+ def __init__(
+ self,
+ *,
+ execution_time_utc: datetime.datetime,
+ rule_id: str,
+ triggered_analytics_rule_run_id: str,
+ provisioning_state: Union[str, "_models.ProvisioningState"],
+ etag: Optional[str] = None,
+ rule_run_additional_data: Optional[Dict[str, Any]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword etag: Etag of the azure resource.
+ :paramtype etag: str
+ :keyword execution_time_utc: Required.
+ :paramtype execution_time_utc: ~datetime.datetime
+ :keyword rule_id: Required.
+ :paramtype rule_id: str
+ :keyword triggered_analytics_rule_run_id: Required.
+ :paramtype triggered_analytics_rule_run_id: str
+ :keyword provisioning_state: The triggered analytics rule run provisioning state. Required.
+ Known values are: "Accepted", "InProgress", "Succeeded", "Failed", and "Canceled".
+ :paramtype provisioning_state: str or ~azure.mgmt.securityinsight.models.ProvisioningState
+ :keyword rule_run_additional_data: Dictionary of :code:``.
+ :paramtype rule_run_additional_data: dict[str, any]
+ """
+ super().__init__(etag=etag, **kwargs)
+ self.execution_time_utc = execution_time_utc
+ self.rule_id = rule_id
+ self.triggered_analytics_rule_run_id = triggered_analytics_rule_run_id
+ self.provisioning_state = provisioning_state
+ self.rule_run_additional_data = rule_run_additional_data
+
+class TriggeredAnalyticsRuleRuns(_serialization.Model):
+ """The triggered analytics rule run array.
+
+ 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 value: Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.TriggeredAnalyticsRuleRun]
+ :ivar next_link:
+ :vartype next_link: str
+ """
+
+ _validation = {
+ 'value': {'required': True},
+ 'next_link': {'readonly': True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[TriggeredAnalyticsRuleRun]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: List["_models.TriggeredAnalyticsRuleRun"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.TriggeredAnalyticsRuleRun]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
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.
+ 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
@@ -23132,11 +31384,11 @@ class Ueba(Settings):
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- "kind": {"required": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'kind': {'required': True},
}
_attribute_map = {
@@ -23154,8 +31406,8 @@ def __init__(
*,
etag: Optional[str] = None,
data_sources: Optional[List[Union[str, "_models.UebaDataSources"]]] = None,
- **kwargs
- ):
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -23163,19 +31415,86 @@ def __init__(
:paramtype data_sources: list[str or ~azure.mgmt.securityinsight.models.UebaDataSources]
"""
super().__init__(etag=etag, **kwargs)
- self.kind: str = "Ueba"
+ self.kind: str = 'Ueba'
self.data_sources = data_sources
+class UndoActionPayload(_serialization.Model):
+ """Represents the undo action.
+
+ :ivar action_id: The action ID of the original action that was performed and now need to undo.
+ :vartype action_id: str
+ """
+
+ _attribute_map = {
+ "action_id": {"key": "actionId", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ action_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword action_id: The action ID of the original action that was performed and now need to
+ undo.
+ :paramtype action_id: str
+ """
+ super().__init__(**kwargs)
+ self.action_id = action_id
+
+class UnlockUserAction(Action):
+ """Represents an unlock user action.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar kind: The actions kind. Required. Known values are: "LockUser" and "UnlockUser".
+ :vartype kind: str or ~azure.mgmt.securityinsight.models.ListActionKind
+ :ivar user: The user to unlock.
+ :vartype user: str
+ :ivar failure_reason: The reason of the failure of the action. Empty if the action is
+ successful.
+ :vartype failure_reason: str
+ """
+
+ _validation = {
+ 'kind': {'required': True},
+ }
+
+ _attribute_map = {
+ "kind": {"key": "kind", "type": "str"},
+ "user": {"key": "user", "type": "str"},
+ "failure_reason": {"key": "failureReason", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ user: Optional[str] = None,
+ failure_reason: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword user: The user to unlock.
+ :paramtype user: str
+ :keyword failure_reason: The reason of the failure of the action. Empty if the action is
+ successful.
+ :paramtype failure_reason: str
+ """
+ super().__init__(**kwargs)
+ self.kind: str = 'UnlockUser'
+ self.user = user
+ self.failure_reason = failure_reason
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
@@ -23189,7 +31508,7 @@ class UrlEntity(Entity):
"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
+ :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]
@@ -23201,14 +31520,14 @@ class UrlEntity(Entity):
"""
_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},
- "url": {"readonly": 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},
+ 'url': {'readonly': True},
}
_attribute_map = {
@@ -23222,15 +31541,18 @@ 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"
+ self.kind: str = 'Url'
self.additional_data = None
self.friendly_name = None
self.url = None
-
class UrlEntityProperties(EntityCommonProperties):
"""Url entity property bag.
@@ -23247,9 +31569,9 @@ class UrlEntityProperties(EntityCommonProperties):
"""
_validation = {
- "additional_data": {"readonly": True},
- "friendly_name": {"readonly": True},
- "url": {"readonly": True},
+ 'additional_data': {'readonly': True},
+ 'friendly_name': {'readonly': True},
+ 'url': {'readonly': True},
}
_attribute_map = {
@@ -23258,12 +31580,15 @@ class UrlEntityProperties(EntityCommonProperties):
"url": {"key": "url", "type": "str"},
}
- def __init__(self, **kwargs):
- """ """
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
super().__init__(**kwargs)
self.url = None
-
class UserInfo(_serialization.Model):
"""User information that made some action.
@@ -23278,8 +31603,8 @@ class UserInfo(_serialization.Model):
"""
_validation = {
- "email": {"readonly": True},
- "name": {"readonly": True},
+ 'email': {'readonly': True},
+ 'name': {'readonly': True},
}
_attribute_map = {
@@ -23288,7 +31613,12 @@ 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
@@ -23298,7 +31628,6 @@ def __init__(self, *, object_id: Optional[str] = None, **kwargs):
self.name = None
self.object_id = object_id
-
class ValidationError(_serialization.Model):
"""Describes an error encountered in the file during validation.
@@ -23311,7 +31640,7 @@ class ValidationError(_serialization.Model):
"""
_validation = {
- "error_messages": {"readonly": True},
+ 'error_messages': {'readonly': True},
}
_attribute_map = {
@@ -23319,23 +31648,94 @@ class ValidationError(_serialization.Model):
"error_messages": {"key": "errorMessages", "type": "[str]"},
}
- def __init__(self, *, record_index: Optional[int] = None, **kwargs):
+ def __init__(
+ self,
+ *,
+ record_index: Optional[int] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword record_index: The number of the record that has the error.
:paramtype record_index: int
"""
super().__init__(**kwargs)
- self.record_index = record_index
- self.error_messages = None
-
+ self.record_index = record_index
+ self.error_messages = None
+
+class Warning(_serialization.Model):
+ """Warning response structure.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar warning: Warning data.
+ :vartype warning: ~azure.mgmt.securityinsight.models.WarningBody
+ """
+
+ _validation = {
+ 'warning': {'readonly': True},
+ }
+
+ _attribute_map = {
+ "warning": {"key": "warning", "type": "WarningBody"},
+ }
+
+ def __init__(
+ self,
+ **kwargs: Any
+ ) -> None:
+ """
+ """
+ super().__init__(**kwargs)
+ self.warning = None
+
+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): # pylint: disable=too-many-instance-attributes
"""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
@@ -23396,13 +31796,16 @@ class Watchlist(ResourceWithEtag): # pylint: disable=too-many-instance-attribut
: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.
:vartype upload_status: str
+ :ivar provisioning_state: The triggered analytics rule run provisioning state. Known values
+ are: "Accepted", "InProgress", "Succeeded", "Failed", and "Canceled".
+ :vartype provisioning_state: str or ~azure.mgmt.securityinsight.models.ProvisioningState
"""
_validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
@@ -23432,6 +31835,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 +31863,9 @@ def __init__( # pylint: disable=too-many-locals
items_search_key: Optional[str] = None,
content_type: Optional[str] = None,
upload_status: Optional[str] = None,
- **kwargs
- ):
+ provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None,
+ **kwargs: Any
+ ) -> None:
"""
:keyword etag: Etag of the azure resource.
:paramtype etag: str
@@ -23513,6 +31918,9 @@ def __init__( # pylint: disable=too-many-locals
: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.
:paramtype upload_status: str
+ :keyword provisioning_state: The triggered analytics rule run provisioning state. Known values
+ are: "Accepted", "InProgress", "Succeeded", "Failed", and "Canceled".
+ :paramtype provisioning_state: str or ~azure.mgmt.securityinsight.models.ProvisioningState
"""
super().__init__(etag=etag, **kwargs)
self.watchlist_id = watchlist_id
@@ -23536,15 +31944,15 @@ 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 = provisioning_state
class WatchlistItem(ResourceWithEtag): # pylint: disable=too-many-instance-attributes
"""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,16 +31981,16 @@ 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 = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
}
_attribute_map = {
@@ -23599,8 +32007,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 +32023,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 +32047,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
@@ -23655,13 +32063,12 @@ def __init__(
self.items_key_value = items_key_value
self.entity_mapping = entity_mapping
-
class WatchlistItemList(_serialization.Model):
"""List all the watchlist items.
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.
:vartype next_link: str
@@ -23670,8 +32077,8 @@ class WatchlistItemList(_serialization.Model):
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
@@ -23679,7 +32086,12 @@ 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]
@@ -23688,13 +32100,12 @@ def __init__(self, *, value: List["_models.WatchlistItem"], **kwargs):
self.next_link = None
self.value = value
-
class WatchlistList(_serialization.Model):
"""List all the watchlists.
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
@@ -23703,8 +32114,8 @@ class WatchlistList(_serialization.Model):
"""
_validation = {
- "next_link": {"readonly": True},
- "value": {"required": True},
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
}
_attribute_map = {
@@ -23712,7 +32123,12 @@ 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]
@@ -23721,49 +32137,453 @@ def __init__(self, *, value: List["_models.Watchlist"], **kwargs):
self.next_link = None
self.value = value
-
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
+ **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
+
+class WorkspaceManagerAssignment(AzureEntityResource):
+ """The workspace manager assignment.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :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: Resource Etag.
+ :vartype etag: str
+ :ivar target_resource_name: The resource name of the workspace manager group targeted by the
+ workspace manager assignment.
+ :vartype target_resource_name: str
+ :ivar last_job_end_time: The time the last job associated to this assignment ended at.
+ :vartype last_job_end_time: ~datetime.datetime
+ :ivar last_job_provisioning_state: State of the last job associated to this assignment. Known
+ values are: "Accepted", "InProgress", "Succeeded", "Failed", and "Canceled".
+ :vartype last_job_provisioning_state: str or
+ ~azure.mgmt.securityinsight.models.ProvisioningState
+ :ivar items: List of resources included in this workspace manager assignment.
+ :vartype items: list[~azure.mgmt.securityinsight.models.AssignmentItem]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'etag': {'readonly': True},
+ 'last_job_end_time': {'readonly': True},
+ 'last_job_provisioning_state': {'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"},
+ "target_resource_name": {"key": "properties.targetResourceName", "type": "str"},
+ "last_job_end_time": {"key": "properties.lastJobEndTime", "type": "iso-8601"},
+ "last_job_provisioning_state": {"key": "properties.lastJobProvisioningState", "type": "str"},
+ "items": {"key": "properties.items", "type": "[AssignmentItem]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ target_resource_name: Optional[str] = None,
+ items: Optional[List["_models.AssignmentItem"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword target_resource_name: The resource name of the workspace manager group targeted by the
+ workspace manager assignment.
+ :paramtype target_resource_name: str
+ :keyword items: List of resources included in this workspace manager assignment.
+ :paramtype items: list[~azure.mgmt.securityinsight.models.AssignmentItem]
+ """
+ super().__init__(**kwargs)
+ self.target_resource_name = target_resource_name
+ self.last_job_end_time = None
+ self.last_job_provisioning_state = None
+ self.items = items
+
+class WorkspaceManagerAssignmentList(_serialization.Model):
+ """List of all the workspace manager assignments.
+
+ 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 workspace manager assignments.
+ :vartype next_link: str
+ :ivar value: Array of workspace manager assignments. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment]
+ """
+
+ _validation = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[WorkspaceManagerAssignment]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: List["_models.WorkspaceManagerAssignment"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Array of workspace manager assignments. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment]
+ """
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
+
+class WorkspaceManagerConfiguration(AzureEntityResource):
+ """The workspace manager configuration.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :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: Resource Etag.
+ :vartype etag: str
+ :ivar mode: The current mode of the workspace manager configuration. Known values are:
+ "Enabled" and "Disabled".
+ :vartype mode: str or ~azure.mgmt.securityinsight.models.Mode
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'etag': {'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"},
+ "mode": {"key": "properties.mode", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ mode: Optional[Union[str, "_models.Mode"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword mode: The current mode of the workspace manager configuration. Known values are:
+ "Enabled" and "Disabled".
+ :paramtype mode: str or ~azure.mgmt.securityinsight.models.Mode
+ """
+ super().__init__(**kwargs)
+ self.mode = mode
+
+class WorkspaceManagerConfigurationList(_serialization.Model):
+ """List all the workspace manager configurations for the workspace.
+
+ 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 workspace manager configurations.
+ :vartype next_link: str
+ :ivar value: Array of workspace manager configurations. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration]
+ """
+
+ _validation = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[WorkspaceManagerConfiguration]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: List["_models.WorkspaceManagerConfiguration"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Array of workspace manager configurations. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration]
+ """
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
+
+class WorkspaceManagerGroup(AzureEntityResource):
+ """The workspace manager group.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :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: Resource Etag.
+ :vartype etag: str
+ :ivar description: The description of the workspace manager group.
+ :vartype description: str
+ :ivar display_name: The display name of the workspace manager group.
+ :vartype display_name: str
+ :ivar member_resource_names: The names of the workspace manager members participating in this
+ group.
+ :vartype member_resource_names: list[str]
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'etag': {'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"},
+ "description": {"key": "properties.description", "type": "str"},
+ "display_name": {"key": "properties.displayName", "type": "str"},
+ "member_resource_names": {"key": "properties.memberResourceNames", "type": "[str]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ description: Optional[str] = None,
+ display_name: Optional[str] = None,
+ member_resource_names: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword description: The description of the workspace manager group.
+ :paramtype description: str
+ :keyword display_name: The display name of the workspace manager group.
+ :paramtype display_name: str
+ :keyword member_resource_names: The names of the workspace manager members participating in
+ this group.
+ :paramtype member_resource_names: list[str]
+ """
+ super().__init__(**kwargs)
+ self.description = description
+ self.display_name = display_name
+ self.member_resource_names = member_resource_names
+
+class WorkspaceManagerGroupList(_serialization.Model):
+ """List of all the workspace manager groups.
+
+ 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 workspace manager groups.
+ :vartype next_link: str
+ :ivar value: Array of workspace manager groups. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.WorkspaceManagerGroup]
+ """
+
+ _validation = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[WorkspaceManagerGroup]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: List["_models.WorkspaceManagerGroup"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Array of workspace manager groups. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.WorkspaceManagerGroup]
+ """
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
+
+class WorkspaceManagerMember(AzureEntityResource):
+ """The workspace manager member.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :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: Resource Etag.
+ :vartype etag: str
+ :ivar target_workspace_resource_id: Fully qualified resource ID of the target Sentinel
+ workspace joining the given Sentinel workspace manager.
+ :vartype target_workspace_resource_id: str
+ :ivar target_workspace_tenant_id: Tenant id of the target Sentinel workspace joining the given
+ Sentinel workspace manager.
+ :vartype target_workspace_tenant_id: str
+ """
+
+ _validation = {
+ 'id': {'readonly': True},
+ 'name': {'readonly': True},
+ 'type': {'readonly': True},
+ 'system_data': {'readonly': True},
+ 'etag': {'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"},
+ "target_workspace_resource_id": {"key": "properties.targetWorkspaceResourceId", "type": "str"},
+ "target_workspace_tenant_id": {"key": "properties.targetWorkspaceTenantId", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ target_workspace_resource_id: Optional[str] = None,
+ target_workspace_tenant_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword target_workspace_resource_id: Fully qualified resource ID of the target Sentinel
+ workspace joining the given Sentinel workspace manager.
+ :paramtype target_workspace_resource_id: str
+ :keyword target_workspace_tenant_id: Tenant id of the target Sentinel workspace joining the
+ given Sentinel workspace manager.
+ :paramtype target_workspace_tenant_id: str
+ """
+ super().__init__(**kwargs)
+ self.target_workspace_resource_id = target_workspace_resource_id
+ self.target_workspace_tenant_id = target_workspace_tenant_id
+
+class WorkspaceManagerMembersList(_serialization.Model):
+ """List of workspace manager members.
+
+ 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 workspace manager members.
+ :vartype next_link: str
+ :ivar value: Array of workspace manager members. Required.
+ :vartype value: list[~azure.mgmt.securityinsight.models.WorkspaceManagerMember]
+ """
+
+ _validation = {
+ 'next_link': {'readonly': True},
+ 'value': {'required': True},
+ }
+
+ _attribute_map = {
+ "next_link": {"key": "nextLink", "type": "str"},
+ "value": {"key": "value", "type": "[WorkspaceManagerMember]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: List["_models.WorkspaceManagerMember"],
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Array of workspace manager members. Required.
+ :paramtype value: list[~azure.mgmt.securityinsight.models.WorkspaceManagerMember]
+ """
+ super().__init__(**kwargs)
+ self.next_link = None
+ self.value = value
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..d676a65f9928 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
@@ -10,51 +10,71 @@
from azure.core import CaseInsensitiveEnumMeta
+class ActionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The status of the action that was performed by the agent.
+ """
+
+ PENDING = "Pending"
+ """Actions is pending"""
+ COMPLETED = "Completed"
+ """The action is completed successfully."""
+ FAILED = "Failed"
+ """The action failed."""
+
class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The type of the automation rule action."""
+ """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 AgentType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Type of the agent.
+ """
+ SAP = "SAP"
class AlertDetail(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Alert detail."""
+ """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."""
+ """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"""
+ SUB_TECHNIQUES = "SubTechniques"
+ """SubTechniques alert property"""
class AlertRuleKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of the alert rule."""
+ """The kind of the alert rule.
+ """
SCHEDULED = "Scheduled"
MICROSOFT_SECURITY_INCIDENT_CREATION = "MicrosoftSecurityIncidentCreation"
@@ -63,50 +83,50 @@ class AlertRuleKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
THREAT_INTELLIGENCE = "ThreatIntelligence"
NRT = "NRT"
-
class AlertSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The severity of the alert."""
+ """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."""
+ """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."""
+ """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):
- """The severity for alerts created by this alert rule."""
+ """The severity for alerts created by this alert rule.
+ """
RECONNAISSANCE = "Reconnaissance"
RESOURCE_DEVELOPMENT = "ResourceDevelopment"
@@ -126,329 +146,359 @@ class AttackTactic(str, Enum, metaclass=CaseInsensitiveEnumMeta):
IMPAIR_PROCESS_CONTROL = "ImpairProcessControl"
INHIBIT_RESPONSE_FUNCTION = "InhibitResponseFunction"
-
class AutomationRuleBooleanConditionSupportedOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """AutomationRuleBooleanConditionSupportedOperator."""
+ """AutomationRuleBooleanConditionSupportedOperator.
+ """
- #: 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."""
+ """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."""
+ """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."""
+ """AutomationRulePropertyArrayConditionSupportedArrayConditionType.
+ """
- #: Evaluate the condition as true if any item fulfills it
ANY_ITEM = "AnyItem"
-
+ """Evaluate the condition as true if any item fulfills it"""
+ ALL_ITEMS = "AllItems"
+ """Evaluate the condition as true if all the items fulfill it"""
class AutomationRulePropertyArrayConditionSupportedArrayType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """AutomationRulePropertyArrayConditionSupportedArrayType."""
+ """AutomationRulePropertyArrayConditionSupportedArrayType.
+ """
- #: 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"""
+ INCIDENT_LABELS = "IncidentLabels"
+ """Evaluate the condition on the incident labels"""
class AutomationRulePropertyChangedConditionSupportedChangedType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """AutomationRulePropertyChangedConditionSupportedChangedType."""
+ """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."""
+ """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."""
+ """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 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 BillingStatisticKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The kind of the billing statistic.
+ """
-class Category(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Categories of recommendations."""
+ SAP_SOLUTION_USAGE = "SapSolutionUsage"
- #: 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"
+class CcpAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Type of paging.
+ """
+ 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."""
+ """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."""
+ """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):
"""The confidence score calculation status, i.e. indicating if score calculation is pending for
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"
+ """Final score was calculated and available"""
+
+class ConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Represents the types of configuration for a system.
+ """
+ SAP = "SAP"
class ConnectAuthKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The authentication kind used to poll the data."""
+ """The authentication kind used to poll the data.
+ """
BASIC = "Basic"
O_AUTH2 = "OAuth2"
API_KEY = "APIKey"
+class Connective(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Represents boolean connectives used to join clauses in conditions.
+ """
+
+ AND = "And"
+ """'And' connective"""
+ OR = "Or"
+ """'Or' connective"""
+ AND_ENUM = "And"
+ """'And' connective"""
+ OR_ENUM = "Or"
+ """'Or' connective"""
class ConnectivityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """type of connectivity."""
+ """type of connectivity.
+ """
IS_CONNECTED_QUERY = "IsConnectedQuery"
-
class ContentType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The content type of a source control path."""
+ """The content type of a source control path.
+ """
ANALYTIC_RULE = "AnalyticRule"
+ 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."""
+ """The type of identity that created the resource.
+ """
USER = "User"
APPLICATION = "Application"
MANAGED_IDENTITY = "ManagedIdentity"
KEY = "Key"
-
class CustomEntityQueryKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of the entity query that supports put request."""
+ """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."""
+ """Describes the state of user's authorization for a connector kind.
+ """
VALID = "Valid"
INVALID = "Invalid"
+class DataConnectorDefinitionKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The kind of the data connector definitions.
+ """
+
+ CUSTOMIZABLE = "Customizable"
class DataConnectorKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of the data connector."""
+ """The kind of the data connector.
+ """
AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory"
AZURE_SECURITY_CENTER = "AzureSecurityCenter"
@@ -459,6 +509,7 @@ class DataConnectorKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
OFFICE_ATP = "OfficeATP"
OFFICE_IRM = "OfficeIRM"
OFFICE365_PROJECT = "Office365Project"
+ MICROSOFT_PURVIEW_INFORMATION_PROTECTION = "MicrosoftPurviewInformationProtection"
OFFICE_POWER_BI = "OfficePowerBI"
AMAZON_WEB_SERVICES_CLOUD_TRAIL = "AmazonWebServicesCloudTrail"
AMAZON_WEB_SERVICES_S3 = "AmazonWebServicesS3"
@@ -470,538 +521,585 @@ class DataConnectorKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
GENERIC_UI = "GenericUI"
API_POLLING = "APIPolling"
IOT = "IOT"
-
+ GCP = "GCP"
+ REST_API_POLLER = "RestApiPoller"
class DataConnectorLicenseState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Describes the state of user's license for a connector kind."""
+ """Describes the state of user's license for a connector kind.
+ """
VALID = "Valid"
INVALID = "Invalid"
UNKNOWN = "Unknown"
-
class DataTypeState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Describe whether this data type connection is enabled or not."""
+ """Describe whether this data type connection is enabled or not.
+ """
ENABLED = "Enabled"
DISABLED = "Disabled"
-
class DeleteStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Indicates whether the file was deleted from the storage account."""
+ """Indicates whether the file was deleted from the storage account.
+ """
- #: The file was deleted.
DELETED = "Deleted"
- #: The file was not deleted.
+ """The file was deleted."""
NOT_DELETED = "NotDeleted"
- #: Unspecified
+ """The file was not deleted."""
UNSPECIFIED = "Unspecified"
-
+ """Unspecified"""
class DeliveryAction(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The delivery action of this mail message like Delivered, Blocked, Replaced etc."""
+ """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."""
+ """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):
- """Status while trying to fetch the deployment information."""
+ """Status while trying to fetch the deployment information.
+ """
SUCCESS = "Success"
UNAUTHORIZED = "Unauthorized"
NOT_FOUND = "NotFound"
-
class DeploymentResult(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Status while trying to fetch the deployment information."""
+ """Status while trying to fetch the deployment information.
+ """
SUCCESS = "Success"
CANCELED = "Canceled"
FAILED = "Failed"
-
class DeploymentState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The current state of the deployment."""
+ """The current state of the deployment.
+ """
IN_PROGRESS = "In_Progress"
COMPLETED = "Completed"
QUEUED = "Queued"
CANCELING = "Canceling"
-
class DeviceImportance(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Device importance, determines if the device classified as 'crown jewel'."""
+ """Device importance, determines if the device classified as 'crown jewel'.
+ """
- #: Unknown - Default value
UNKNOWN = "Unknown"
- #: Low
+ """Unknown - Default value"""
LOW = "Low"
- #: Normal
+ """Low"""
NORMAL = "Normal"
- #: High
+ """Normal"""
HIGH = "High"
-
+ """High"""
class ElevationToken(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The elevation token associated with the process."""
+ """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 EnrichmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """EnrichmentType.
+ """
+
+ MAIN = "main"
class EntityItemQueryKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """EntityItemQueryKind."""
+ """EntityItemQueryKind.
+ """
- #: insight
INSIGHT = "Insight"
+ """insight"""
+class EntityKindEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The kind of the entity.
+ """
-class EntityKind(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.
+ """Entity represents submission mail in the system."""
NIC = "Nic"
-
+ """Entity represents network interface in the system."""
class EntityMappingType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The V3 type of the mapped entity."""
+ """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"
-
+ """Submission mail entity type"""
class EntityProviders(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The entity provider that is synced."""
+ """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."""
+ """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."""
+ """EntityQueryTemplateKind.
+ """
ACTIVITY = "Activity"
-
+ INSIGHT = "Insight"
+ SECURITY_ALERT = "SecurityAlert"
+ BOOKMARK = "Bookmark"
+ EXPANSION = "Expansion"
+ GUIDED_INSIGHT = "GuidedInsight"
+ ANOMALY = "Anomaly"
class EntityTimelineKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The entity query kind."""
+ """The entity query kind.
+ """
- #: activity
ACTIVITY = "Activity"
- #: bookmarks
+ """activity"""
BOOKMARK = "Bookmark"
- #: security alerts
+ """bookmarks"""
SECURITY_ALERT = "SecurityAlert"
- #: anomaly
+ """security alerts"""
ANOMALY = "Anomaly"
-
+ """anomaly"""
class EntityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The type of the entity."""
+ """The type 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 in the system.
+ """Entity represents cloud application in the system."""
DNS = "DNS"
- #: Entity represents file hash in the system.
+ """Entity represents dns 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 HuntingBookmark in the system.
+ """Entity represents security alert in the system."""
HUNTING_BOOKMARK = "HuntingBookmark"
- #: Entity represents mail cluster in the system.
+ """Entity represents HuntingBookmark 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.
+ """Entity represents submission mail 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"
-
+ """Entity represents network interface in the system."""
class EventGroupingAggregationKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The event grouping aggregation kinds."""
+ """The event grouping aggregation kinds.
+ """
SINGLE_ALERT = "SingleAlert"
ALERT_PER_RESULT = "AlertPerResult"
-
class FileFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The format of the file."""
+ """The format of the file.
+ """
- #: A CSV file.
CSV = "CSV"
- #: A JSON file.
+ """A CSV file."""
JSON = "JSON"
- #: A file of other format.
+ """A JSON file."""
UNSPECIFIED = "Unspecified"
-
+ """A file of other format."""
class FileHashAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The hash algorithm type."""
+ """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."""
+ """The content type of this file.
+ """
- #: 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.
+ """File containing records with the core fields of an indicator, plus the observables to construct
+ the STIX pattern."""
STIX_INDICATOR = "StixIndicator"
- #: File containing other records.
+ """File containing STIX indicators."""
UNSPECIFIED = "Unspecified"
-
+ """File containing other records."""
class FileImportState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The state of the file import."""
+ """The state of the file import.
+ """
- #: A fatal error has occurred while ingesting the file.
FATAL_ERROR = "FatalError"
- #: The file has been ingested.
+ """A fatal error has occurred while ingesting the file."""
INGESTED = "Ingested"
- #: The file has been ingested with errors.
+ """The file has been ingested."""
INGESTED_WITH_ERRORS = "IngestedWithErrors"
- #: The file ingestion is in progress.
+ """The file has been ingested with errors."""
IN_PROGRESS = "InProgress"
- #: The file is invalid.
+ """The file ingestion is in progress."""
INVALID = "Invalid"
- #: Waiting for the file to be uploaded.
+ """The file is invalid."""
WAITING_FOR_UPLOAD = "WaitingForUpload"
- #: Unspecified state.
+ """Waiting for the file to be uploaded."""
UNSPECIFIED = "Unspecified"
+ """Unspecified state."""
+
+class Flag(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The boolean value the metadata is for.
+ """
+ TRUE = "true"
+ FALSE = "false"
class GetInsightsError(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """the query kind."""
+ """the query kind.
+ """
INSIGHT = "Insight"
+class HttpMethodVerb(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The HTTP method, default value GET.
+ """
+
+ GET = "GET"
+ POST = "POST"
+ PUT = "PUT"
+ DELETE = "DELETE"
+
+class HttpsConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Represents the types of HTTPS configuration to connect to the SapControl service.
+ """
+
+ HTTP_ONLY = "HttpOnly"
+ HTTPS_WITH_SSL_VERIFICATION = "HttpsWithSslVerification"
+ HTTPS_WITHOUT_SSL_VERIFICATION = "HttpsWithoutSslVerification"
+
+class HypothesisStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The hypothesis status of the hunt.
+ """
+
+ UNKNOWN = "Unknown"
+ INVALIDATED = "Invalidated"
+ VALIDATED = "Validated"
class IncidentClassification(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The reason the incident was closed."""
+ """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."""
+ """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."""
+ """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."""
+ """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."""
+ """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."""
+ """IncidentTaskStatus.
+ """
- #: A new task
NEW = "New"
- #: A completed task
+ """A new task"""
COMPLETED = "Completed"
-
+ """A completed task"""
class IngestionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Describes how to ingest the records in the file."""
+ """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.
+ """No records should be ingested when invalid records are detected."""
INGEST_ANY_VALID_RECORDS = "IngestAnyValidRecords"
- #: Unspecified
+ """Valid records should still be ingested when invalid records are detected."""
UNSPECIFIED = "Unspecified"
+ """Unspecified"""
+class IngestionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Types of ingestion.
+ """
+
+ FULL = "Full"
+ INCREMENTAL = "Incremental"
+
+class KeyVaultAuthenticationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Type for authentication identity to key vault.
+ """
+
+ MANAGED_IDENTITY = "ManagedIdentity"
+ SERVICE_PRINCIPAL = "ServicePrincipal"
class KillChainIntent(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The intent of the alert."""
+ """The intent of the 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 navigate
+ 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):
- """The kind of content the metadata is for."""
+ """The kind of content the metadata is for.
+ """
DATA_CONNECTOR = "DataConnector"
DATA_TYPE = "DataType"
@@ -1021,23 +1119,73 @@ class Kind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
LOGIC_APPS_CUSTOM_CONNECTOR = "LogicAppsCustomConnector"
AUTOMATION_RULE = "AutomationRule"
+class ListActionKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The kind of the action.
+ """
+
+ LOCK_USER = "LockUser"
+ UNLOCK_USER = "UnlockUser"
+
+class LogStatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Types of log status.
+ """
+
+ ENABLED = "Enabled"
+ DISABLED = "Disabled"
+
+class LogType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Types of logs and tables.
+ """
+
+ ABAP_AUDIT_LOG = "AbapAuditLog"
+ ABAP_JOB_LOG = "AbapJobLog"
+ ABAP_SPOOL_LOG = "AbapSpoolLog"
+ ABAP_SPOOL_OUTPUT_LOG = "AbapSpoolOutputLog"
+ ABAP_CHANGE_DOCS_LOG = "AbapChangeDocsLog"
+ ABAP_APP_LOG = "AbapAppLog"
+ ABAP_WORKFLOW_LOG = "AbapWorkflowLog"
+ ABAP_CR_LOG = "AbapCrLog"
+ ABAP_TABLE_DATA_LOG = "AbapTableDataLog"
+ ABAP_FILES_LOGS = "AbapFilesLogs"
+ JAVA_FILES_LOGS = "JavaFilesLogs"
+ AGRTCODES = "AGRTCODES"
+ USR01 = "USR01"
+ USR02 = "USR02"
+ AGR1251 = "AGR1251"
+ AGRUSERS = "AGRUSERS"
+ AGRPROF = "AGRPROF"
+ UST04 = "UST04"
+ USR21 = "USR21"
+ ADR6 = "ADR6"
+ ADCP = "ADCP"
+ USR05 = "USR05"
+ USGRPUSER = "USGRPUSER"
+ USERADDR = "USERADDR"
+ DEVACCESS = "DEVACCESS"
+ AGRDEFINE = "AGRDEFINE"
+ PAHI = "PAHI"
+ AGRAGRS = "AGRAGRS"
+ USRSTAMP = "USRSTAMP"
+ AGRFLAGS = "AGRFLAGS"
+ SNCSYSACL = "SNCSYSACL"
+ USRACL = "USRACL"
class MatchingMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Grouping matching method. When method is Selected at least one of groupByEntities,
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):
- """The alerts' productName on which the cases will be generated."""
+ """The alerts' productName on which the cases will be generated.
+ """
MICROSOFT_CLOUD_APP_SECURITY = "Microsoft Cloud App Security"
AZURE_SECURITY_CENTER = "Azure Security Center"
@@ -1047,81 +1195,117 @@ class MicrosoftSecurityProductName(str, Enum, metaclass=CaseInsensitiveEnumMeta)
OFFICE365_ADVANCED_THREAT_PROTECTION = "Office 365 Advanced Threat Protection"
MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION = "Microsoft Defender Advanced Threat Protection"
+class Mode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The current mode of the workspace manager configuration.
+ """
-class Operator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Operator used for list of dependencies in criteria array."""
+ ENABLED = "Enabled"
+ """The workspace manager configuration is enabled"""
+ DISABLED = "Disabled"
+ """The workspace manager configuration is disabled"""
+
+class MtpProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The available data providers.
+ """
+
+ MICROSOFT_DEFENDER_FOR_CLOUD_APPS = "microsoftDefenderForCloudApps"
+ MICROSOFT_DEFENDER_FOR_IDENTITY = "microsoftDefenderForIdentity"
- AND = "AND"
- OR = "OR"
+class Operator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Represents an operator in a ConditionClause.
+ """
+ EQUALS = "Equals"
+ NOT_EQUALS = "NotEquals"
+ LESS_THAN = "LessThan"
+ LESS_THAN_EQUAL = "LessThanEqual"
+ GREATER_THAN = "GreaterThan"
+ GREATER_THAN_EQUAL = "GreaterThanEqual"
+ STRING_CONTAINS = "StringContains"
+ STRING_NOT_CONTAINS = "StringNotContains"
+ STRING_STARTS_WITH = "StringStartsWith"
+ STRING_NOT_STARTS_WITH = "StringNotStartsWith"
+ STRING_ENDS_WITH = "StringEndsWith"
+ STRING_NOT_ENDS_WITH = "StringNotEndsWith"
+ STRING_IS_EMPTY = "StringIsEmpty"
+ IS_NULL = "IsNull"
+ IS_TRUE = "IsTrue"
+ IS_FALSE = "IsFalse"
+ ARRAY_CONTAINS = "ArrayContains"
+ ARRAY_NOT_CONTAINS = "ArrayNotContains"
+ ON_OR_AFTER_RELATIVE = "OnOrAfterRelative"
+ AFTER_RELATIVE = "AfterRelative"
+ ON_OR_BEFORE_RELATIVE = "OnOrBeforeRelative"
+ BEFORE_RELATIVE = "BeforeRelative"
+ ON_OR_AFTER_ABSOLUTE = "OnOrAfterAbsolute"
+ AFTER_ABSOLUTE = "AfterAbsolute"
+ ON_OR_BEFORE_ABSOLUTE = "OnOrBeforeAbsolute"
+ BEFORE_ABSOLUTE = "BeforeAbsolute"
class OSFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The operating system type."""
+ """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"
-
+ """Host with Unknown operating system."""
class OutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Insights Column type."""
+ """Insights Column type.
+ """
NUMBER = "Number"
STRING = "String"
DATE = "Date"
ENTITY = "Entity"
-
class OwnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The type of the owner the incident is assigned to."""
+ """The type of the owner the hunt is assigned to.
+ """
- #: The incident owner type is unknown
UNKNOWN = "Unknown"
- #: The incident owner type is an AAD user
+ """The hunt owner type is unknown"""
USER = "User"
- #: The incident owner type is an AAD group
+ """The hunt owner type is an AAD user"""
GROUP = "Group"
+ """The hunt owner type is an AAD group"""
+class PackageKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The package kind.
+ """
+
+ SOLUTION = "Solution"
+ STANDALONE = "Standalone"
class PermissionProviderScope(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Permission provider scope."""
+ """Permission provider scope.
+ """
RESOURCE_GROUP = "ResourceGroup"
SUBSCRIPTION = "Subscription"
WORKSPACE = "Workspace"
-
class PollingFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The polling frequency for the TAXII server."""
+ """The polling frequency for the TAXII server.
+ """
- #: Once a minute
ONCE_A_MINUTE = "OnceAMinute"
- #: Once an hour
+ """Once a minute"""
ONCE_AN_HOUR = "OnceAnHour"
- #: Once a day
+ """Once an hour"""
ONCE_A_DAY = "OnceADay"
-
-
-class Priority(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Priority of recommendation."""
-
- #: Low priority for recommendation.
- LOW = "Low"
- #: Medium priority for recommendation.
- MEDIUM = "Medium"
- #: High priority for recommendation.
- HIGH = "High"
-
+ """Once a day"""
class ProviderName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Provider name."""
+ """Provider name.
+ """
MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS = "Microsoft.OperationalInsights/solutions"
MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES = "Microsoft.OperationalInsights/workspaces"
@@ -1130,197 +1314,315 @@ class ProviderName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_SHARED_KEYS = "Microsoft.OperationalInsights/workspaces/sharedKeys"
MICROSOFT_AUTHORIZATION_POLICY_ASSIGNMENTS = "Microsoft.Authorization/policyAssignments"
+class ProviderPermissionsScope(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The scope on which the user should have permissions, in order to be able to create connections.
+ """
+
+ SUBSCRIPTION = "Subscription"
+ RESOURCE_GROUP = "ResourceGroup"
+ WORKSPACE = "Workspace"
+
+class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The triggered analytics rule run provisioning state.
+ """
+
+ ACCEPTED = "Accepted"
+ IN_PROGRESS = "InProgress"
+ SUCCEEDED = "Succeeded"
+ FAILED = "Failed"
+ CANCELED = "Canceled"
class RegistryHive(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """the hive that holds the registry key."""
+ """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):
"""Specifies the data types to use when storing values in the registry, or identifies the data
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."""
+ """The type of repository.
+ """
GITHUB = "Github"
- DEV_OPS = "DevOps"
+ AZURE_DEV_OPS = "AzureDevOps"
+
+class RestApiPollerRequestPagingKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Type of paging.
+ """
+
+ 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 SapAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Types of authentication to SAP.
+ """
+ USERNAME_PASSWORD = "UsernamePassword"
+ SNC = "Snc"
+ SNC_WITH_USERNAME_PASSWORD = "SncWithUsernamePassword"
+
+class SecretSource(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Type for Secret Source - Azure Key Vault.
+ """
+
+ AZURE_KEY_VAULT = "AzureKeyVault"
class SecurityMLAnalyticsSettingsKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of security ML analytics settings."""
+ """The kind of security ML analytics settings.
+ """
ANOMALY = "Anomaly"
-
class SettingKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of the setting."""
+ """The kind of the setting.
+ """
ANOMALIES = "Anomalies"
EYES_ON = "EyesOn"
ENTITY_ANALYTICS = "EntityAnalytics"
UEBA = "Ueba"
-
class SettingsStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The anomaly SecurityMLAnalyticsSettings status."""
+ """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"
-
+ """Anomaly settings status in Flighting mode"""
class SettingType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The kind of the setting."""
+ """The kind of the setting.
+ """
COPYABLE_LABEL = "CopyableLabel"
INSTRUCTION_STEPS_GROUP = "InstructionStepsGroup"
INFO_MESSAGE = "InfoMessage"
+class SortingDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The direction to sort the results by.
+ """
+
+ ASC = "ASC"
+ """Indicates that the query should be sorted from lowest-to-highest value."""
+ DESC = "DESC"
+ """Indicates that the query should be sorted from lowest-to-highest value."""
class SourceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Source type of the content."""
+ """Source type of the content.
+ """
LOCAL_WORKSPACE = "LocalWorkspace"
COMMUNITY = "Community"
SOLUTION = "Solution"
SOURCE_REPOSITORY = "SourceRepository"
-
class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The sourceType of the watchlist."""
+ """The sourceType of the watchlist.
+ """
LOCAL_FILE = "Local file"
REMOTE_STORAGE = "Remote storage"
-
class State(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """State of recommendation."""
+ """State of recommendation.
+ """
- #: Recommendation is active.
ACTIVE = "Active"
- #: Recommendation is disabled.
- DISABLED = "Disabled"
- #: Recommendation has been completed by user.
+ """Recommendation is active."""
+ IN_PROGRESS = "InProgress"
+ """Recommendation is in progress."""
+ DISMISSED = "Dismissed"
+ """Recommendation has been dismissed."""
COMPLETED_BY_USER = "CompletedByUser"
- #: Recommendation has been completed by action.
- COMPLETED_BY_ACTION = "CompletedByAction"
- #: Recommendation is hidden.
- HIDDEN = "Hidden"
+ """Recommendation has been completed by user."""
+ COMPLETED_BY_SYSTEM = "CompletedBySystem"
+ """Recommendation has been completed by the system."""
+class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The status of the hunt.
+ """
+
+ NEW = "New"
+ ACTIVE = "Active"
+ CLOSED = "Closed"
+ BACKLOG = "Backlog"
+ APPROVED = "Approved"
+ SUCCEEDED = "Succeeded"
+ FAILED = "Failed"
+ IN_PROGRESS = "InProgress"
class SupportTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Type of support for content item."""
+ """Type of support for content item.
+ """
MICROSOFT = "Microsoft"
PARTNER = "Partner"
COMMUNITY = "Community"
+class SystemConfigurationConnectorType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Represents the types of SAP systems.
+ """
+
+ RFC = "Rfc"
+ SAP_CONTROL = "SapControl"
+
+class SystemStatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The status of the system.
+ """
+
+ RUNNING = "Running"
+ STOPPED = "Stopped"
class TemplateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The alert rule template status."""
+ """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 ThreatIntelligenceResourceInnerKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The kind of the threat intelligence entity.
+ """
-class ThreatIntelligenceResourceKindEnum(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):
- """Sorting order (ascending/descending/unsorted)."""
+class ThreatIntelligenceSortingOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Sorting order (ascending/descending/unsorted).
+ """
UNSORTED = "unsorted"
ASCENDING = "ascending"
DESCENDING = "descending"
+class TIObjectKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The kind of the TI object.
+ """
+
+ ATTACK_PATTERN = "AttackPattern"
+ """A TI object that represents an attack pattern."""
+ IDENTITY = "Identity"
+ """A TI object that represents an identity."""
+ INDICATOR = "Indicator"
+ """A TI object that represents an indicator."""
+ RELATIONSHIP = "Relationship"
+ """A TI object that represents a relationship between two TI objects."""
+ THREAT_ACTOR = "ThreatActor"
+ """A TI object that represents a threat actor."""
+
+class TiType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """TiType.
+ """
+
+ MAIN = "main"
class TriggerOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The operation against the threshold that triggers alert rule."""
+ """The operation against the threshold that triggers alert rule.
+ """
GREATER_THAN = "GreaterThan"
LESS_THAN = "LessThan"
EQUAL = "Equal"
NOT_EQUAL = "NotEqual"
-
class TriggersOn(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """TriggersOn."""
+ """TriggersOn.
+ """
- #: Trigger on Incidents
INCIDENTS = "Incidents"
- #: Trigger on Alerts
+ """Trigger on Incidents"""
ALERTS = "Alerts"
-
+ """Trigger on Alerts"""
class TriggersWhen(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """TriggersWhen."""
+ """TriggersWhen.
+ """
- #: Trigger on created objects
CREATED = "Created"
- #: Trigger on updated objects
+ """Trigger on created objects"""
UPDATED = "Updated"
-
+ """Trigger on updated objects"""
class UebaDataSources(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The data source that enriched by ueba."""
+ """The data source that enriched by ueba.
+ """
AUDIT_LOGS = "AuditLogs"
AZURE_ACTIVITY = "AzureActivity"
SECURITY_EVENT = "SecurityEvent"
SIGNIN_LOGS = "SigninLogs"
-
class Version(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """The version of the source control."""
+ """The version of the source control.
+ """
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..c8c06ca4ee57 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
@@ -10,19 +10,33 @@
from ._actions_operations import ActionsOperations
from ._alert_rule_templates_operations import AlertRuleTemplatesOperations
from ._automation_rules_operations import AutomationRulesOperations
+from ._entities_operations import EntitiesOperations
from ._incidents_operations import IncidentsOperations
+from ._billing_statistics_operations import BillingStatisticsOperations
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 ._business_application_agents_operations import BusinessApplicationAgentsOperations
+from ._business_application_agent_operations import BusinessApplicationAgentOperations
+from ._systems_operations import SystemsOperations
+from ._content_packages_operations import ContentPackagesOperations
+from ._content_package_operations import ContentPackageOperations
+from ._product_packages_operations import ProductPackagesOperations
+from ._product_package_operations import ProductPackageOperations
+from ._product_templates_operations import ProductTemplatesOperations
+from ._product_template_operations import ProductTemplateOperations
+from ._content_templates_operations import ContentTemplatesOperations
+from ._content_template_operations import ContentTemplateOperations
+from ._security_insights_operations import SecurityInsightsOperationsMixin
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 ._hunts_operations import HuntsOperations
+from ._hunt_relations_operations import HuntRelationsOperations
+from ._hunt_comments_operations import HuntCommentsOperations
from ._incident_comments_operations import IncidentCommentsOperations
from ._incident_relations_operations import IncidentRelationsOperations
from ._incident_tasks_operations import IncidentTasksOperations
@@ -32,6 +46,7 @@
from ._get_recommendations_operations import GetRecommendationsOperations
from ._get_operations import GetOperations
from ._update_operations import UpdateOperations
+from ._reevaluate_operations import ReevaluateOperations
from ._security_ml_analytics_settings_operations import SecurityMLAnalyticsSettingsOperations
from ._product_settings_operations import ProductSettingsOperations
from ._source_control_operations import SourceControlOperations
@@ -39,8 +54,18 @@
from ._threat_intelligence_indicator_operations import ThreatIntelligenceIndicatorOperations
from ._threat_intelligence_indicators_operations import ThreatIntelligenceIndicatorsOperations
from ._threat_intelligence_indicator_metrics_operations import ThreatIntelligenceIndicatorMetricsOperations
+from ._threat_intelligence_operations import ThreatIntelligenceOperations
+from ._triggered_analytics_rule_run_operations import TriggeredAnalyticsRuleRunOperations
+from ._get_triggered_analytics_rule_runs_operations import GetTriggeredAnalyticsRuleRunsOperations
+from ._alert_rule_operations import AlertRuleOperations
from ._watchlists_operations import WatchlistsOperations
from ._watchlist_items_operations import WatchlistItemsOperations
+from ._workspace_manager_assignments_operations import WorkspaceManagerAssignmentsOperations
+from ._workspace_manager_assignment_jobs_operations import WorkspaceManagerAssignmentJobsOperations
+from ._workspace_manager_configurations_operations import WorkspaceManagerConfigurationsOperations
+from ._workspace_manager_groups_operations import WorkspaceManagerGroupsOperations
+from ._workspace_manager_members_operations import WorkspaceManagerMembersOperations
+from ._data_connector_definitions_operations import DataConnectorDefinitionsOperations
from ._data_connectors_operations import DataConnectorsOperations
from ._data_connectors_check_requirements_operations import DataConnectorsCheckRequirementsOperations
from ._operations import Operations
@@ -48,46 +73,70 @@
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
-
__all__ = [
- "AlertRulesOperations",
- "ActionsOperations",
- "AlertRuleTemplatesOperations",
- "AutomationRulesOperations",
- "IncidentsOperations",
- "BookmarksOperations",
- "BookmarkRelationsOperations",
- "BookmarkOperations",
- "IPGeodataOperations",
- "DomainWhoisOperations",
- "EntitiesOperations",
- "EntitiesGetTimelineOperations",
- "EntitiesRelationsOperations",
- "EntityRelationsOperations",
- "EntityQueriesOperations",
- "EntityQueryTemplatesOperations",
- "FileImportsOperations",
- "IncidentCommentsOperations",
- "IncidentRelationsOperations",
- "IncidentTasksOperations",
- "MetadataOperations",
- "OfficeConsentsOperations",
- "SentinelOnboardingStatesOperations",
- "GetRecommendationsOperations",
- "GetOperations",
- "UpdateOperations",
- "SecurityMLAnalyticsSettingsOperations",
- "ProductSettingsOperations",
- "SourceControlOperations",
- "SourceControlsOperations",
- "ThreatIntelligenceIndicatorOperations",
- "ThreatIntelligenceIndicatorsOperations",
- "ThreatIntelligenceIndicatorMetricsOperations",
- "WatchlistsOperations",
- "WatchlistItemsOperations",
- "DataConnectorsOperations",
- "DataConnectorsCheckRequirementsOperations",
- "Operations",
+ 'AlertRulesOperations',
+ 'ActionsOperations',
+ 'AlertRuleTemplatesOperations',
+ 'AutomationRulesOperations',
+ 'EntitiesOperations',
+ 'IncidentsOperations',
+ 'BillingStatisticsOperations',
+ 'BookmarksOperations',
+ 'BookmarkRelationsOperations',
+ 'BookmarkOperations',
+ 'BusinessApplicationAgentsOperations',
+ 'BusinessApplicationAgentOperations',
+ 'SystemsOperations',
+ 'ContentPackagesOperations',
+ 'ContentPackageOperations',
+ 'ProductPackagesOperations',
+ 'ProductPackageOperations',
+ 'ProductTemplatesOperations',
+ 'ProductTemplateOperations',
+ 'ContentTemplatesOperations',
+ 'ContentTemplateOperations',
+ 'SecurityInsightsOperationsMixin',
+ 'EntitiesGetTimelineOperations',
+ 'EntitiesRelationsOperations',
+ 'EntityRelationsOperations',
+ 'EntityQueriesOperations',
+ 'EntityQueryTemplatesOperations',
+ 'FileImportsOperations',
+ 'HuntsOperations',
+ 'HuntRelationsOperations',
+ 'HuntCommentsOperations',
+ 'IncidentCommentsOperations',
+ 'IncidentRelationsOperations',
+ 'IncidentTasksOperations',
+ 'MetadataOperations',
+ 'OfficeConsentsOperations',
+ 'SentinelOnboardingStatesOperations',
+ 'GetRecommendationsOperations',
+ 'GetOperations',
+ 'UpdateOperations',
+ 'ReevaluateOperations',
+ 'SecurityMLAnalyticsSettingsOperations',
+ 'ProductSettingsOperations',
+ 'SourceControlOperations',
+ 'SourceControlsOperations',
+ 'ThreatIntelligenceIndicatorOperations',
+ 'ThreatIntelligenceIndicatorsOperations',
+ 'ThreatIntelligenceIndicatorMetricsOperations',
+ 'ThreatIntelligenceOperations',
+ 'TriggeredAnalyticsRuleRunOperations',
+ 'GetTriggeredAnalyticsRuleRunsOperations',
+ 'AlertRuleOperations',
+ 'WatchlistsOperations',
+ 'WatchlistItemsOperations',
+ 'WorkspaceManagerAssignmentsOperations',
+ 'WorkspaceManagerAssignmentJobsOperations',
+ 'WorkspaceManagerConfigurationsOperations',
+ 'WorkspaceManagerGroupsOperations',
+ 'WorkspaceManagerMembersOperations',
+ 'DataConnectorDefinitionsOperations',
+ 'DataConnectorsOperations',
+ 'DataConnectorsCheckRequirementsOperations',
+ 'Operations',
]
__all__.extend([p for p in _patch_all if p not in __all__])
_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..907e553f7ad1 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,184 +34,170 @@
def build_list_by_alert_rule_request(
- resource_group_name: str, workspace_name: str, rule_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ rule_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/alertRules/{ruleId}/actions",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, rule_id: str, action_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ action_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/alertRules/{ruleId}/actions/{actionId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
- "actionId": _SERIALIZER.url("action_id", action_id, "str"),
+ "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]$'),
+ "ruleId": _SERIALIZER.url("rule_id", rule_id, 'str'),
+ "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")
+ _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)
+ _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, rule_id: str, action_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ action_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/alertRules/{ruleId}/actions/{actionId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
- "actionId": _SERIALIZER.url("action_id", action_id, "str"),
+ "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]$'),
+ "ruleId": _SERIALIZER.url("rule_id", rule_id, 'str'),
+ "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")
+ _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)
+ _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, rule_id: str, action_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ action_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/alertRules/{ruleId}/actions/{actionId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
- "actionId": _SERIALIZER.url("action_id", action_id, "str"),
+ "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]$'),
+ "ruleId": _SERIALIZER.url("rule_id", rule_id, 'str'),
+ "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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class ActionsOperations:
+class ActionsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -238,9 +216,16 @@ 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_by_alert_rule(
- self, resource_group_name: str, workspace_name: str, rule_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ **kwargs: Any
) -> Iterable["_models.ActionResponse"]:
"""Gets all actions of alert rule.
@@ -251,7 +236,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,65 +243,58 @@ 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
)
- cls: ClsType[_models.ActionsList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("ActionsList", pipeline_response)
+ deserialized = self._deserialize(
+ "ActionsList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -327,15 +304,20 @@ def get_next(next_link=None):
return pipeline_response
- 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"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, rule_id: str, action_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ action_id: str,
+ **kwargs: Any
) -> _models.ActionResponse:
"""Gets the action of alert rule.
@@ -348,43 +330,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.ActionResponse] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -393,16 +373,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}"
- }
@overload
def create_or_update(
@@ -432,7 +413,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 +425,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,16 +442,16 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
@@ -479,7 +459,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,42 +473,35 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.ActionResponse] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +511,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -555,24 +529,26 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ action_id: str,
+ **kwargs: Any
) -> None:
"""Delete the action of alert rule.
@@ -585,43 +561,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -631,8 +605,6 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rule_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rule_operations.py
new file mode 100644
index 000000000000..a6616f6b423a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_alert_rule_operations.py
@@ -0,0 +1,319 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterator, Optional, Type, TypeVar, Union, cast, overload
+
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, StreamConsumedError, map_error
+from azure.core.pipeline import PipelineResponse
+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
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # 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_trigger_rule_run_request(
+ resource_group_name: str,
+ workspace_name: str,
+ rule_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', "2024-04-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/alertRules/{ruleId}/triggerRuleRun") # 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]$'),
+ "ruleId": _SERIALIZER.url("rule_id", rule_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="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class AlertRuleOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`alert_rule` 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 _trigger_rule_run_initial(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ analytics_rule_run_trigger_parameter: Union[_models.AnalyticsRuleRunTrigger, IO[bytes]],
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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[Iterator[bytes]] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(analytics_rule_run_trigger_parameter, (IOBase, bytes)):
+ _content = analytics_rule_run_trigger_parameter
+ else:
+ _json = self._serialize.body(analytics_rule_run_trigger_parameter, 'AnalyticsRuleRunTrigger')
+
+ _request = build_trigger_rule_run_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,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ 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]:
+ 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 = {}
+ 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
+
+
+
+ @overload
+ def begin_trigger_rule_run(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ analytics_rule_run_trigger_parameter: _models.AnalyticsRuleRunTrigger,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """triggers analytics rule run.
+
+ :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 rule_id: Alert rule ID. Required.
+ :type rule_id: str
+ :param analytics_rule_run_trigger_parameter: The Analytics Rule Run Trigger parameter.
+ Required.
+ :type analytics_rule_run_trigger_parameter:
+ ~azure.mgmt.securityinsight.models.AnalyticsRuleRunTrigger
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :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:
+ """
+
+ @overload
+ def begin_trigger_rule_run(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ analytics_rule_run_trigger_parameter: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """triggers analytics rule run.
+
+ :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 rule_id: Alert rule ID. Required.
+ :type rule_id: str
+ :param analytics_rule_run_trigger_parameter: The Analytics Rule Run Trigger parameter.
+ Required.
+ :type analytics_rule_run_trigger_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
+ :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:
+ """
+
+
+ @distributed_trace
+ def begin_trigger_rule_run(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ analytics_rule_run_trigger_parameter: Union[_models.AnalyticsRuleRunTrigger, IO[bytes]],
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """triggers analytics rule run.
+
+ :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 rule_id: Alert rule ID. Required.
+ :type rule_id: str
+ :param analytics_rule_run_trigger_parameter: The Analytics Rule Run Trigger parameter. Is
+ either a AnalyticsRuleRunTrigger type or a IO[bytes] type. Required.
+ :type analytics_rule_run_trigger_parameter:
+ ~azure.mgmt.securityinsight.models.AnalyticsRuleRunTrigger or IO[bytes]
+ :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:
+ """
+ _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[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._trigger_rule_run_initial(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ rule_id=rule_id,
+ analytics_rule_run_trigger_parameter=analytics_rule_run_trigger_parameter,
+ 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)
+
+ 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': 'location'},
+
+ **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
+ )
+
+
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..387f50df3754 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,34 +7,25 @@
# 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
+from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,91 +33,81 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/alertRuleTemplates",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
+ _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, alert_rule_template_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ alert_rule_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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/alertRuleTemplates/{alertRuleTemplateId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "alertRuleTemplateId": _SERIALIZER.url("alert_rule_template_id", alert_rule_template_id, "str"),
+ "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]$'),
+ "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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class AlertRuleTemplatesOperations:
+class AlertRuleTemplatesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -145,9 +126,15 @@ 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> Iterable["_models.AlertRuleTemplate"]:
"""Gets all alert rule templates.
@@ -156,7 +143,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,64 +150,57 @@ 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
)
- cls: ClsType[_models.AlertRuleTemplatesList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("AlertRuleTemplatesList", pipeline_response)
+ deserialized = self._deserialize(
+ "AlertRuleTemplatesList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -231,15 +210,19 @@ 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/alertRuleTemplates"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, alert_rule_template_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ alert_rule_template_id: str,
+ **kwargs: Any
) -> _models.AlertRuleTemplate:
"""Gets the alert rule template.
@@ -250,42 +233,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.AlertRuleTemplate] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -294,13 +275,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates/{alertRuleTemplateId}"
- }
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..5636b51f9b64 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,180 +34,162 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/alertRules",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
+ _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, rule_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ rule_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/alertRules/{ruleId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, rule_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ rule_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/alertRules/{ruleId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, rule_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ rule_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/alertRules/{ruleId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"),
+ "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]$'),
+ "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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class AlertRulesOperations:
+class AlertRulesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -234,8 +208,16 @@ 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.AlertRule"]:
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> Iterable["_models.AlertRule"]:
"""Gets all alert rules.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -243,7 +225,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,64 +232,57 @@ 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
)
- cls: ClsType[_models.AlertRulesList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("AlertRulesList", pipeline_response)
+ deserialized = self._deserialize(
+ "AlertRulesList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -318,14 +292,20 @@ 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/alertRules"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
- def get(self, resource_group_name: str, workspace_name: str, rule_id: str, **kwargs: Any) -> _models.AlertRule:
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ **kwargs: Any
+ ) -> _models.AlertRule:
"""Gets the alert rule.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -335,42 +315,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.AlertRule] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -379,16 +357,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}"
- }
@overload
def create_or_update(
@@ -415,7 +394,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 +405,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,23 +420,23 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
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,42 +448,35 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.AlertRule] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +485,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -531,24 +503,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ rule_id: str,
+ **kwargs: Any
) -> None:
"""Delete the alert rule.
@@ -559,42 +532,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -604,8 +575,6 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}"
- }
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..0e9abd809bf1 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,40 +6,28 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -47,180 +35,162 @@
def build_get_request(
- resource_group_name: str, workspace_name: str, automation_rule_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ automation_rule_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/automationRules/{automationRuleId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "automationRuleId": _SERIALIZER.url("automation_rule_id", automation_rule_id, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, automation_rule_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ automation_rule_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/automationRules/{automationRuleId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "automationRuleId": _SERIALIZER.url("automation_rule_id", automation_rule_id, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, automation_rule_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ automation_rule_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/automationRules/{automationRuleId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "automationRuleId": _SERIALIZER.url("automation_rule_id", automation_rule_id, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/automationRules",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class AutomationRulesOperations:
+class AutomationRulesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -239,9 +209,16 @@ 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 get(
- self, resource_group_name: str, workspace_name: str, automation_rule_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ automation_rule_id: str,
+ **kwargs: Any
) -> _models.AutomationRule:
"""Gets the automation rule.
@@ -252,42 +229,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.AutomationRule] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -296,16 +271,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}"
- }
@overload
def create_or_update(
@@ -332,7 +308,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 +319,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,23 +334,23 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
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,46 +362,39 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.AutomationRule] = kwargs.pop(
+ 'cls', None
)
- 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:
- _json = self._serialize.body(automation_rule_to_upsert, "AutomationRule")
+ _json = self._serialize.body(automation_rule_to_upsert, 'AutomationRule')
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 +403,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -452,23 +421,26 @@ 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 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:
+ def delete(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ automation_rule_id: str,
+ **kwargs: Any
+ ) -> JSON:
"""Delete the automation rule.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -478,42 +450,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[JSON] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -522,23 +492,25 @@ 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 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"]:
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> Iterable["_models.AutomationRule"]:
"""Gets all automation rules.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -546,7 +518,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,64 +525,57 @@ 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
)
- cls: ClsType[_models.AutomationRulesList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("AutomationRulesList", pipeline_response)
+ deserialized = self._deserialize(
+ "AutomationRulesList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -621,8 +585,8 @@ 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"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_billing_statistics_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_billing_statistics_operations.py
new file mode 100644
index 000000000000..9d7e65849875
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_billing_statistics_operations.py
@@ -0,0 +1,290 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/billingStatistics") # 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')
+
+ # 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,
+ billing_statistic_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/billingStatistics/{billingStatisticName}") # 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]$'),
+ "billingStatisticName": _SERIALIZER.url("billing_statistic_name", billing_statistic_name, 'str', 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')
+
+ # Construct headers
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class BillingStatisticsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`billing_statistics` 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
+ ) -> Iterable["_models.BillingStatistic"]:
+ """Gets all Microsoft Sentinel billing statistics.
+
+ :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
+ :return: An iterator like instance of either BillingStatistic or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.BillingStatistic]
+ :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.BillingStatisticList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "BillingStatisticList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ billing_statistic_name: str,
+ **kwargs: Any
+ ) -> _models.BillingStatistic:
+ """Gets a billing statistic.
+
+ :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 billing_statistic_name: The name of the billing statistic. Required.
+ :type billing_statistic_name: str
+ :return: BillingStatistic or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.BillingStatistic
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.BillingStatistic] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ billing_statistic_name=billing_statistic_name,
+ 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]:
+ 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)
+
+ deserialized = self._deserialize(
+ 'BillingStatistic',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
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
index 493b78b645ee..3764e01e4026 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,33 +6,25 @@
# 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 typing import Any, Callable, Dict, IO, Optional, Type, 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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -40,52 +32,47 @@
def build_expand_request(
- resource_group_name: str, workspace_name: str, bookmark_id: str, subscription_id: str, **kwargs: Any
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "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")
+ _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)
-
+ _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:
+class BookmarkOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -104,6 +91,9 @@ 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 expand(
self,
@@ -130,7 +120,6 @@ def expand(
: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:
@@ -142,7 +131,7 @@ def expand(
resource_group_name: str,
workspace_name: str,
bookmark_id: str,
- parameters: IO,
+ parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -158,23 +147,23 @@ def expand(
:type bookmark_id: str
:param parameters: The parameters required to execute an expand operation on the given
bookmark. Required.
- :type parameters: IO
+ :type parameters: 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: 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],
+ parameters: Union[_models.BookmarkExpandParameters, IO[bytes]],
**kwargs: Any
) -> _models.BookmarkExpandResponse:
"""Expand an bookmark.
@@ -187,42 +176,35 @@ def expand(
: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
+ bookmark. Is either a BookmarkExpandParameters type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.securityinsight.models.BookmarkExpandParameters or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.BookmarkExpandResponse] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
- _json = self._serialize.body(parameters, "BookmarkExpandParameters")
+ _json = self._serialize.body(parameters, 'BookmarkExpandParameters')
- request = build_expand_request(
+ _request = build_expand_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
bookmark_id=bookmark_id,
@@ -231,15 +213,16 @@ def expand(
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -248,13 +231,14 @@ def expand(
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)
+ deserialized = self._deserialize(
+ 'BookmarkExpandResponse',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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
index ea17c2058589..57f13cdb8b14 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -56,49 +48,41 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if filter is not None:
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ _params['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ _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')
if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_get_request(
@@ -112,42 +96,34 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, '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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_create_or_update_request(
@@ -161,45 +137,37 @@ 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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, '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")
+ _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)
+ _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(
@@ -213,45 +181,36 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "bookmarkId": _SERIALIZER.url("bookmark_id", bookmark_id, '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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class BookmarkRelationsOperations:
+class BookmarkRelationsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -270,6 +229,9 @@ 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,
@@ -303,7 +265,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,23 +272,19 @@ 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
)
- cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,
bookmark_id=bookmark_id,
@@ -337,43 +294,40 @@ 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
_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 = 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
+ _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("RelationList", pipeline_response)
+ deserialized = self._deserialize(
+ "RelationList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -383,15 +337,20 @@ 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/bookmarks/{bookmarkId}/relations"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, bookmark_id: str, relation_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ bookmark_id: str,
+ relation_name: str,
+ **kwargs: Any
) -> _models.Relation:
"""Gets a bookmark relation.
@@ -404,43 +363,41 @@ def get(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Relation] = kwargs.pop(
+ 'cls', None
)
- 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,
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -449,16 +406,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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(
@@ -488,7 +446,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,7 +458,7 @@ def create_or_update(
workspace_name: str,
bookmark_id: str,
relation_name: str,
- relation: IO,
+ relation: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -518,16 +475,16 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
@@ -535,7 +492,7 @@ def create_or_update(
workspace_name: str,
bookmark_id: str,
relation_name: str,
- relation: Union[_models.Relation, IO],
+ relation: Union[_models.Relation, IO[bytes]],
**kwargs: Any
) -> _models.Relation:
"""Creates the bookmark relation.
@@ -549,42 +506,35 @@ def create_or_update(
: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
+ :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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Relation] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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,
bookmark_id=bookmark_id,
@@ -594,15 +544,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -611,24 +562,26 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ bookmark_id: str,
+ relation_name: str,
+ **kwargs: Any
) -> None:
"""Delete the bookmark relation.
@@ -641,43 +594,41 @@ def delete( # pylint: disable=inconsistent-return-statements
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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,
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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -687,8 +638,6 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- 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..3a3246767711 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,180 +34,162 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
+ _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, subscription_id: str, **kwargs: Any
+ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _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, subscription_id: str, **kwargs: Any
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _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, subscription_id: str, **kwargs: Any
+ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class BookmarksOperations:
+class BookmarksOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -234,8 +208,16 @@ 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.Bookmark"]:
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> Iterable["_models.Bookmark"]:
"""Gets all bookmarks.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -243,7 +225,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,64 +232,57 @@ 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
)
- cls: ClsType[_models.BookmarkList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("BookmarkList", pipeline_response)
+ deserialized = self._deserialize(
+ "BookmarkList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -318,14 +292,20 @@ 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/bookmarks"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
- def get(self, resource_group_name: str, workspace_name: str, bookmark_id: str, **kwargs: Any) -> _models.Bookmark:
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ bookmark_id: str,
+ **kwargs: Any
+ ) -> _models.Bookmark:
"""Gets a bookmark.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -335,42 +315,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Bookmark] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -379,16 +357,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}"
- }
@overload
def create_or_update(
@@ -415,7 +394,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 +405,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,23 +420,23 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
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,42 +448,35 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Bookmark] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +485,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -531,24 +503,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ bookmark_id: str,
+ **kwargs: Any
) -> None:
"""Delete the bookmark.
@@ -559,42 +532,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -604,8 +575,6 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_business_application_agent_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_business_application_agent_operations.py
new file mode 100644
index 000000000000..2122e2d4121e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_business_application_agent_operations.py
@@ -0,0 +1,162 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, TypeVar
+
+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 # 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,
+ workspace_name: str,
+ agent_resource_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/businessApplicationAgents/{agentResourceName}") # 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]$'),
+ "agentResourceName": _SERIALIZER.url("agent_resource_name", agent_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ }
+
+ _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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class BusinessApplicationAgentOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`business_application_agent` 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,
+ workspace_name: str,
+ agent_resource_name: str,
+ **kwargs: Any
+ ) -> _models.BusinessApplicationAgentResource:
+ """Gets Business Application Agent.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :return: BusinessApplicationAgentResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.BusinessApplicationAgentResource] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ 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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'BusinessApplicationAgentResource',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_business_application_agents_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_business_application_agents_operations.py
new file mode 100644
index 000000000000..c24efbcdffe4
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_business_application_agents_operations.py
@@ -0,0 +1,496 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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_create_or_update_request(
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/businessApplicationAgents/{agentResourceName}") # 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]$'),
+ "agentResourceName": _SERIALIZER.url("agent_resource_name", agent_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ }
+
+ _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_delete_request(
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/businessApplicationAgents/{agentResourceName}") # 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]$'),
+ "agentResourceName": _SERIALIZER.url("agent_resource_name", agent_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ }
+
+ _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
+ )
+
+
+def build_list_request(
+ resource_group_name: str,
+ workspace_name: str,
+ subscription_id: str,
+ *,
+ filter: Optional[str] = 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', "2024-04-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/businessApplicationAgents") # 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 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 BusinessApplicationAgentsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`business_application_agents` 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 create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ agent_to_upsert: Optional[_models.BusinessApplicationAgentResource] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.BusinessApplicationAgentResource:
+ """Creates or updates the Business Application Agent.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param agent_to_upsert: The Business Application Agent. Default value is None.
+ :type agent_to_upsert: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: BusinessApplicationAgentResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ agent_to_upsert: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.BusinessApplicationAgentResource:
+ """Creates or updates the Business Application Agent.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param agent_to_upsert: The Business Application Agent. Default value is None.
+ :type agent_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
+ :return: BusinessApplicationAgentResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ agent_to_upsert: Optional[Union[_models.BusinessApplicationAgentResource, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> _models.BusinessApplicationAgentResource:
+ """Creates or updates the Business Application Agent.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param agent_to_upsert: The Business Application Agent. Is either a
+ BusinessApplicationAgentResource type or a IO[bytes] type. Default value is None.
+ :type agent_to_upsert: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource or
+ IO[bytes]
+ :return: BusinessApplicationAgentResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.BusinessApplicationAgentResource] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(agent_to_upsert, (IOBase, bytes)):
+ _content = agent_to_upsert
+ else:
+ if agent_to_upsert is not None:
+ _json = self._serialize.body(agent_to_upsert, 'BusinessApplicationAgentResource')
+ else:
+ _json = None
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ 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(
+ 'BusinessApplicationAgentResource',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Delete the Business Application Agent.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ agent_resource_name=agent_resource_name,
+ 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
+
+
+
+ @distributed_trace
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ filter: Optional[str] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.BusinessApplicationAgentResource"]:
+ """Gets all Business Application Agents under 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 filter: Filters the results, based on a Boolean condition. Optional. Default value is
+ None.
+ :type filter: 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
+ :return: An iterator like instance of either BusinessApplicationAgentResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.BusinessApplicationAgentResource]
+ :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.BusinessApplicationAgentsList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "BusinessApplicationAgentsList",
+ 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/_content_package_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_package_operations.py
new file mode 100644
index 000000000000..61bdd94976a4
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_package_operations.py
@@ -0,0 +1,346 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # 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_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', "2024-04-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/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', "2024-04-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/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[int, Type[HttpResponseError]] = {
+ 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[int, Type[HttpResponseError]] = {
+ 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/_content_packages_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_packages_operations.py
new file mode 100644
index 000000000000..4db1146babc9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_packages_operations.py
@@ -0,0 +1,344 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # 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,
+ 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', "2024-04-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/contentPackages") # 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
+ )
+
+
+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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class ContentPackagesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`content_packages` 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.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 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: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.PackageList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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(
+ "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)
+
+ _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
+ )
+
+
+ @distributed_trace
+ def get(
+ 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 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.PackageModel] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _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,
+ 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]:
+ 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
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_template_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_template_operations.py
new file mode 100644
index 000000000000..ac8b6d26a863
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_template_operations.py
@@ -0,0 +1,461 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # 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_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/contentTemplates/{templateId}") # 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]$'),
+ "templateId": _SERIALIZER.url("template_id", template_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_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/contentTemplates/{templateId}") # 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]$'),
+ "templateId": _SERIALIZER.url("template_id", template_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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_delete_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/contentTemplates/{templateId}") # 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]$'),
+ "templateId": _SERIALIZER.url("template_id", template_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 ContentTemplateOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`content_template` 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,
+ 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
+ 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
+ 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[int, Type[HttpResponseError]] = {
+ 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 = 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,
+ 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[int, Type[HttpResponseError]] = {
+ 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 = 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
+ def delete( # pylint: disable=inconsistent-return-statements
+ 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[int, Type[HttpResponseError]] = {
+ 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 = 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/_content_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_templates_operations.py
new file mode 100644
index 000000000000..a03791129e67
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_content_templates_operations.py
@@ -0,0 +1,247 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # 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,
+ 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', "2024-04-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/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[int, Type[HttpResponseError]] = {
+ 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/_data_connector_definitions_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connector_definitions_operations.py
new file mode 100644
index 000000000000..d96775e20b6b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connector_definitions_operations.py
@@ -0,0 +1,584 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/dataConnectorDefinitions") # 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')
+
+ # 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,
+ 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/dataConnectorDefinitions/{dataConnectorDefinitionName}") # 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]$'),
+ "dataConnectorDefinitionName": _SERIALIZER.url("data_connector_definition_name", data_connector_definition_name, 'str', pattern=r'^[a-z0-9A-Z-_]*$'),
+ }
+
+ _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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_create_or_update_request(
+ 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/dataConnectorDefinitions/{dataConnectorDefinitionName}") # 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]$'),
+ "dataConnectorDefinitionName": _SERIALIZER.url("data_connector_definition_name", data_connector_definition_name, 'str', pattern=r'^[a-z0-9A-Z-_]*$'),
+ }
+
+ _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_delete_request(
+ 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/dataConnectorDefinitions/{dataConnectorDefinitionName}") # 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]$'),
+ "dataConnectorDefinitionName": _SERIALIZER.url("data_connector_definition_name", data_connector_definition_name, 'str', pattern=r'^[a-z0-9A-Z-_]*$'),
+ }
+
+ _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 DataConnectorDefinitionsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`data_connector_definitions` 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
+ ) -> 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
+ :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: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.DataConnectorDefinitionArmCollectionWrapper] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "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)
+
+ _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
+ )
+
+
+ @distributed_trace
+ def get(
+ 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 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.DataConnectorDefinition] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ data_connector_definition_name=data_connector_definition_name,
+ 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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'DataConnectorDefinition',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ connector_definition_input: _models.DataConnectorDefinition,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _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 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
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ connector_definition_input: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _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 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
+ :return: DataConnectorDefinition or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.DataConnectorDefinition
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ connector_definition_input: Union[_models.DataConnectorDefinition, IO[bytes]],
+ **kwargs: Any
+ ) -> _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 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.DataConnectorDefinition] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(connector_definition_input, (IOBase, bytes)):
+ _content = connector_definition_input
+ else:
+ _json = self._serialize.body(connector_definition_input, 'DataConnectorDefinition')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ 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,
+ 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(
+ 'DataConnectorDefinition',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_definition_name: str,
+ **kwargs: Any
+ ) -> None:
+ """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 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ data_connector_definition_name=data_connector_definition_name,
+ 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/_data_connectors_check_requirements_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_data_connectors_check_requirements_operations.py
index a443aede96d7..b4ca576f047e 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,33 +6,25 @@
# 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 typing import Any, Callable, Dict, IO, Optional, Type, 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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -40,51 +32,45 @@
def build_post_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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]$",
- ),
+ "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 = _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")
+ _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)
-
+ _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:
+class DataConnectorsCheckRequirementsOperations: # pylint: disable=name-too-long
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -103,6 +89,9 @@ 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 post(
self,
@@ -127,7 +116,6 @@ def post(
: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:
@@ -138,7 +126,7 @@ def post(
self,
resource_group_name: str,
workspace_name: str,
- data_connectors_check_requirements: IO,
+ data_connectors_check_requirements: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -152,22 +140,22 @@ def post(
:type workspace_name: str
:param data_connectors_check_requirements: The parameters for requirements check message.
Required.
- :type data_connectors_check_requirements: IO
+ :type data_connectors_check_requirements: 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: 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],
+ data_connectors_check_requirements: Union[_models.DataConnectorsCheckRequirements, IO[bytes]],
**kwargs: Any
) -> _models.DataConnectorRequirementsState:
"""Get requirements state for a data connector type.
@@ -178,43 +166,36 @@ def post(
: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.
+ either a DataConnectorsCheckRequirements type or a IO[bytes] 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
+ ~azure.mgmt.securityinsight.models.DataConnectorsCheckRequirements or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.DataConnectorRequirementsState] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(data_connectors_check_requirements, (IOBase, bytes)):
_content = data_connectors_check_requirements
else:
- _json = self._serialize.body(data_connectors_check_requirements, "DataConnectorsCheckRequirements")
+ _json = self._serialize.body(data_connectors_check_requirements, 'DataConnectorsCheckRequirements')
- request = build_post_request(
+ _request = build_post_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
subscription_id=self._config.subscription_id,
@@ -222,15 +203,16 @@ def post(
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -239,13 +221,14 @@ def post(
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)
+ deserialized = self._deserialize(
+ 'DataConnectorRequirementsState',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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..d657316c0822 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,269 +34,243 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
+ _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, data_connector_id: str, subscription_id: str, **kwargs: Any
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _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, data_connector_id: str, subscription_id: str, **kwargs: Any
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _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, data_connector_id: str, subscription_id: str, **kwargs: Any
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ 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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "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")
+ _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)
+ _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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class DataConnectorsOperations:
+class DataConnectorsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -323,8 +289,16 @@ 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.DataConnector"]:
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> Iterable["_models.DataConnector"]:
"""Gets all data connectors.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -332,7 +306,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,64 +313,57 @@ 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
)
- cls: ClsType[_models.DataConnectorList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("DataConnectorList", pipeline_response)
+ deserialized = self._deserialize(
+ "DataConnectorList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -407,15 +373,19 @@ 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/dataConnectors"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, data_connector_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_id: str,
+ **kwargs: Any
) -> _models.DataConnector:
"""Gets a data connector.
@@ -426,42 +396,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.DataConnector] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -470,16 +438,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}"
- }
@overload
def create_or_update(
@@ -506,7 +475,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 +486,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,23 +501,23 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
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,42 +529,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.DataConnector] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +567,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -622,24 +585,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_id: str,
+ **kwargs: Any
) -> None:
"""Delete the data connector.
@@ -650,42 +614,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -695,11 +657,9 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- 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
@@ -726,7 +686,6 @@ def connect( # 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:
@@ -738,7 +697,7 @@ def connect( # pylint: disable=inconsistent-return-statements
resource_group_name: str,
workspace_name: str,
data_connector_id: str,
- connect_body: IO,
+ connect_body: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -753,23 +712,23 @@ def connect( # pylint: disable=inconsistent-return-statements
:param data_connector_id: Connector ID. Required.
:type data_connector_id: str
:param connect_body: The data connector. Required.
- :type connect_body: IO
+ :type connect_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: 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],
+ connect_body: Union[_models.DataConnectorConnectBody, IO[bytes]],
**kwargs: Any
) -> None:
"""Connects a data connector.
@@ -781,42 +740,36 @@ def connect( # pylint: disable=inconsistent-return-statements
: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
+ :param connect_body: The data connector. Is either a DataConnectorConnectBody type or a
+ IO[bytes] type. Required.
+ :type connect_body: ~azure.mgmt.securityinsight.models.DataConnectorConnectBody or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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[None] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(connect_body, (IOBase, bytes)):
_content = connect_body
else:
- _json = self._serialize.body(connect_body, "DataConnectorConnectBody")
+ _json = self._serialize.body(connect_body, 'DataConnectorConnectBody')
- request = build_connect_request(
+ _request = build_connect_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
data_connector_id=data_connector_id,
@@ -825,15 +778,16 @@ def connect( # pylint: disable=inconsistent-return-statements
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -843,15 +797,17 @@ def connect( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ data_connector_id: str,
+ **kwargs: Any
) -> None:
"""Disconnect a data connector.
@@ -862,42 +818,40 @@ def disconnect( # 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[None] = kwargs.pop("cls", None)
- request = build_disconnect_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -907,8 +861,6 @@ def disconnect( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- disconnect.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/disconnect"
- }
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
index 0cdd1ffdd887..7d3246d1e12d 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,33 +6,25 @@
# 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 typing import Any, Callable, Dict, IO, Optional, Type, 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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -40,52 +32,47 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, entity_id: str, subscription_id: str, **kwargs: Any
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "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")
+ _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)
-
+ _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:
+class EntitiesGetTimelineOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -104,6 +91,9 @@ 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(
self,
@@ -130,7 +120,6 @@ def list(
: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:
@@ -142,7 +131,7 @@ def list(
resource_group_name: str,
workspace_name: str,
entity_id: str,
- parameters: IO,
+ parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -158,23 +147,23 @@ def list(
:type entity_id: str
:param parameters: The parameters required to execute an timeline operation on the given
entity. Required.
- :type parameters: IO
+ :type parameters: 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: 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],
+ parameters: Union[_models.EntityTimelineParameters, IO[bytes]],
**kwargs: Any
) -> _models.EntityTimelineResponse:
"""Timeline for an entity.
@@ -187,42 +176,35 @@ def list(
: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
+ entity. Is either a EntityTimelineParameters type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.securityinsight.models.EntityTimelineParameters or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.EntityTimelineResponse] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
- _json = self._serialize.body(parameters, "EntityTimelineParameters")
+ _json = self._serialize.body(parameters, 'EntityTimelineParameters')
- request = build_list_request(
+ _request = build_list_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
entity_id=entity_id,
@@ -231,15 +213,16 @@ def list(
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -248,13 +231,14 @@ 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("EntityTimelineResponse", pipeline_response)
+ deserialized = self._deserialize(
+ 'EntityTimelineResponse',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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..2c31229866e4 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,170 +6,191 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # 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
+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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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]$'),
+ "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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
# Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+ 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_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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'),
+ "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]$'),
+ }
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+ _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="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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "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")
+ _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)
+ _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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "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")
+ _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)
+ _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(
@@ -184,91 +205,78 @@ def build_queries_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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "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")
- _params["kind"] = _SERIALIZER.query("kind", kind, "str")
+ _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)
+ _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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}/getInsights",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights") # 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"),
+ "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]$'),
+ "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")
+ _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)
-
+ _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 EntitiesOperations:
+class EntitiesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -287,8 +295,162 @@ 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 run_playbook( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_identifier: str,
+ request_body: Optional[_models.EntityManualTriggerRequestBody] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> 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_identifier: Entity identifier. 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
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def run_playbook( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_identifier: str,
+ request_body: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> 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_identifier: Entity identifier. 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
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
@distributed_trace
- def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> Iterable["_models.Entity"]:
+ def run_playbook( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_identifier: str,
+ request_body: Optional[Union[_models.EntityManualTriggerRequestBody, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> 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_identifier: Entity identifier. 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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[None] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(request_body, (IOBase, bytes)):
+ _content = request_body
+ else:
+ if request_body is not None:
+ _json = self._serialize.body(request_body, 'EntityManualTriggerRequestBody')
+ else:
+ _json = None
+
+ _request = build_run_playbook_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ entity_identifier=entity_identifier,
+ 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 [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
+
+
+
+ @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.
@@ -296,7 +458,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 Entity or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Entity]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -304,64 +465,57 @@ 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.EntityList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.EntityList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("EntityList", pipeline_response)
+ deserialized = self._deserialize(
+ "EntityList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -371,14 +525,20 @@ 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"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
- def get(self, resource_group_name: str, workspace_name: str, entity_id: str, **kwargs: Any) -> _models.Entity:
+ 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.
@@ -388,42 +548,40 @@ def get(self, resource_group_name: str, workspace_name: str, entity_id: str, **k
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Entity] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.Entity] = kwargs.pop("cls", None)
- request = build_get_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -432,16 +590,17 @@ def get(self, resource_group_name: str, workspace_name: str, entity_id: str, **k
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)
+ deserialized = self._deserialize(
+ 'Entity',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}"
- }
@overload
def expand(
@@ -469,7 +628,6 @@ def expand(
: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:
@@ -481,7 +639,7 @@ def expand(
resource_group_name: str,
workspace_name: str,
entity_id: str,
- parameters: IO,
+ parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -497,23 +655,23 @@ def expand(
:type entity_id: str
:param parameters: The parameters required to execute an expand operation on the given entity.
Required.
- :type parameters: IO
+ :type parameters: 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
: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],
+ parameters: Union[_models.EntityExpandParameters, IO[bytes]],
**kwargs: Any
) -> _models.EntityExpandResponse:
"""Expands an entity.
@@ -526,42 +684,35 @@ def expand(
: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
+ Is either a EntityExpandParameters type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.securityinsight.models.EntityExpandParameters or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.EntityExpandResponse] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
- _json = self._serialize.body(parameters, "EntityExpandParameters")
+ _json = self._serialize.body(parameters, 'EntityExpandParameters')
- request = build_expand_request(
+ _request = build_expand_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
entity_id=entity_id,
@@ -570,15 +721,16 @@ def expand(
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -587,16 +739,17 @@ def expand(
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)
+ deserialized = self._deserialize(
+ 'EntityExpandResponse',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- expand.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand"
- }
@distributed_trace
def queries(
@@ -606,7 +759,7 @@ def queries(
entity_id: str,
kind: Union[str, _models.EntityItemQueryKind],
**kwargs: Any
- ) -> _models.GetQueriesResponse:
+ ) -> Iterable["_models.EntityQueryItem"]:
"""Get Insights and Activities for an entity.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -618,61 +771,80 @@ def queries(
: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
+ :return: An iterator like instance of either EntityQueryItem or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.EntityQueryItem]
: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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.GetQueriesResponse] = kwargs.pop(
+ 'cls', None
)
- 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)
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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_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,
+ 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
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize(
+ "GetQueriesResponse",
+ pipeline_response
)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return None, iter(list_of_elem)
- response = pipeline_response.http_response
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
- 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)
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
+ )
+ response = pipeline_response.http_response
- deserialized = self._deserialize("GetQueriesResponse", pipeline_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, deserialized, {})
+ return pipeline_response
- return deserialized
- queries.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/queries"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@overload
def get_insights(
@@ -699,7 +871,6 @@ def get_insights(
: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:
@@ -711,7 +882,7 @@ def get_insights(
resource_group_name: str,
workspace_name: str,
entity_id: str,
- parameters: IO,
+ parameters: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -726,23 +897,23 @@ def get_insights(
: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
+ :type parameters: 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
:raises ~azure.core.exceptions.HttpResponseError:
"""
+
@distributed_trace
def get_insights(
self,
resource_group_name: str,
workspace_name: str,
entity_id: str,
- parameters: Union[_models.EntityGetInsightsParameters, IO],
+ parameters: Union[_models.EntityGetInsightsParameters, IO[bytes]],
**kwargs: Any
) -> _models.EntityGetInsightsResponse:
"""Execute Insights for an entity.
@@ -755,42 +926,35 @@ def get_insights(
: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
+ EntityGetInsightsParameters type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.securityinsight.models.EntityGetInsightsParameters or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.EntityGetInsightsResponse] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(parameters, (IOBase, bytes)):
_content = parameters
else:
- _json = self._serialize.body(parameters, "EntityGetInsightsParameters")
+ _json = self._serialize.body(parameters, 'EntityGetInsightsParameters')
- request = build_get_insights_request(
+ _request = build_get_insights_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
entity_id=entity_id,
@@ -799,15 +963,16 @@ def get_insights(
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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -816,13 +981,14 @@ def get_insights(
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)
+ deserialized = self._deserialize(
+ 'EntityGetInsightsResponse',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get_insights.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights"
- }
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/_entities_relations_operations.py
index e160a77e83f7..b47e3dc94401 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/_entities_relations_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,34 +7,25 @@
# 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
+from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -56,52 +47,43 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/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]$",
- ),
- "entityId": _SERIALIZER.url("entity_id", entity_id, "str"),
+ "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]$'),
+ "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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if filter is not None:
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ _params['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ _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')
if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class EntitiesRelationsOperations:
+class EntitiesRelationsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -120,6 +102,9 @@ 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,
@@ -153,7 +138,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:
@@ -161,23 +145,19 @@ 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
)
- cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,
@@ -187,43 +167,40 @@ 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
_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 = 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
+ _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("RelationList", pipeline_response)
+ deserialized = self._deserialize(
+ "RelationList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -233,8 +210,8 @@ 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"
- }
+ 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/_entity_queries_operations.py
index 89f9d636c466..408ed61e9789 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/_entity_queries_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -46,183 +38,162 @@ def build_list_request(
workspace_name: str,
subscription_id: str,
*,
- kind: Optional[Union[str, _models.Enum13]] = None,
+ kind: Optional[Union[str, _models.EntityQueryTemplateKind]] = 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/entityQueries",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries") # 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]$",
- ),
+ "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 = _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")
+ _params['kind'] = _SERIALIZER.query("kind", kind, 'str')
+ _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)
+ _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_query_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ entity_query_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/entityQueries/{entityQueryId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") # 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]$",
- ),
- "entityQueryId": _SERIALIZER.url("entity_query_id", entity_query_id, "str"),
+ "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]$'),
+ "entityQueryId": _SERIALIZER.url("entity_query_id", entity_query_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")
+ _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)
+ _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, entity_query_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ entity_query_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/entityQueries/{entityQueryId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") # 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]$",
- ),
- "entityQueryId": _SERIALIZER.url("entity_query_id", entity_query_id, "str"),
+ "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]$'),
+ "entityQueryId": _SERIALIZER.url("entity_query_id", entity_query_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")
+ _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)
+ _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, entity_query_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ entity_query_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/entityQueries/{entityQueryId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") # 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]$",
- ),
- "entityQueryId": _SERIALIZER.url("entity_query_id", entity_query_id, "str"),
+ "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]$'),
+ "entityQueryId": _SERIALIZER.url("entity_query_id", entity_query_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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class EntityQueriesOperations:
+class EntityQueriesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -241,12 +212,15 @@ 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,
- kind: Optional[Union[str, _models.Enum13]] = None,
+ kind: Optional[Union[str, _models.EntityQueryTemplateKind]] = None,
**kwargs: Any
) -> Iterable["_models.EntityQuery"]:
"""Gets all entity queries.
@@ -256,10 +230,10 @@ def list(
: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
+ :param kind: The entity query kind we want to fetch. Known values are: "Activity", "Insight",
+ "SecurityAlert", "Bookmark", "Expansion", "GuidedInsight", and "Anomaly". Default value is
+ None.
+ :type kind: str or ~azure.mgmt.securityinsight.models.EntityQueryTemplateKind
:return: An iterator like instance of either EntityQuery or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.EntityQuery]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -267,65 +241,58 @@ 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.EntityQueryList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.EntityQueryList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("EntityQueryList", pipeline_response)
+ deserialized = self._deserialize(
+ "EntityQueryList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -335,15 +302,19 @@ 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/entityQueries"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, entity_query_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_query_id: str,
+ **kwargs: Any
) -> _models.EntityQuery:
"""Gets an entity query.
@@ -354,42 +325,40 @@ def get(
: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
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.EntityQuery] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.EntityQuery] = 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,
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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -398,16 +367,17 @@ 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(
+ 'EntityQuery',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}"
- }
@overload
def create_or_update(
@@ -434,7 +404,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: EntityQuery or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.EntityQuery
:raises ~azure.core.exceptions.HttpResponseError:
@@ -446,7 +415,7 @@ def create_or_update(
resource_group_name: str,
workspace_name: str,
entity_query_id: str,
- entity_query: IO,
+ entity_query: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -461,23 +430,23 @@ def create_or_update(
: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
+ :type entity_query: 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
:raises ~azure.core.exceptions.HttpResponseError:
"""
+
@distributed_trace
def create_or_update(
self,
resource_group_name: str,
workspace_name: str,
entity_query_id: str,
- entity_query: Union[_models.CustomEntityQuery, IO],
+ entity_query: Union[_models.CustomEntityQuery, IO[bytes]],
**kwargs: Any
) -> _models.EntityQuery:
"""Creates or updates the entity query.
@@ -489,43 +458,36 @@ def create_or_update(
: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
+ :param entity_query: The entity query we want to create or update. Is either a
+ CustomEntityQuery type or a IO[bytes] type. Required.
+ :type entity_query: ~azure.mgmt.securityinsight.models.CustomEntityQuery or IO[bytes]
:return: EntityQuery or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.EntityQuery
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.EntityQuery] = kwargs.pop(
+ 'cls', None
)
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.EntityQuery] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
_content = None
- if isinstance(entity_query, (IO, bytes)):
+ if isinstance(entity_query, (IOBase, bytes)):
_content = entity_query
else:
- _json = self._serialize.body(entity_query, "CustomEntityQuery")
+ _json = self._serialize.body(entity_query, 'CustomEntityQuery')
- 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,
@@ -534,15 +496,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -551,24 +514,25 @@ 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(
+ 'EntityQuery',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
+ 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,
+ entity_query_id: str,
+ **kwargs: Any
) -> None:
"""Delete the entity query.
@@ -579,42 +543,40 @@ def delete( # pylint: disable=inconsistent-return-statements
: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: 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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,
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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -624,8 +586,6 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}"
- }
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/_entity_query_templates_operations.py
index cd961f94a317..54eca952e9a4 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/_entity_query_templates_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,34 +7,25 @@
# 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, Type, TypeVar, Union
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -46,94 +37,81 @@ def build_list_request(
workspace_name: str,
subscription_id: str,
*,
- kind: Optional[Union[str, _models.Enum15]] = None,
+ kind: Optional[Union[str, _models.EntityQueryTemplateKind]] = 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/entityQueryTemplates",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates") # 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]$",
- ),
+ "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 = _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")
+ _params['kind'] = _SERIALIZER.query("kind", kind, 'str')
+ _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)
+ _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_query_template_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ entity_query_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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/entityQueryTemplates/{entityQueryTemplateId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{entityQueryTemplateId}") # 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]$",
- ),
- "entityQueryTemplateId": _SERIALIZER.url("entity_query_template_id", entity_query_template_id, "str"),
+ "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]$'),
+ "entityQueryTemplateId": _SERIALIZER.url("entity_query_template_id", entity_query_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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class EntityQueryTemplatesOperations:
+class EntityQueryTemplatesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -152,12 +130,15 @@ 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,
- kind: Optional[Union[str, _models.Enum15]] = None,
+ kind: Optional[Union[str, _models.EntityQueryTemplateKind]] = None,
**kwargs: Any
) -> Iterable["_models.EntityQueryTemplate"]:
"""Gets all entity query templates.
@@ -167,9 +148,10 @@ def list(
: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
+ :param kind: The entity template query kind we want to fetch. Known values are: "Activity",
+ "Insight", "SecurityAlert", "Bookmark", "Expansion", "GuidedInsight", and "Anomaly". Default
+ value is None.
+ :type kind: str or ~azure.mgmt.securityinsight.models.EntityQueryTemplateKind
:return: An iterator like instance of either EntityQueryTemplate or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.EntityQueryTemplate]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -177,65 +159,58 @@ 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.EntityQueryTemplateList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.EntityQueryTemplateList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("EntityQueryTemplateList", pipeline_response)
+ deserialized = self._deserialize(
+ "EntityQueryTemplateList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -245,15 +220,19 @@ 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/entityQueryTemplates"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, entity_query_template_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_query_template_id: str,
+ **kwargs: Any
) -> _models.EntityQueryTemplate:
"""Gets an entity query.
@@ -264,42 +243,40 @@ def get(
: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
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.EntityQueryTemplate] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.EntityQueryTemplate] = 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,
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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -308,13 +285,14 @@ 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(
+ 'EntityQueryTemplate',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{entityQueryTemplateId}"
- }
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
index 676e478cc9d2..a90027159864 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,32 +7,23 @@
# 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 typing import Any, Callable, Dict, Optional, Type, 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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -50,45 +41,36 @@ def build_get_relation_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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "entityId": _SERIALIZER.url("entity_id", entity_id, '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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class EntityRelationsOperations:
+class EntityRelationsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -107,9 +89,17 @@ 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 get_relation(
- self, resource_group_name: str, workspace_name: str, entity_id: str, relation_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ entity_id: str,
+ relation_name: str,
+ **kwargs: Any
) -> _models.Relation:
"""Gets an entity relation.
@@ -122,43 +112,41 @@ def get_relation(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Relation] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.Relation] = kwargs.pop("cls", None)
- request = build_get_relation_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -167,13 +155,14 @@ def get_relation(
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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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
index 156bf96f7654..f859fbabd17b 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,23 +6,16 @@
# 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, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, 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.polling import LROPoller, NoPolling, PollingMethod
-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
@@ -30,13 +23,12 @@
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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -57,183 +49,162 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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]$",
- ),
+ "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 = _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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if filter is not None:
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ _params['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ _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')
if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ _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)
+ _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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "fileImportId": _SERIALIZER.url("file_import_id", file_import_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")
+ _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)
+ _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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "fileImportId": _SERIALIZER.url("file_import_id", file_import_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")
+ _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)
+ _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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "fileImportId": _SERIALIZER.url("file_import_id", file_import_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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class FileImportsOperations:
+class FileImportsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -252,6 +223,9 @@ 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,
@@ -282,7 +256,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 FileImport or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.FileImport]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -290,23 +263,19 @@ 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.FileImportList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.FileImportList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,
@@ -315,61 +284,63 @@ 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
_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 = 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
+ _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("FileImportList", pipeline_response)
+ deserialized = self._deserialize(
+ "FileImportList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, 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"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, file_import_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ file_import_id: str,
+ **kwargs: Any
) -> _models.FileImport:
"""Gets a file import.
@@ -380,60 +351,60 @@ def get(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.FileImport] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.FileImport] = kwargs.pop("cls", None)
- request = build_get_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("FileImport", pipeline_response)
+ deserialized = self._deserialize(
+ 'FileImport',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}"
- }
@overload
def create(
@@ -460,7 +431,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: FileImport or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.FileImport
:raises ~azure.core.exceptions.HttpResponseError:
@@ -472,7 +442,7 @@ def create(
resource_group_name: str,
workspace_name: str,
file_import_id: str,
- file_import: IO,
+ file_import: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -487,23 +457,23 @@ def create(
:param file_import_id: File import ID. Required.
:type file_import_id: str
:param file_import: The file import. Required.
- :type file_import: IO
+ :type file_import: 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: 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],
+ file_import: Union[_models.FileImport, IO[bytes]],
**kwargs: Any
) -> _models.FileImport:
"""Creates the file import.
@@ -515,42 +485,35 @@ def create(
: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
+ :param file_import: The file import. Is either a FileImport type or a IO[bytes] type. Required.
+ :type file_import: ~azure.mgmt.securityinsight.models.FileImport or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.FileImport] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(file_import, (IOBase, bytes)):
_content = file_import
else:
- _json = self._serialize.body(file_import, "FileImport")
+ _json = self._serialize.body(file_import, 'FileImport')
- request = build_create_request(
+ _request = build_create_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
file_import_id=file_import_id,
@@ -559,92 +522,109 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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 [201]:
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("FileImport", pipeline_response)
+ deserialized = self._deserialize(
+ 'FileImport',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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,
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ file_import_id: str,
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[Optional[_models.FileImport]] = kwargs.pop("cls", None)
- request = build_delete_request(
+
+ _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
+ _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)
- 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)
- deserialized = None
+ response_headers = {}
if response.status_code == 202:
- deserialized = self._deserialize("FileImport", pipeline_response)
+ 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, {})
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
- 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ file_import_id: str,
+ **kwargs: Any
) -> LROPoller[_models.FileImport]:
"""Delete the file import.
@@ -655,14 +635,6 @@ def begin_delete(
: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:
@@ -670,49 +642,62 @@ def begin_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[_models.FileImport] = kwargs.pop(
+ 'cls', None
+ )
+ polling: Union[bool, PollingMethod] = kwargs.pop('polling', True)
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
)
- 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)
+ 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,
+ cls=lambda x,y,z: x,
headers=_headers,
params=_params,
**kwargs
)
- kwargs.pop("error_map", None)
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop('error_map', None)
def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("FileImport", pipeline_response)
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
+
+ deserialized = self._deserialize(
+ 'FileImport',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
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
+ 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(
+ return LROPoller[_models.FileImport].from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
- deserialization_callback=get_long_running_output,
+ deserialization_callback=get_long_running_output
+ )
+ return LROPoller[_models.FileImport](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
- 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/_get_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_operations.py
index 8d495ea329ef..c3f1be87f261 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_operations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,32 +7,23 @@
# 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 typing import Any, Callable, Dict, Optional, Type, 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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -40,49 +31,44 @@
def build_single_recommendation_request(
- resource_group_name: str, workspace_name: str, recommendation_id: str, subscription_id: str, **kwargs: Any
+ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/recommendations/{recommendationId}",
- ) # pylint: disable=line-too-long
+ _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"),
+ "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]$'),
+ "recommendationId": _SERIALIZER.url("recommendation_id", recommendation_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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class GetOperations:
+class GetOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -101,9 +87,16 @@ 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 single_recommendation(
- self, resource_group_name: str, workspace_name: str, recommendation_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ recommendation_id: str,
+ **kwargs: Any
) -> _models.Recommendation:
"""Gets a recommendation by its id.
@@ -114,42 +107,40 @@ def single_recommendation(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Recommendation] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.Recommendation] = kwargs.pop("cls", None)
- request = build_single_recommendation_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -158,13 +149,14 @@ 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(
+ 'Recommendation',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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/operations/_get_recommendations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_recommendations_operations.py
index a6e5f145a99f..0dafd90776bd 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/_get_recommendations_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,32 +7,25 @@
# 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 typing import Any, Callable, Dict, Iterable, Optional, Type, 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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -40,48 +33,42 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/recommendations",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations") # 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]$",
- ),
+ "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 = _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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class GetRecommendationsOperations:
+class GetRecommendationsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -100,8 +87,16 @@ 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) -> _models.RecommendationList:
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> Iterable["_models.Recommendation"]:
"""Gets a list of all recommendations.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -109,56 +104,75 @@ 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: RecommendationList or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.RecommendationList
+ :return: An iterator like instance of either Recommendation or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.RecommendationList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.RecommendationList] = 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
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "RecommendationList",
+ 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)
- response = pipeline_response.http_response
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
- 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)
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
+ )
+ response = pipeline_response.http_response
- deserialized = self._deserialize("RecommendationList", pipeline_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, deserialized, {})
+ return pipeline_response
- return deserialized
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_triggered_analytics_rule_runs_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_triggered_analytics_rule_runs_operations.py
new file mode 100644
index 000000000000..de5c5499ee8a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_get_triggered_analytics_rule_runs_operations.py
@@ -0,0 +1,180 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/triggeredAnalyticsRuleRuns") # 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')
+
+ # Construct headers
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class GetTriggeredAnalyticsRuleRunsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`get_triggered_analytics_rule_runs` 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
+ ) -> Iterable["_models.TriggeredAnalyticsRuleRun"]:
+ """Gets the triggered analytics rule runs.
+
+ :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
+ :return: An iterator like instance of either TriggeredAnalyticsRuleRun or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.TriggeredAnalyticsRuleRun]
+ :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.TriggeredAnalyticsRuleRuns] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "TriggeredAnalyticsRuleRuns",
+ 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/_hunt_comments_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_hunt_comments_operations.py
new file mode 100644
index 000000000000..28044d8a3b89
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_hunt_comments_operations.py
@@ -0,0 +1,644 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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,
+ hunt_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/hunts/{huntId}/comments") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_id, 'str'),
+ }
+
+ _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')
+
+ # 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,
+ hunt_id: str,
+ hunt_comment_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', "2024-04-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/hunts/{huntId}/comments/{huntCommentId}") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_id, 'str'),
+ "huntCommentId": _SERIALIZER.url("hunt_comment_id", hunt_comment_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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_delete_request(
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_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', "2024-04-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/hunts/{huntId}/comments/{huntCommentId}") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_id, 'str'),
+ "huntCommentId": _SERIALIZER.url("hunt_comment_id", hunt_comment_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
+ )
+
+
+def build_create_or_update_request(
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_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', "2024-04-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/hunts/{huntId}/comments/{huntCommentId}") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_id, 'str'),
+ "huntCommentId": _SERIALIZER.url("hunt_comment_id", hunt_comment_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
+ )
+
+class HuntCommentsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`hunt_comments` 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,
+ hunt_id: str,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.HuntComment"]:
+ """Gets all hunt comments.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_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
+ :return: An iterator like instance of either HuntComment or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.HuntComment]
+ :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.HuntCommentList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ hunt_id=hunt_id,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ orderby=orderby,
+ top=top,
+ 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(
+ "HuntCommentList",
+ 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
+ )
+
+
+ @distributed_trace
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_id: str,
+ **kwargs: Any
+ ) -> _models.HuntComment:
+ """Gets a hunt comment.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_comment_id: The hunt comment id (GUID). Required.
+ :type hunt_comment_id: str
+ :return: HuntComment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntComment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.HuntComment] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_id,
+ hunt_comment_id=hunt_comment_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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'HuntComment',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_id: str,
+ **kwargs: Any
+ ) -> None:
+ """Delete a hunt comment.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_comment_id: The hunt comment id (GUID). Required.
+ :type hunt_comment_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ hunt_id=hunt_id,
+ hunt_comment_id=hunt_comment_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
+
+
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_id: str,
+ hunt_comment: _models.HuntComment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.HuntComment:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_comment_id: The hunt comment id (GUID). Required.
+ :type hunt_comment_id: str
+ :param hunt_comment: The hunt comment. Required.
+ :type hunt_comment: ~azure.mgmt.securityinsight.models.HuntComment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: HuntComment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntComment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_id: str,
+ hunt_comment: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.HuntComment:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_comment_id: The hunt comment id (GUID). Required.
+ :type hunt_comment_id: str
+ :param hunt_comment: The hunt comment. Required.
+ :type hunt_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
+ :return: HuntComment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntComment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_comment_id: str,
+ hunt_comment: Union[_models.HuntComment, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.HuntComment:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_comment_id: The hunt comment id (GUID). Required.
+ :type hunt_comment_id: str
+ :param hunt_comment: The hunt comment. Is either a HuntComment type or a IO[bytes] type.
+ Required.
+ :type hunt_comment: ~azure.mgmt.securityinsight.models.HuntComment or IO[bytes]
+ :return: HuntComment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntComment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.HuntComment] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(hunt_comment, (IOBase, bytes)):
+ _content = hunt_comment
+ else:
+ _json = self._serialize.body(hunt_comment, 'HuntComment')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_id,
+ hunt_comment_id=hunt_comment_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(
+ 'HuntComment',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_hunt_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_hunt_relations_operations.py
new file mode 100644
index 000000000000..dee1ff0fe406
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_hunt_relations_operations.py
@@ -0,0 +1,644 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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,
+ hunt_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/hunts/{huntId}/relations") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_id, 'str'),
+ }
+
+ _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')
+
+ # 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,
+ hunt_id: str,
+ hunt_relation_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', "2024-04-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/hunts/{huntId}/relations/{huntRelationId}") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_id, 'str'),
+ "huntRelationId": _SERIALIZER.url("hunt_relation_id", hunt_relation_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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_delete_request(
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_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', "2024-04-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/hunts/{huntId}/relations/{huntRelationId}") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_id, 'str'),
+ "huntRelationId": _SERIALIZER.url("hunt_relation_id", hunt_relation_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
+ )
+
+
+def build_create_or_update_request(
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_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', "2024-04-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/hunts/{huntId}/relations/{huntRelationId}") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_id, 'str'),
+ "huntRelationId": _SERIALIZER.url("hunt_relation_id", hunt_relation_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
+ )
+
+class HuntRelationsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`hunt_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,
+ hunt_id: str,
+ filter: Optional[str] = None,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.HuntRelation"]:
+ """Gets all hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_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
+ :return: An iterator like instance of either HuntRelation or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.HuntRelation]
+ :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.HuntRelationList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ hunt_id=hunt_id,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ orderby=orderby,
+ top=top,
+ 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(
+ "HuntRelationList",
+ 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
+ )
+
+
+ @distributed_trace
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_id: str,
+ **kwargs: Any
+ ) -> _models.HuntRelation:
+ """Gets a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_relation_id: The hunt relation id (GUID). Required.
+ :type hunt_relation_id: str
+ :return: HuntRelation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntRelation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.HuntRelation] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_id,
+ hunt_relation_id=hunt_relation_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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'HuntRelation',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_id: str,
+ **kwargs: Any
+ ) -> None:
+ """Delete a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_relation_id: The hunt relation id (GUID). Required.
+ :type hunt_relation_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ hunt_id=hunt_id,
+ hunt_relation_id=hunt_relation_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
+
+
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_id: str,
+ hunt_relation: _models.HuntRelation,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.HuntRelation:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_relation_id: The hunt relation id (GUID). Required.
+ :type hunt_relation_id: str
+ :param hunt_relation: The hunt relation. Required.
+ :type hunt_relation: ~azure.mgmt.securityinsight.models.HuntRelation
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: HuntRelation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntRelation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_id: str,
+ hunt_relation: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.HuntRelation:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_relation_id: The hunt relation id (GUID). Required.
+ :type hunt_relation_id: str
+ :param hunt_relation: The hunt relation. Required.
+ :type hunt_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
+ :return: HuntRelation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntRelation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt_relation_id: str,
+ hunt_relation: Union[_models.HuntRelation, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.HuntRelation:
+ """Creates or updates a hunt 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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt_relation_id: The hunt relation id (GUID). Required.
+ :type hunt_relation_id: str
+ :param hunt_relation: The hunt relation. Is either a HuntRelation type or a IO[bytes] type.
+ Required.
+ :type hunt_relation: ~azure.mgmt.securityinsight.models.HuntRelation or IO[bytes]
+ :return: HuntRelation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.HuntRelation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.HuntRelation] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(hunt_relation, (IOBase, bytes)):
+ _content = hunt_relation
+ else:
+ _json = self._serialize.body(hunt_relation, 'HuntRelation')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_id,
+ hunt_relation_id=hunt_relation_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(
+ 'HuntRelation',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_hunts_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_hunts_operations.py
new file mode 100644
index 000000000000..be38d59e0f01
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_hunts_operations.py
@@ -0,0 +1,613 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/hunts") # 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 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,
+ hunt_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', "2024-04-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/hunts/{huntId}") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_delete_request(
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_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', "2024-04-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/hunts/{huntId}") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_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
+ )
+
+
+def build_create_or_update_request(
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_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', "2024-04-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/hunts/{huntId}") # 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]$'),
+ "huntId": _SERIALIZER.url("hunt_id", hunt_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
+ )
+
+class HuntsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`hunts` 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.Hunt"]:
+ """Gets all hunts, without relations and comments.
+
+ :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
+ :return: An iterator like instance of either Hunt or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Hunt]
+ :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.HuntList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "HuntList",
+ 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
+ )
+
+
+ @distributed_trace
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ **kwargs: Any
+ ) -> _models.Hunt:
+ """Gets a hunt, without relations and comments.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :return: Hunt or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Hunt
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.Hunt] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'Hunt',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ **kwargs: Any
+ ) -> None:
+ """Delete a hunt.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ hunt_id=hunt_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
+
+
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt: _models.Hunt,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Hunt:
+ """Create or update a hunt.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt: The hunt. Required.
+ :type hunt: ~azure.mgmt.securityinsight.models.Hunt
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: Hunt or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Hunt
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Hunt:
+ """Create or update a hunt.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt: The hunt. Required.
+ :type hunt: 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: Hunt or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Hunt
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ hunt_id: str,
+ hunt: Union[_models.Hunt, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.Hunt:
+ """Create or update a hunt.
+
+ :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 hunt_id: The hunt id (GUID). Required.
+ :type hunt_id: str
+ :param hunt: The hunt. Is either a Hunt type or a IO[bytes] type. Required.
+ :type hunt: ~azure.mgmt.securityinsight.models.Hunt or IO[bytes]
+ :return: Hunt or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Hunt
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.Hunt] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(hunt, (IOBase, bytes)):
+ _content = hunt
+ else:
+ _json = self._serialize.body(hunt, 'Hunt')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ hunt_id=hunt_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(
+ 'Hunt',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
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..e18f6198b3cf 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -56,49 +48,41 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/comments",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if filter is not None:
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ _params['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ _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')
if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_get_request(
@@ -112,42 +96,34 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/comments/{incidentCommentId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
- "incidentCommentId": _SERIALIZER.url("incident_comment_id", incident_comment_id, "str"),
+ "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]$'),
+ "incidentId": _SERIALIZER.url("incident_id", incident_id, 'str'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_create_or_update_request(
@@ -161,45 +137,37 @@ 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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}/comments/{incidentCommentId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
- "incidentCommentId": _SERIALIZER.url("incident_comment_id", incident_comment_id, "str"),
+ "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]$'),
+ "incidentId": _SERIALIZER.url("incident_id", incident_id, 'str'),
+ "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")
+ _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)
+ _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(
@@ -213,45 +181,36 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/comments/{incidentCommentId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
- "incidentCommentId": _SERIALIZER.url("incident_comment_id", incident_comment_id, "str"),
+ "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]$'),
+ "incidentId": _SERIALIZER.url("incident_id", incident_id, 'str'),
+ "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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class IncidentCommentsOperations:
+class IncidentCommentsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -270,6 +229,9 @@ 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,
@@ -303,7 +265,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,23 +272,19 @@ 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
)
- cls: ClsType[_models.IncidentCommentList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,43 +294,40 @@ 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
_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 = 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
+ _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("IncidentCommentList", pipeline_response)
+ deserialized = self._deserialize(
+ "IncidentCommentList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -383,15 +337,20 @@ 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/incidents/{incidentId}/comments"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, incident_id: str, incident_comment_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ incident_comment_id: str,
+ **kwargs: Any
) -> _models.IncidentComment:
"""Gets an incident comment.
@@ -404,43 +363,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.IncidentComment] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -449,16 +406,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}"
- }
@overload
def create_or_update(
@@ -488,7 +446,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,7 +458,7 @@ 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
@@ -518,16 +475,16 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
@@ -535,7 +492,7 @@ 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.
@@ -549,42 +506,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.IncidentComment] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +545,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -611,24 +563,26 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ incident_comment_id: str,
+ **kwargs: Any
) -> None:
"""Delete the incident comment.
@@ -641,43 +595,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -687,8 +639,6 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}"
- }
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..97ee3e4443fe 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -56,49 +48,41 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/relations",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if filter is not None:
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ _params['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ _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')
if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_get_request(
@@ -112,42 +96,34 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/relations/{relationName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
- "relationName": _SERIALIZER.url("relation_name", relation_name, "str"),
+ "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]$'),
+ "incidentId": _SERIALIZER.url("incident_id", incident_id, '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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_create_or_update_request(
@@ -161,45 +137,37 @@ 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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}/relations/{relationName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
- "relationName": _SERIALIZER.url("relation_name", relation_name, "str"),
+ "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]$'),
+ "incidentId": _SERIALIZER.url("incident_id", incident_id, '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")
+ _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)
+ _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(
@@ -213,45 +181,36 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/relations/{relationName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
- "relationName": _SERIALIZER.url("relation_name", relation_name, "str"),
+ "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]$'),
+ "incidentId": _SERIALIZER.url("incident_id", incident_id, '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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class IncidentRelationsOperations:
+class IncidentRelationsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -270,6 +229,9 @@ 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,
@@ -303,7 +265,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,23 +272,19 @@ 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
)
- cls: ClsType[_models.RelationList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,43 +294,40 @@ 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
_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 = 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
+ _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("RelationList", pipeline_response)
+ deserialized = self._deserialize(
+ "RelationList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -383,15 +337,20 @@ 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/incidents/{incidentId}/relations"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, incident_id: str, relation_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ relation_name: str,
+ **kwargs: Any
) -> _models.Relation:
"""Gets an incident relation.
@@ -404,43 +363,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Relation] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -449,16 +406,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}"
- }
@overload
def create_or_update(
@@ -488,7 +446,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,7 +458,7 @@ 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
@@ -518,16 +475,16 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
@@ -535,7 +492,7 @@ 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.
@@ -549,42 +506,35 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Relation] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +544,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -611,24 +562,26 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ relation_name: str,
+ **kwargs: Any
) -> None:
"""Delete the incident relation.
@@ -641,43 +594,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -687,8 +638,6 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}"
- }
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..6827f6669fc0 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,46 +34,42 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, incident_id: str, subscription_id: str, **kwargs: Any
+ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/tasks",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_get_request(
@@ -95,42 +83,34 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/tasks/{incidentTaskId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
- "incidentTaskId": _SERIALIZER.url("incident_task_id", incident_task_id, "str"),
+ "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]$'),
+ "incidentId": _SERIALIZER.url("incident_id", incident_id, 'str'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_create_or_update_request(
@@ -144,45 +124,37 @@ 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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}/tasks/{incidentTaskId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
- "incidentTaskId": _SERIALIZER.url("incident_task_id", incident_task_id, "str"),
+ "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]$'),
+ "incidentId": _SERIALIZER.url("incident_id", incident_id, 'str'),
+ "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")
+ _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)
+ _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(
@@ -196,45 +168,36 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/tasks/{incidentTaskId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
- "incidentTaskId": _SERIALIZER.url("incident_task_id", incident_task_id, "str"),
+ "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]$'),
+ "incidentId": _SERIALIZER.url("incident_id", incident_id, 'str'),
+ "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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class IncidentTasksOperations:
+class IncidentTasksOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -253,9 +216,16 @@ 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, incident_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> Iterable["_models.IncidentTask"]:
"""Gets all incident tasks.
@@ -266,7 +236,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,65 +243,58 @@ 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
)
- cls: ClsType[_models.IncidentTaskList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("IncidentTaskList", pipeline_response)
+ deserialized = self._deserialize(
+ "IncidentTaskList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -342,15 +304,20 @@ 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/incidents/{incidentId}/tasks"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, incident_id: str, incident_task_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ incident_task_id: str,
+ **kwargs: Any
) -> _models.IncidentTask:
"""Gets an incident task.
@@ -363,43 +330,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.IncidentTask] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -408,16 +373,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}"
- }
@overload
def create_or_update(
@@ -447,7 +413,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 +425,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,16 +442,16 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
@@ -494,7 +459,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,42 +473,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.IncidentTask] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +512,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -570,24 +530,26 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ incident_task_id: str,
+ **kwargs: Any
) -> None:
"""Delete the incident task.
@@ -600,43 +562,41 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -646,8 +606,6 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}"
- }
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..5b88183cbf72 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,40 +6,28 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -47,49 +35,45 @@
def build_run_playbook_request(
- resource_group_name: str, workspace_name: str, incident_identifier: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ incident_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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/{incidentIdentifier}/runPlaybook",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "incidentIdentifier": _SERIALIZER.url("incident_identifier", incident_identifier, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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_request(
@@ -106,358 +90,321 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if filter is not None:
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ _params['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ _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')
if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ _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)
+ _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, incident_id: str, subscription_id: str, **kwargs: Any
+ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _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, incident_id: str, subscription_id: str, **kwargs: Any
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _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, incident_id: str, subscription_id: str, **kwargs: Any
+ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ 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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "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")
+ _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)
+ _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
+ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/alerts",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_list_bookmarks_request(
- resource_group_name: str, workspace_name: str, incident_id: str, subscription_id: str, **kwargs: Any
+ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/bookmarks",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_list_entities_request(
- resource_group_name: str, workspace_name: str, incident_id: str, subscription_id: str, **kwargs: Any
+ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/incidents/{incidentId}/entities",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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"),
+ "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]$'),
+ "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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class IncidentsOperations:
+class IncidentsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -476,6 +423,9 @@ 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 run_playbook(
self,
@@ -501,7 +451,6 @@ def run_playbook(
: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
:raises ~azure.core.exceptions.HttpResponseError:
@@ -513,7 +462,7 @@ 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
@@ -528,23 +477,23 @@ def run_playbook(
:param incident_identifier: Required.
:type incident_identifier: str
:param request_body: Default value is None.
- :type request_body: IO
+ :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
:raises ~azure.core.exceptions.HttpResponseError:
"""
+
@distributed_trace
def run_playbook(
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:
"""Triggers playbook on a specific incident.
@@ -556,45 +505,39 @@ def run_playbook(
:type workspace_name: str
:param incident_identifier: 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
+ :param request_body: 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: JSON or the result of cls(response)
:rtype: JSON
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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[JSON] = kwargs.pop(
+ 'cls', None
)
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[JSON] = 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:
- _json = self._serialize.body(request_body, "ManualTriggerRequestBody")
+ _json = self._serialize.body(request_body, 'ManualTriggerRequestBody')
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 +546,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -620,16 +564,17 @@ 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)
+ deserialized = self._deserialize(
+ 'object',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- run_playbook.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentIdentifier}/runPlaybook"
- }
@distributed_trace
def list(
@@ -661,7 +606,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,23 +613,19 @@ 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
)
- cls: ClsType[_models.IncidentList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,43 +634,40 @@ 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
_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 = 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
+ _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("IncidentList", pipeline_response)
+ deserialized = self._deserialize(
+ "IncidentList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -740,14 +677,20 @@ 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/incidents"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
- def get(self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any) -> _models.Incident:
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
+ ) -> _models.Incident:
"""Gets an incident.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -757,42 +700,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Incident] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -801,16 +742,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}"
- }
@overload
def create_or_update(
@@ -837,7 +779,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,7 +790,7 @@ 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
@@ -864,23 +805,23 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
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.
@@ -892,42 +833,35 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Incident] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +870,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -953,24 +888,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> None:
"""Delete the incident.
@@ -981,42 +917,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -1026,11 +960,9 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}"
- }
@overload
def create_team(
@@ -1058,7 +990,6 @@ def create_team(
: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:
@@ -1070,7 +1001,7 @@ def create_team(
resource_group_name: str,
workspace_name: str,
incident_id: str,
- team_properties: IO,
+ team_properties: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -1086,23 +1017,23 @@ def create_team(
:param incident_id: Incident ID. Required.
:type incident_id: str
:param team_properties: Team properties. Required.
- :type team_properties: IO
+ :type team_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: 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],
+ team_properties: Union[_models.TeamInformation, IO[bytes]],
**kwargs: Any
) -> _models.TeamInformation:
"""Creates a Microsoft team to investigate the incident by sharing information and insights
@@ -1115,42 +1046,36 @@ def create_team(
: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
+ :param team_properties: Team properties. Is either a TeamInformation type or a IO[bytes] type.
+ Required.
+ :type team_properties: ~azure.mgmt.securityinsight.models.TeamInformation or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.TeamInformation] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(team_properties, (IOBase, bytes)):
_content = team_properties
else:
- _json = self._serialize.body(team_properties, "TeamInformation")
+ _json = self._serialize.body(team_properties, 'TeamInformation')
- request = build_create_team_request(
+ _request = build_create_team_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
incident_id=incident_id,
@@ -1159,15 +1084,16 @@ def create_team(
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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -1176,20 +1102,25 @@ def create_team(
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)
+ deserialized = self._deserialize(
+ 'TeamInformation',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- create_team.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/createTeam"
- }
@distributed_trace
def list_alerts(
- self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> _models.IncidentAlertList:
"""Gets all incident alerts.
@@ -1200,42 +1131,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.IncidentAlertList] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -1244,20 +1173,25 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- list_alerts.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/alerts"
- }
@distributed_trace
def list_bookmarks(
- self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> _models.IncidentBookmarkList:
"""Gets all incident bookmarks.
@@ -1268,42 +1202,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.IncidentBookmarkList] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -1312,20 +1244,25 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- list_bookmarks.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/bookmarks"
- }
@distributed_trace
def list_entities(
- self, resource_group_name: str, workspace_name: str, incident_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ incident_id: str,
+ **kwargs: Any
) -> _models.IncidentEntitiesResponse:
"""Gets all incident related entities.
@@ -1336,42 +1273,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.IncidentEntitiesResponse] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -1380,13 +1315,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- list_entities.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/entities"
- }
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..2d6aefafe9e0 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -55,229 +47,204 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/metadata",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if filter is not None:
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ _params['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ _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')
if skip is not None:
- _params["$skip"] = _SERIALIZER.query("skip", skip, "int")
+ _params['$skip'] = _SERIALIZER.query("skip", skip, 'int')
# Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+ _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, metadata_name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ metadata_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/metadata/{metadataName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, metadata_name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ metadata_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/metadata/{metadataName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_create_request(
- resource_group_name: str, workspace_name: str, metadata_name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ metadata_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/metadata/{metadataName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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_update_request(
- resource_group_name: str, workspace_name: str, metadata_name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ metadata_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/metadata/{metadataName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "metadataName": _SERIALIZER.url("metadata_name", metadata_name, "str"),
+ "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]$'),
+ "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")
+ _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)
-
+ _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 MetadataOperations:
+class MetadataOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -296,6 +263,9 @@ 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,
@@ -324,7 +294,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,23 +301,19 @@ 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
)
- cls: ClsType[_models.MetadataList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,43 +322,40 @@ 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
_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 = 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
+ _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("MetadataList", pipeline_response)
+ deserialized = self._deserialize(
+ "MetadataList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -403,15 +365,19 @@ 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/metadata"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, metadata_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ metadata_name: str,
+ **kwargs: Any
) -> _models.MetadataModel:
"""Get a Metadata.
@@ -422,42 +388,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.MetadataModel] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -466,20 +430,25 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, metadata_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ metadata_name: str,
+ **kwargs: Any
) -> None:
"""Delete a Metadata.
@@ -490,42 +459,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -535,11 +502,9 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
@overload
def create(
@@ -566,7 +531,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 +542,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,23 +557,23 @@ 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:
"""
+
@distributed_trace
def create(
self,
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,42 +585,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.MetadataModel] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +623,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -682,20 +641,17 @@ 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 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(
@@ -722,7 +678,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 +689,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,23 +704,23 @@ 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:
"""
+
@distributed_trace
def update(
self,
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,42 +732,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.MetadataModel] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +770,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -838,13 +788,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}"
- }
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/_office_consents_operations.py
index 6c185d8b07ac..e5e0801fb8fe 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/_office_consents_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,34 +7,25 @@
# 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
+from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,134 +33,120 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/officeConsents",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents") # 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]$",
- ),
+ "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 = _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")
+ _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)
+ _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, consent_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ consent_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/officeConsents/{consentId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}") # 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]$",
- ),
- "consentId": _SERIALIZER.url("consent_id", consent_id, "str"),
+ "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]$'),
+ "consentId": _SERIALIZER.url("consent_id", consent_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")
+ _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)
+ _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, consent_id: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ consent_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/officeConsents/{consentId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}") # 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]$",
- ),
- "consentId": _SERIALIZER.url("consent_id", consent_id, "str"),
+ "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]$'),
+ "consentId": _SERIALIZER.url("consent_id", consent_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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class OfficeConsentsOperations:
+class OfficeConsentsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -188,8 +165,16 @@ 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"]:
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> Iterable["_models.OfficeConsent"]:
"""Gets all office365 consents.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -197,7 +182,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 OfficeConsent or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.OfficeConsent]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -205,64 +189,57 @@ 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.OfficeConsentList] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.OfficeConsentList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("OfficeConsentList", pipeline_response)
+ deserialized = self._deserialize(
+ "OfficeConsentList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -272,15 +249,19 @@ 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/officeConsents"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, consent_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ consent_id: str,
+ **kwargs: Any
) -> _models.OfficeConsent:
"""Gets an office365 consent.
@@ -291,42 +272,40 @@ def get(
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.OfficeConsent] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.OfficeConsent] = 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,
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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -335,20 +314,25 @@ 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(
+ 'OfficeConsent',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}"
- }
@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,
+ consent_id: str,
+ **kwargs: Any
) -> None:
"""Delete the office365 consent.
@@ -359,42 +343,40 @@ def delete( # pylint: disable=inconsistent-return-statements
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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,
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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -404,8 +386,6 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- 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/operations/_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_operations.py
index e74ff2e56de3..d184b509912a 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,62 +7,58 @@
# 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
+from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # 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(**kwargs: Any) -> HttpRequest:
+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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-01-preview"))
+ accept = _headers.pop('Accept', "application/json")
# Construct URL
_url = kwargs.pop("template_url", "/providers/Microsoft.SecurityInsights/operations")
# Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class Operations:
+class Operations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -81,11 +77,16 @@ 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, **kwargs: Any) -> Iterable["_models.Operation"]:
+ 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,61 +94,54 @@ 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
)
- cls: ClsType[_models.OperationsList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("OperationsList", pipeline_response)
+ deserialized = self._deserialize(
+ "OperationsList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -157,6 +151,8 @@ def get_next(next_link=None):
return pipeline_response
- return ItemPaged(get_next, extract_data)
- list.metadata = {"url": "/providers/Microsoft.SecurityInsights/operations"}
+ return ItemPaged(
+ get_next, extract_data
+ )
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_package_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_package_operations.py
new file mode 100644
index 000000000000..944187774b9f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_package_operations.py
@@ -0,0 +1,162 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, TypeVar
+
+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 # 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,
+ 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', "2024-04-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/contentProductPackages/{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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class ProductPackageOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`product_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")
+
+
+
+
+ @distributed_trace
+ 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
+ :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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.ProductPackageModel] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _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,
+ 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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'ProductPackageModel',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_packages_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_packages_operations.py
new file mode 100644
index 000000000000..6147c0293139
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_packages_operations.py
@@ -0,0 +1,216 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/contentProductPackages") # 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 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
+ )
+
+class ProductPackagesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`product_packages` 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.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 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
+ :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: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.ProductPackageList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "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)
+
+ _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/_product_settings_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_settings_operations.py
index 86def718fd40..db079eb00365 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,33 +6,27 @@
# 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 typing import Any, Callable, Dict, IO, Iterable, Optional, Type, 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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -40,180 +34,162 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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]$",
- ),
+ "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 = _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")
+ _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)
+ _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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "settingsName": _SERIALIZER.url("settings_name", settings_name, 'str', pattern=r'^[a-zA-Z][a-zA-Z0-9]*$'),
}
- _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")
+ _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)
+ _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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "settingsName": _SERIALIZER.url("settings_name", settings_name, 'str', pattern=r'^[a-zA-Z][a-zA-Z0-9]*$'),
}
- _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")
+ _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)
+ _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
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "settingsName": _SERIALIZER.url("settings_name", settings_name, 'str', pattern=r'^[a-zA-Z][a-zA-Z0-9]*$'),
}
- _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")
+ _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)
-
+ _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:
+class ProductSettingsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -232,8 +208,16 @@ 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) -> _models.SettingList:
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> Iterable["_models.Settings"]:
"""List of all the settings.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -241,62 +225,87 @@ 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: SettingList or the result of cls(response)
- :rtype: ~azure.mgmt.securityinsight.models.SettingList
+ :return: An iterator like instance of either Settings or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.SettingList] = kwargs.pop(
+ 'cls', None
)
- 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,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ 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(
+ "SettingList",
+ pipeline_response
)
- request = _convert_request(request)
- request.url = self._client.format_url(request.url)
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
- )
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
- response = pipeline_response.http_response
+ _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)
+ 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)
+ return pipeline_response
- if cls:
- return cls(pipeline_response, deserialized, {})
- return deserialized
+ return ItemPaged(
+ get_next, extract_data
+ )
- 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:
+ 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.
@@ -307,42 +316,40 @@ def get(self, resource_group_name: str, workspace_name: str, settings_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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Settings] = kwargs.pop(
+ 'cls', None
)
- cls: ClsType[_models.Settings] = kwargs.pop("cls", None)
- request = build_get_request(
+
+ _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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -351,20 +358,25 @@ def get(self, resource_group_name: str, workspace_name: str, settings_name: str,
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)
+ deserialized = self._deserialize(
+ 'Settings',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ settings_name: str,
+ **kwargs: Any
) -> None:
"""Delete setting of the product.
@@ -376,42 +388,40 @@ def delete( # pylint: disable=inconsistent-return-statements
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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_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)
+ _request.url = self._client.format_url(_request.url)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -421,11 +431,9 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}"
- }
@overload
def update(
@@ -453,7 +461,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: Settings or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.Settings
:raises ~azure.core.exceptions.HttpResponseError:
@@ -465,7 +472,7 @@ def update(
resource_group_name: str,
workspace_name: str,
settings_name: str,
- settings: IO,
+ settings: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
@@ -481,23 +488,23 @@ def update(
Required.
:type settings_name: str
:param settings: The setting. Required.
- :type settings: IO
+ :type settings: 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: 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],
+ settings: Union[_models.Settings, IO[bytes]],
**kwargs: Any
) -> _models.Settings:
"""Updates setting.
@@ -510,42 +517,35 @@ def update(
: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
+ :param settings: The setting. Is either a Settings type or a IO[bytes] type. Required.
+ :type settings: ~azure.mgmt.securityinsight.models.Settings or IO[bytes]
: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: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Settings] = kwargs.pop(
+ 'cls', None
)
- 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)):
+ if isinstance(settings, (IOBase, bytes)):
_content = settings
else:
- _json = self._serialize.body(settings, "Settings")
+ _json = self._serialize.body(settings, 'Settings')
- request = build_update_request(
+ _request = build_update_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
settings_name=settings_name,
@@ -554,30 +554,32 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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]:
+ 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("Settings", pipeline_response)
+ deserialized = self._deserialize(
+ 'Settings',
+ pipeline_response.http_response
+ )
if cls:
- return cls(pipeline_response, deserialized, {})
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- 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/_product_template_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_template_operations.py
new file mode 100644
index 000000000000..fd95950b723d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_template_operations.py
@@ -0,0 +1,162 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, TypeVar
+
+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 # 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,
+ 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/contentproducttemplates/{templateId}") # 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]$'),
+ "templateId": _SERIALIZER.url("template_id", template_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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class ProductTemplateOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`product_template` 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,
+ 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 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: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.ProductTemplateModel] = 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 = 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(
+ 'ProductTemplateModel',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ 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..479fc28f61a0
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_product_templates_operations.py
@@ -0,0 +1,235 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # 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,
+ 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', "2024-04-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/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[int, Type[HttpResponseError]] = {
+ 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/_reevaluate_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_reevaluate_operations.py
new file mode 100644
index 000000000000..c8b226003ab9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_reevaluate_operations.py
@@ -0,0 +1,162 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, TypeVar
+
+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 # 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/recommendations/{recommendationId}/triggerEvaluation") # 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]$'),
+ "recommendationId": _SERIALIZER.url("recommendation_id", recommendation_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="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class ReevaluateOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`reevaluate` 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 recommendation(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ recommendation_id: str,
+ **kwargs: Any
+ ) -> _models.ReevaluateResponse:
+ """Reevaluate 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
+ :return: ReevaluateResponse or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ReevaluateResponse
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.ReevaluateResponse] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _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,
+ 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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'ReevaluateResponse',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_security_insights_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_security_insights_operations.py
new file mode 100644
index 000000000000..2b5affe98577
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_security_insights_operations.py
@@ -0,0 +1,414 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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
+from .._vendor import SecurityInsightsMixinABC
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # 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_geodata_by_ip_request(
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ 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', "2024-04-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/enrichment/{enrichmentType}/listGeodataByIp") # 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]$'),
+ "enrichmentType": _SERIALIZER.url("enrichment_type", enrichment_type, '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="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_list_whois_by_domain_request(
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ 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', "2024-04-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/enrichment/{enrichmentType}/listWhoisByDomain") # 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]$'),
+ "enrichmentType": _SERIALIZER.url("enrichment_type", enrichment_type, '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="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class SecurityInsightsOperationsMixin(
+ SecurityInsightsMixinABC
+):
+
+ @overload
+ def list_geodata_by_ip(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ ip_address_body: _models.EnrichmentIpAddressBody,
+ *,
+ content_type: str = "application/json",
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param ip_address_body: IP address (v4 or v6) to be enriched. Required.
+ :type ip_address_body: ~azure.mgmt.securityinsight.models.EnrichmentIpAddressBody
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: EnrichmentIpGeodata or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentIpGeodata
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def list_geodata_by_ip(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ ip_address_body: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param ip_address_body: IP address (v4 or v6) to be enriched. Required.
+ :type ip_address_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
+ :return: EnrichmentIpGeodata or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentIpGeodata
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def list_geodata_by_ip(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ ip_address_body: Union[_models.EnrichmentIpAddressBody, IO[bytes]],
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param ip_address_body: IP address (v4 or v6) to be enriched. Is either a
+ EnrichmentIpAddressBody type or a IO[bytes] type. Required.
+ :type ip_address_body: ~azure.mgmt.securityinsight.models.EnrichmentIpAddressBody or IO[bytes]
+ :return: EnrichmentIpGeodata or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentIpGeodata
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.EnrichmentIpGeodata] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(ip_address_body, (IOBase, bytes)):
+ _content = ip_address_body
+ else:
+ _json = self._serialize.body(ip_address_body, 'EnrichmentIpAddressBody')
+
+ _request = build_list_geodata_by_ip_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ enrichment_type=enrichment_type,
+ 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]:
+ 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.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ def list_whois_by_domain(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ domain_body: _models.EnrichmentDomainBody,
+ *,
+ content_type: str = "application/json",
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param domain_body: Domain name to be enriched. Only domain name is accepted. Required.
+ :type domain_body: ~azure.mgmt.securityinsight.models.EnrichmentDomainBody
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: EnrichmentDomainWhois or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhois
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def list_whois_by_domain(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ domain_body: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param domain_body: Domain name to be enriched. Only domain name is accepted. Required.
+ :type domain_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
+ :return: EnrichmentDomainWhois or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhois
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def list_whois_by_domain(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ enrichment_type: Union[str, _models.EnrichmentType],
+ domain_body: Union[_models.EnrichmentDomainBody, IO[bytes]],
+ **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 workspace_name: The name of the workspace. Required.
+ :type workspace_name: str
+ :param enrichment_type: Enrichment type. "main" Required.
+ :type enrichment_type: str or ~azure.mgmt.securityinsight.models.EnrichmentType
+ :param domain_body: Domain name to be enriched. Only domain name is accepted. Is either a
+ EnrichmentDomainBody type or a IO[bytes] type. Required.
+ :type domain_body: ~azure.mgmt.securityinsight.models.EnrichmentDomainBody or IO[bytes]
+ :return: EnrichmentDomainWhois or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.EnrichmentDomainWhois
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.EnrichmentDomainWhois] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(domain_body, (IOBase, bytes)):
+ _content = domain_body
+ else:
+ _json = self._serialize.body(domain_body, 'EnrichmentDomainBody')
+
+ _request = build_list_whois_by_domain_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ enrichment_type=enrichment_type,
+ 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]:
+ 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.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
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..06db726db9fb 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,180 +34,162 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/securityMLAnalyticsSettings",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
+ _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_resource_name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ settings_resource_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/securityMLAnalyticsSettings/{settingsResourceName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "settingsResourceName": _SERIALIZER.url("settings_resource_name", settings_resource_name, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, settings_resource_name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ settings_resource_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/securityMLAnalyticsSettings/{settingsResourceName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "settingsResourceName": _SERIALIZER.url("settings_resource_name", settings_resource_name, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, settings_resource_name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ settings_resource_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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/securityMLAnalyticsSettings/{settingsResourceName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "settingsResourceName": _SERIALIZER.url("settings_resource_name", settings_resource_name, "str"),
+ "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]$'),
+ "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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class SecurityMLAnalyticsSettingsOperations:
+class SecurityMLAnalyticsSettingsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -234,9 +208,15 @@ 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> Iterable["_models.SecurityMLAnalyticsSetting"]:
"""Gets all Security ML Analytics Settings.
@@ -245,7 +225,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,64 +234,57 @@ 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
)
- cls: ClsType[_models.SecurityMLAnalyticsSettingsList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("SecurityMLAnalyticsSettingsList", pipeline_response)
+ deserialized = self._deserialize(
+ "SecurityMLAnalyticsSettingsList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -322,15 +294,19 @@ 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/securityMLAnalyticsSettings"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, settings_resource_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ settings_resource_name: str,
+ **kwargs: Any
) -> _models.SecurityMLAnalyticsSetting:
"""Gets the Security ML Analytics Settings.
@@ -341,42 +317,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.SecurityMLAnalyticsSetting] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -385,16 +359,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}"
- }
@overload
def create_or_update(
@@ -422,7 +397,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 +408,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,23 +423,23 @@ 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:
"""
+
@distributed_trace
def create_or_update(
self,
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,44 +451,37 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.SecurityMLAnalyticsSetting] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +490,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -540,24 +508,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ settings_resource_name: str,
+ **kwargs: Any
) -> None:
"""Delete the Security ML Analytics Settings.
@@ -568,42 +537,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -613,8 +580,6 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}"
- }
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..e7fc83330b44 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,33 +6,25 @@
# 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 typing import Any, Callable, Dict, IO, Optional, Type, 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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -49,43 +41,33 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/onboardingStates/{sentinelOnboardingStateName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "sentinelOnboardingStateName": _SERIALIZER.url(
- "sentinel_onboarding_state_name", sentinel_onboarding_state_name, "str"
- ),
+ "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]$'),
+ "sentinelOnboardingStateName": _SERIALIZER.url("sentinel_onboarding_state_name", sentinel_onboarding_state_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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_create_request(
@@ -98,46 +80,36 @@ 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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/onboardingStates/{sentinelOnboardingStateName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "sentinelOnboardingStateName": _SERIALIZER.url(
- "sentinel_onboarding_state_name", sentinel_onboarding_state_name, "str"
- ),
+ "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]$'),
+ "sentinelOnboardingStateName": _SERIALIZER.url("sentinel_onboarding_state_name", sentinel_onboarding_state_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")
+ _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)
+ _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(
@@ -150,88 +122,72 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/onboardingStates/{sentinelOnboardingStateName}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "sentinelOnboardingStateName": _SERIALIZER.url(
- "sentinel_onboarding_state_name", sentinel_onboarding_state_name, "str"
- ),
+ "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]$'),
+ "sentinelOnboardingStateName": _SERIALIZER.url("sentinel_onboarding_state_name", sentinel_onboarding_state_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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/onboardingStates",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class SentinelOnboardingStatesOperations:
+class SentinelOnboardingStatesOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -250,9 +206,16 @@ 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 get(
- self, resource_group_name: str, workspace_name: str, sentinel_onboarding_state_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ sentinel_onboarding_state_name: str,
+ **kwargs: Any
) -> _models.SentinelOnboardingState:
"""Get Sentinel onboarding state.
@@ -264,42 +227,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.SentinelOnboardingState] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -308,16 +269,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}"
- }
@overload
def create(
@@ -347,7 +309,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 +320,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,23 +337,23 @@ 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:
"""
+
@distributed_trace
def create(
self,
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,46 +367,39 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.SentinelOnboardingState] = kwargs.pop(
+ 'cls', None
)
- 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:
- _json = self._serialize.body(sentinel_onboarding_state_parameter, "SentinelOnboardingState")
+ _json = self._serialize.body(sentinel_onboarding_state_parameter, 'SentinelOnboardingState')
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 +408,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -471,24 +426,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ sentinel_onboarding_state_name: str,
+ **kwargs: Any
) -> None:
"""Delete Sentinel onboarding state.
@@ -500,42 +456,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -545,15 +499,16 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates/{sentinelOnboardingStateName}"
- }
@distributed_trace
def list(
- self, resource_group_name: str, workspace_name: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> _models.SentinelOnboardingStatesList:
"""Gets all Sentinel onboarding states.
@@ -562,41 +517,39 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.SentinelOnboardingStatesList] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -605,13 +558,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/onboardingStates"
- }
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..8e77be0f3cc6 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -45,53 +37,42 @@ def build_list_repositories_request(
resource_group_name: str,
workspace_name: str,
subscription_id: str,
- *,
- json: Union[str, _models.RepoType],
**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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/listRepositories",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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, json=json, **kwargs)
-
+ _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 SourceControlOperations:
+class SourceControlOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -110,9 +91,71 @@ 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 +164,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,68 +175,68 @@ 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)
+ 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
)
- content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json"))
- cls: ClsType[_models.RepoList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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
_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 = 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
+ _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("RepoList", pipeline_response)
+ deserialized = self._deserialize(
+ "RepoList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -202,8 +246,8 @@ 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"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
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..81da96c16152 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,180 +34,165 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/sourcecontrols",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
+ _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, source_control_id: str, subscription_id: str, **kwargs: Any
+ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/sourcecontrols/{sourceControlId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "sourceControlId": _SERIALIZER.url("source_control_id", source_control_id, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, source_control_id: str, subscription_id: str, **kwargs: Any
+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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/sourcecontrols/{sourceControlId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "sourceControlId": _SERIALIZER.url("source_control_id", source_control_id, "str"),
+ "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]$'),
+ "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")
+ _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)
+ 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_create_request(
- resource_group_name: str, workspace_name: str, source_control_id: str, subscription_id: str, **kwargs: Any
+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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/sourcecontrols/{sourceControlId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "sourceControlId": _SERIALIZER.url("source_control_id", source_control_id, "str"),
+ "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]$'),
+ "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")
+ _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)
-
+ _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 SourceControlsOperations:
+class SourceControlsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -234,8 +211,16 @@ 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.SourceControl"]:
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
+ ) -> Iterable["_models.SourceControl"]:
"""Gets all source controls, without source control items.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -243,7 +228,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,64 +235,57 @@ 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
)
- cls: ClsType[_models.SourceControlList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("SourceControlList", pipeline_response)
+ deserialized = self._deserialize(
+ "SourceControlList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -318,15 +295,19 @@ 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/sourcecontrols"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, source_control_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ source_control_id: str,
+ **kwargs: Any
) -> _models.SourceControl:
"""Gets a source control byt its identifier.
@@ -337,42 +318,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.SourceControl] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -381,22 +360,89 @@ 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
+
+
+
+ @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:
+ """
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}"
- }
@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,69 +451,86 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ 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[None] = 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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]:
+ 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
+
+ return deserialized # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}"
- }
@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 +539,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 +569,27 @@ 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,42 +598,37 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.Warning] = kwargs.pop(
+ 'cls', None
)
- 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, (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 +637,32 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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]:
+ 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 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/_systems_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_systems_operations.py
new file mode 100644
index 000000000000..f9ded7b12019
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_systems_operations.py
@@ -0,0 +1,1165 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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_create_or_update_request(
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}") # 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]$'),
+ "agentResourceName": _SERIALIZER.url("agent_resource_name", agent_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ "systemResourceName": _SERIALIZER.url("system_resource_name", system_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ }
+
+ _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_get_request(
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}") # 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]$'),
+ "agentResourceName": _SERIALIZER.url("agent_resource_name", agent_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ "systemResourceName": _SERIALIZER.url("system_resource_name", system_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ }
+
+ _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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_delete_request(
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}") # 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]$'),
+ "agentResourceName": _SERIALIZER.url("agent_resource_name", agent_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ "systemResourceName": _SERIALIZER.url("system_resource_name", system_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ }
+
+ _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
+ )
+
+
+def build_list_request(
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ subscription_id: str,
+ *,
+ filter: Optional[str] = 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', "2024-04-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/businessApplicationAgents/{agentResourceName}/systems") # 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]$'),
+ "agentResourceName": _SERIALIZER.url("agent_resource_name", agent_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-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 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_list_actions_request(
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}/listActions") # 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]$'),
+ "agentResourceName": _SERIALIZER.url("agent_resource_name", agent_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ "systemResourceName": _SERIALIZER.url("system_resource_name", system_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ }
+
+ _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="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_undo_action_request(
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}/undoAction") # 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]$'),
+ "agentResourceName": _SERIALIZER.url("agent_resource_name", agent_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ "systemResourceName": _SERIALIZER.url("system_resource_name", system_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ }
+
+ _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="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_report_action_status_request(
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/businessApplicationAgents/{agentResourceName}/systems/{systemResourceName}/reportActionStatus") # 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]$'),
+ "agentResourceName": _SERIALIZER.url("agent_resource_name", agent_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ "systemResourceName": _SERIALIZER.url("system_resource_name", system_resource_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9,-]*$'),
+ }
+
+ _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="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class SystemsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`systems` 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 create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ system_to_upsert: Optional[_models.SystemResource] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SystemResource:
+ """Creates or updates the system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param system_to_upsert: The system to upsert. Default value is None.
+ :type system_to_upsert: ~azure.mgmt.securityinsight.models.SystemResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SystemResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SystemResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ system_to_upsert: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SystemResource:
+ """Creates or updates the system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param system_to_upsert: The system to upsert. Default value is None.
+ :type system_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
+ :return: SystemResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SystemResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ system_to_upsert: Optional[Union[_models.SystemResource, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> _models.SystemResource:
+ """Creates or updates the system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param system_to_upsert: The system to upsert. Is either a SystemResource type or a IO[bytes]
+ type. Default value is None.
+ :type system_to_upsert: ~azure.mgmt.securityinsight.models.SystemResource or IO[bytes]
+ :return: SystemResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SystemResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.SystemResource] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(system_to_upsert, (IOBase, bytes)):
+ _content = system_to_upsert
+ else:
+ if system_to_upsert is not None:
+ _json = self._serialize.body(system_to_upsert, 'SystemResource')
+ else:
+ _json = None
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ 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(
+ 'SystemResource',
+ 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,
+ agent_resource_name: str,
+ system_resource_name: str,
+ **kwargs: Any
+ ) -> _models.SystemResource:
+ """Gets the system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :return: SystemResource or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.SystemResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.SystemResource] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ 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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'SystemResource',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes the system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ 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
+
+
+
+ @distributed_trace
+ def list(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ filter: Optional[str] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.SystemResource"]:
+ """ListAll the systems.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param filter: Filters the results, based on a Boolean condition. Optional. Default value is
+ None.
+ :type filter: 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
+ :return: An iterator like instance of either SystemResource or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.SystemResource]
+ :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.SystemsList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ agent_resource_name=agent_resource_name,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ 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(
+ "SystemsList",
+ 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
+ )
+
+
+ @distributed_trace
+ def list_actions(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ **kwargs: Any
+ ) -> Iterable["_models.Action"]:
+ """List of actions for a business application system.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :return: An iterator like instance of either Action or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Action]
+ :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.ListActionsResponse] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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_actions_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ subscription_id=self._config.subscription_id,
+ 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(
+ "ListActionsResponse",
+ 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
+ )
+
+
+ @overload
+ def undo_action( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[_models.UndoActionPayload] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Undo action, based on the actionId.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Undo action, based on the actionId. Default value is None.
+ :type payload: ~azure.mgmt.securityinsight.models.UndoActionPayload
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def undo_action( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Undo action, based on the actionId.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Undo action, based on the actionId. Default value is None.
+ :type payload: 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: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def undo_action( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[Union[_models.UndoActionPayload, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> None:
+ """Undo action, based on the actionId.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Undo action, based on the actionId. Is either a UndoActionPayload type or a
+ IO[bytes] type. Default value is None.
+ :type payload: ~azure.mgmt.securityinsight.models.UndoActionPayload or IO[bytes]
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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[None] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(payload, (IOBase, bytes)):
+ _content = payload
+ else:
+ if payload is not None:
+ _json = self._serialize.body(payload, 'UndoActionPayload')
+ else:
+ _json = None
+
+ _request = build_undo_action_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ 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 [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
+
+
+
+ @overload
+ def report_action_status( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[_models.ReportActionStatusPayload] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Report the status of the action.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Report a status of the action that was performed by the agent. Default value is
+ None.
+ :type payload: ~azure.mgmt.securityinsight.models.ReportActionStatusPayload
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def report_action_status( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Report the status of the action.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Report a status of the action that was performed by the agent. Default value is
+ None.
+ :type payload: 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: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def report_action_status( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ agent_resource_name: str,
+ system_resource_name: str,
+ payload: Optional[Union[_models.ReportActionStatusPayload, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> None:
+ """Report the status of the action.
+
+ :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 agent_resource_name: Business Application Agent Name. Required.
+ :type agent_resource_name: str
+ :param system_resource_name: The name of the system. Required.
+ :type system_resource_name: str
+ :param payload: Report a status of the action that was performed by the agent. Is either a
+ ReportActionStatusPayload type or a IO[bytes] type. Default value is None.
+ :type payload: ~azure.mgmt.securityinsight.models.ReportActionStatusPayload or IO[bytes]
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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[None] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(payload, (IOBase, bytes)):
+ _content = payload
+ else:
+ if payload is not None:
+ _json = self._serialize.body(payload, 'ReportActionStatusPayload')
+ else:
+ _json = None
+
+ _request = build_report_action_status_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ agent_resource_name=agent_resource_name,
+ system_resource_name=system_resource_name,
+ 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 [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/_threat_intelligence_indicator_metrics_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_indicator_metrics_operations.py
index 282e791e6ca8..18267fb5524c 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,32 +7,23 @@
# 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 typing import Any, Callable, Dict, Optional, Type, 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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -40,48 +31,42 @@
def build_list_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/threatIntelligence/main/metrics",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ 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.
@@ -100,9 +85,15 @@ 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ **kwargs: Any
) -> _models.ThreatIntelligenceMetricsList:
"""Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source).
@@ -111,41 +102,39 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.ThreatIntelligenceMetricsList] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -154,13 +143,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- list.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics"
- }
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..b4f147f094db 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,320 +34,289 @@
def build_create_indicator_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/threatIntelligence/main/createIndicator",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
+ _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_get_request(
- resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/threatIntelligence/main/indicators/{name}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "name": _SERIALIZER.url("name", name, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/threatIntelligence/main/indicators/{name}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "name": _SERIALIZER.url("name", name, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/threatIntelligence/main/indicators/{name}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "name": _SERIALIZER.url("name", name, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_query_indicators_request(
- resource_group_name: str, workspace_name: str, subscription_id: str, **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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/threatIntelligence/main/queryIndicators",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _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)
+ _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_append_tags_request(
- resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/threatIntelligence/main/indicators/{name}/appendTags",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "name": _SERIALIZER.url("name", name, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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_replace_tags_request(
- resource_group_name: str, workspace_name: str, name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/threatIntelligence/main/indicators/{name}/replaceTags",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "name": _SERIALIZER.url("name", name, "str"),
+ "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]$'),
+ "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")
+ _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)
-
+ _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 ThreatIntelligenceIndicatorOperations:
+class ThreatIntelligenceIndicatorOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -374,6 +335,9 @@ 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 create_indicator(
self,
@@ -398,7 +362,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 +372,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,22 +386,22 @@ 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:
"""
+
@distributed_trace
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,43 +412,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.ThreatIntelligenceInformation] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +449,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -510,24 +467,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ name: str,
+ **kwargs: Any
) -> _models.ThreatIntelligenceInformation:
"""View a threat intelligence indicator by name.
@@ -538,42 +496,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.ThreatIntelligenceInformation] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -582,16 +538,17 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}"
- }
@overload
def create(
@@ -620,7 +577,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 +588,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,23 +604,23 @@ 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:
"""
+
@distributed_trace
def create(
self,
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,43 +633,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.ThreatIntelligenceInformation] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +671,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -739,24 +689,25 @@ 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 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
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ name: str,
+ **kwargs: Any
) -> None:
"""Delete a threat intelligence indicator.
@@ -767,42 +718,40 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -812,11 +761,9 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}"
- }
@overload
def query_indicators(
@@ -842,7 +789,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 +801,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 +815,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:
@@ -881,12 +826,13 @@ def query_indicators(
:raises ~azure.core.exceptions.HttpResponseError:
"""
+
@distributed_trace
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 +843,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,31 +856,27 @@ 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
)
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.ThreatIntelligenceInformationList] = kwargs.pop("cls", None)
-
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ error_map.update(kwargs.pop('error_map', {}) or {})
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")
-
+ _json = self._serialize.body(threat_intelligence_filtering_criteria, 'ThreatIntelligenceFilteringCriteria')
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,43 +884,40 @@ 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
_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 = 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
+ _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("ThreatIntelligenceInformationList", pipeline_response)
+ deserialized = self._deserialize(
+ "ThreatIntelligenceInformationList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -991,11 +927,11 @@ def get_next(next_link=None):
return pipeline_response
- 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"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@overload
def append_tags( # pylint: disable=inconsistent-return-statements
@@ -1024,7 +960,6 @@ 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:
@@ -1036,7 +971,7 @@ def append_tags( # pylint: disable=inconsistent-return-statements
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,23 +987,23 @@ 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
def append_tags( # pylint: disable=inconsistent-return-statements
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.
@@ -1081,43 +1016,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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[None] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +1054,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -1144,11 +1073,9 @@ def append_tags( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- append_tags.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/appendTags"
- }
@overload
def replace_tags(
@@ -1177,7 +1104,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 +1115,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,23 +1131,23 @@ 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:
"""
+
@distributed_trace
def replace_tags(
self,
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,43 +1160,36 @@ 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.ThreatIntelligenceInformation] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +1198,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -1296,13 +1216,14 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- replace_tags.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/replaceTags"
- }
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..fccde2b6dceb 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,34 +7,25 @@
# 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
+from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -55,51 +46,42 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/threatIntelligence/main/indicators",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if filter is not None:
- _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ _params['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if orderby is not None:
- _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str")
+ _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')
if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ _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)
-
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
-class ThreatIntelligenceIndicatorsOperations:
+class ThreatIntelligenceIndicatorsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -118,6 +100,9 @@ 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,
@@ -148,7 +133,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 ThreatIntelligenceInformation or the result of
cls(response)
:rtype:
@@ -158,23 +142,19 @@ 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
)
- cls: ClsType[_models.ThreatIntelligenceInformationList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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,
@@ -183,43 +163,40 @@ 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
_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 = 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
+ _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("ThreatIntelligenceInformationList", pipeline_response)
+ deserialized = self._deserialize(
+ "ThreatIntelligenceInformationList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -229,8 +206,8 @@ 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"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_operations.py
new file mode 100644
index 000000000000..f2703110cef0
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_threat_intelligence_operations.py
@@ -0,0 +1,459 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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_count_request(
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ 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', "2024-04-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/threatIntelligence/{tiType}/count") # 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]$'),
+ "tiType": _SERIALIZER.url("ti_type", ti_type, '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="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_query_request(
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ 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', "2024-04-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/threatIntelligence/{tiType}/query") # 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]$'),
+ "tiType": _SERIALIZER.url("ti_type", ti_type, '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="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class ThreatIntelligenceOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`threat_intelligence` 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 count(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[_models.CountQuery] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.ThreatIntelligenceCount:
+ """Gets the count of all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Default value is None.
+ :type query: ~azure.mgmt.securityinsight.models.CountQuery
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: ThreatIntelligenceCount or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceCount
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def count(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.ThreatIntelligenceCount:
+ """Gets the count of all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Default value is None.
+ :type query: 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: ThreatIntelligenceCount or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceCount
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def count(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[Union[_models.CountQuery, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> _models.ThreatIntelligenceCount:
+ """Gets the count of all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Is either a CountQuery type
+ or a IO[bytes] type. Default value is None.
+ :type query: ~azure.mgmt.securityinsight.models.CountQuery or IO[bytes]
+ :return: ThreatIntelligenceCount or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.ThreatIntelligenceCount
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.ThreatIntelligenceCount] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(query, (IOBase, bytes)):
+ _content = query
+ else:
+ if query is not None:
+ _json = self._serialize.body(query, 'CountQuery')
+ else:
+ _json = None
+
+ _request = build_count_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ ti_type=ti_type,
+ 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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'ThreatIntelligenceCount',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ def query(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[_models.Query] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> Iterable["_models.TIObject"]:
+ """Gets all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Default value is None.
+ :type query: ~azure.mgmt.securityinsight.models.Query
+ :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 TIObject or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.TIObject]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def query(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> Iterable["_models.TIObject"]:
+ """Gets all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Default value is None.
+ :type query: 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 TIObject or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.TIObject]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def query(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ ti_type: Union[str, _models.TiType],
+ query: Optional[Union[_models.Query, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.TIObject"]:
+ """Gets all TI objects for 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 ti_type: TI type. "main" Required.
+ :type ti_type: str or ~azure.mgmt.securityinsight.models.TiType
+ :param query: The query to run on the TI objects in the workspace. Is either a Query type or a
+ IO[bytes] type. Default value is None.
+ :type query: ~azure.mgmt.securityinsight.models.Query or IO[bytes]
+ :return: An iterator like instance of either TIObject or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.TIObject]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _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.ThreatIntelligenceList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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(query, (IOBase, bytes)):
+ _content = query
+ else:
+ if query is not None:
+ _json = self._serialize.body(query, 'Query')
+ else:
+ _json = None
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_query_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ ti_type=ti_type,
+ 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)
+
+ 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(
+ "ThreatIntelligenceList",
+ 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/_triggered_analytics_rule_run_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_triggered_analytics_rule_run_operations.py
new file mode 100644
index 000000000000..78026b31b608
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_triggered_analytics_rule_run_operations.py
@@ -0,0 +1,162 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, TypeVar
+
+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 # 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,
+ workspace_name: str,
+ rule_run_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', "2024-04-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/triggeredAnalyticsRuleRuns/{ruleRunId}") # 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]$'),
+ "ruleRunId": _SERIALIZER.url("rule_run_id", rule_run_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="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class TriggeredAnalyticsRuleRunOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`triggered_analytics_rule_run` 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,
+ workspace_name: str,
+ rule_run_id: str,
+ **kwargs: Any
+ ) -> _models.TriggeredAnalyticsRuleRun:
+ """Gets the triggered analytics rule run.
+
+ :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 rule_run_id: the triggered rule id. Required.
+ :type rule_run_id: str
+ :return: TriggeredAnalyticsRuleRun or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.TriggeredAnalyticsRuleRun
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.TriggeredAnalyticsRuleRun] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ rule_run_id=rule_run_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]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'TriggeredAnalyticsRuleRun',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
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
index b35219b0a81e..305c48a98e5f 100644
--- 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
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,25 @@
# 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, List, Optional, TypeVar, Union, cast, overload
-
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+from typing import Any, Callable, Dict, IO, Optional, Type, 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.polling import LROPoller, NoPolling, PollingMethod
-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 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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -42,52 +32,47 @@
def build_recommendation_request(
- resource_group_name: str, workspace_name: str, recommendation_id: str, subscription_id: str, **kwargs: Any
+ 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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
+ _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"),
+ "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]$'),
+ "recommendationId": _SERIALIZER.url("recommendation_id", recommendation_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")
+ _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)
-
+ _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:
+class UpdateOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -106,87 +91,20 @@ 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")
- 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(
+ def recommendation(
self,
resource_group_name: str,
workspace_name: str,
recommendation_id: str,
- recommendation_patch: List[_models.RecommendationPatch],
+ recommendation_patch: _models.RecommendationPatch,
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> LROPoller[_models.Recommendation]:
+ ) -> _models.Recommendation:
"""Patch a recommendation.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -197,35 +115,26 @@ def begin_recommendation(
: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]
+ :type recommendation_patch: ~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]
+ :return: Recommendation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Recommendation
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
- def begin_recommendation(
+ def recommendation(
self,
resource_group_name: str,
workspace_name: str,
recommendation_id: str,
- recommendation_patch: IO,
+ recommendation_patch: IO[bytes],
*,
content_type: str = "application/json",
**kwargs: Any
- ) -> LROPoller[_models.Recommendation]:
+ ) -> _models.Recommendation:
"""Patch a recommendation.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -236,33 +145,25 @@ def begin_recommendation(
:param recommendation_id: Recommendation Id. Required.
:type recommendation_id: str
:param recommendation_patch: Recommendation Fields to Update. Required.
- :type recommendation_patch: IO
+ :type recommendation_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
- :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]
+ :return: Recommendation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Recommendation
:raises ~azure.core.exceptions.HttpResponseError:
"""
+
@distributed_trace
- def begin_recommendation(
+ def recommendation(
self,
resource_group_name: str,
workspace_name: str,
recommendation_id: str,
- recommendation_patch: Union[List[_models.RecommendationPatch], IO],
+ recommendation_patch: Union[_models.RecommendationPatch, IO[bytes]],
**kwargs: Any
- ) -> LROPoller[_models.Recommendation]:
+ ) -> _models.Recommendation:
"""Patch a recommendation.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -272,72 +173,70 @@ def begin_recommendation(
: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]
+ :param recommendation_patch: Recommendation Fields to Update. Is either a RecommendationPatch
+ type or a IO[bytes] type. Required.
+ :type recommendation_patch: ~azure.mgmt.securityinsight.models.RecommendationPatch or IO[bytes]
+ :return: Recommendation or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Recommendation
:raises ~azure.core.exceptions.HttpResponseError:
"""
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.Recommendation] = kwargs.pop(
+ 'cls', None
)
- 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())
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(recommendation_patch, (IOBase, bytes)):
+ _content = recommendation_patch
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}"
- }
+ _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,
+ 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]:
+ 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.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
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..bd9e2686d707 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,27 @@
# 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, Optional, Type, TypeVar, Union, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+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.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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -53,43 +45,35 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/watchlists/{watchlistAlias}/watchlistItems",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
+ "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]$'),
+ "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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_get_request(
@@ -103,42 +87,34 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
- "watchlistItemId": _SERIALIZER.url("watchlist_item_id", watchlist_item_id, "str"),
+ "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]$'),
+ "watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, 'str'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="GET",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_delete_request(
@@ -152,42 +128,34 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
- "watchlistItemId": _SERIALIZER.url("watchlist_item_id", watchlist_item_id, "str"),
+ "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]$'),
+ "watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, 'str'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_create_or_update_request(
@@ -201,48 +169,39 @@ 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")
- )
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
- "watchlistItemId": _SERIALIZER.url("watchlist_item_id", watchlist_item_id, "str"),
+ "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]$'),
+ "watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, 'str'),
+ "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")
+ _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)
-
+ _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 WatchlistItemsOperations:
+class WatchlistItemsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -261,6 +220,9 @@ 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,
@@ -284,7 +246,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 WatchlistItem or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.WatchlistItem]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -292,66 +253,59 @@ 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
)
- cls: ClsType[_models.WatchlistItemList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("WatchlistItemList", pipeline_response)
+ deserialized = self._deserialize(
+ "WatchlistItemList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -361,15 +315,20 @@ 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/watchlists/{watchlistAlias}/watchlistItems"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, watchlist_alias: str, watchlist_item_id: str, **kwargs: Any
+ 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.
@@ -382,43 +341,41 @@ def get(
:type watchlist_alias: str
:param watchlist_item_id: 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.WatchlistItem] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -427,20 +384,26 @@ 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 cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}"
- }
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, watchlist_alias: str, watchlist_item_id: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: str,
+ watchlist_item_id: str,
+ **kwargs: Any
) -> None:
"""Delete a watchlist item.
@@ -453,43 +416,41 @@ def delete( # pylint: disable=inconsistent-return-statements
:type watchlist_alias: str
:param watchlist_item_id: 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[None] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -499,11 +460,9 @@ def delete( # pylint: disable=inconsistent-return-statements
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
- return cls(pipeline_response, None, {})
+ return cls(pipeline_response, None, {}) # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}"
- }
@overload
def create_or_update(
@@ -533,7 +492,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: WatchlistItem or the result of cls(response)
:rtype: ~azure.mgmt.securityinsight.models.WatchlistItem
:raises ~azure.core.exceptions.HttpResponseError:
@@ -546,7 +504,7 @@ 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
@@ -563,16 +521,16 @@ def create_or_update(
:param watchlist_item_id: 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:
"""
+
@distributed_trace
def create_or_update(
self,
@@ -580,7 +538,7 @@ 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.
@@ -594,42 +552,36 @@ def create_or_update(
:type watchlist_alias: str
:param watchlist_item_id: 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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.WatchlistItem] = kwargs.pop(
+ 'cls', None
)
- 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")
+ _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 +591,16 @@ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -656,17 +609,14 @@ 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 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..31881dbd97d6 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,4 @@
-# pylint: disable=too-many-lines
+# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,35 +6,29 @@
# 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, Type, TypeVar, Union, cast, overload
import urllib.parse
-from azure.core.exceptions import (
- ClientAuthenticationError,
- HttpResponseError,
- ResourceExistsError,
- ResourceNotFoundError,
- ResourceNotModifiedError,
- map_error,
-)
+from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, 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
-T = TypeVar("T")
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
@@ -52,177 +46,156 @@ 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")
- )
- accept = _headers.pop("Accept", "application/json")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/watchlists",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
+ "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 = _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")
+ _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
if skip_token is not None:
- _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str")
+ _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)
+ _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, watchlist_alias: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/watchlists/{watchlistAlias}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _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, watchlist_alias: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/watchlists/{watchlistAlias}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
+ "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]$'),
+ "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")
+ _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)
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
def build_create_or_update_request(
- resource_group_name: str, workspace_name: str, watchlist_alias: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: 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")
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/watchlists/{watchlistAlias}",
- ) # pylint: disable=line-too-long
+ _url = kwargs.pop("template_url", "/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),
- "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]$",
- ),
- "watchlistAlias": _SERIALIZER.url("watchlist_alias", watchlist_alias, "str"),
+ "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]$'),
+ "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")
+ _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)
-
+ _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 WatchlistsOperations:
+class WatchlistsOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
@@ -241,9 +214,16 @@ 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, skip_token: Optional[str] = None, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
) -> Iterable["_models.Watchlist"]:
"""Gets all watchlists, without watchlist items.
@@ -257,7 +237,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,65 +244,58 @@ 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
)
- cls: ClsType[_models.WatchlistList] = kwargs.pop("cls", None)
- error_map = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
-
+ error_map.update(kwargs.pop('error_map', {}) or {})
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
_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 = 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
+ _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("WatchlistList", pipeline_response)
+ deserialized = self._deserialize(
+ "WatchlistList",
+ pipeline_response
+ )
list_of_elem = deserialized.value
if cls:
- list_of_elem = cls(list_of_elem) # type: ignore
+ 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -333,15 +305,19 @@ 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/watchlists"
- }
+ return ItemPaged(
+ get_next, extract_data
+ )
+
@distributed_trace
def get(
- self, resource_group_name: str, workspace_name: str, watchlist_alias: str, **kwargs: Any
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: str,
+ **kwargs: Any
) -> _models.Watchlist:
"""Gets a watchlist, without its watchlist items.
@@ -352,42 +328,40 @@ def get(
:type workspace_name: str
:param watchlist_alias: 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ api_version: str = kwargs.pop('api_version', _params.pop('api-version', self._config.api_version))
+ cls: ClsType[_models.Watchlist] = kwargs.pop(
+ 'cls', None
)
- 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)
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request,
+ stream=_stream,
+ **kwargs
)
response = pipeline_response.http_response
@@ -396,21 +370,92 @@ 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
+
+
+
+ def _delete_initial(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: str,
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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
- return deserialized
- get.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
@distributed_trace
- def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, watchlist_alias: str, **kwargs: Any
- ) -> None:
+ def begin_delete(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ watchlist_alias: str,
+ **kwargs: Any
+ ) -> LROPoller[None]:
"""Delete a watchlist.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -420,65 +465,143 @@ def delete( # pylint: disable=inconsistent-return-statements
:type workspace_name: str
:param watchlist_alias: 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 = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
+ _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,
+
+
+ **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[int, Type[HttpResponseError]] = {
+ 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError
}
- error_map.update(kwargs.pop("error_map", {}) or {})
+ 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)
+ 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
)
- cls: ClsType[None] = 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)
-
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- request, stream=False, **kwargs
+ _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 [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:
- response_headers["Azure-AsyncOperation"] = self._deserialize(
- "str", response.headers.get("Azure-AsyncOperation")
- )
+ 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
+
+ return deserialized # type: ignore
+
- delete.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
@overload
- def create_or_update(
+ def begin_create_or_update(
self,
resource_group_name: str,
workspace_name: str,
@@ -487,7 +610,7 @@ 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
@@ -507,23 +630,22 @@ 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: 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
@@ -539,25 +661,25 @@ def create_or_update(
:param watchlist_alias: 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
@@ -572,83 +694,70 @@ def create_or_update(
:type workspace_name: str
:param watchlist_alias: 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)
- )
- 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,
+ 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
)
- 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
+ polling: Union[bool, PollingMethod] = kwargs.pop('polling', True)
+ lro_delay = kwargs.pop(
+ 'polling_interval',
+ self._config.polling_interval
)
-
- 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")
+ 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
+ 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
+
+
+ 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[_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
+ )
- return deserialized # type: ignore
- create_or_update.metadata = {
- "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}"
- }
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_assignment_jobs_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_assignment_jobs_operations.py
new file mode 100644
index 000000000000..71c7183e80d9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_assignment_jobs_operations.py
@@ -0,0 +1,552 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Type, 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 # 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,
+ workspace_manager_assignment_name: str,
+ subscription_id: str,
+ *,
+ 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs") # 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]$'),
+ "workspaceManagerAssignmentName": _SERIALIZER.url("workspace_manager_assignment_name", workspace_manager_assignment_name, 'str', 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 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_create_request(
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs") # 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]$'),
+ "workspaceManagerAssignmentName": _SERIALIZER.url("workspace_manager_assignment_name", workspace_manager_assignment_name, 'str', 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')
+
+ # Construct headers
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="POST",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_get_request(
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ job_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs/{jobName}") # 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]$'),
+ "workspaceManagerAssignmentName": _SERIALIZER.url("workspace_manager_assignment_name", workspace_manager_assignment_name, 'str', pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'),
+ "jobName": _SERIALIZER.url("job_name", job_name, 'str', 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')
+
+ # 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,
+ workspace_manager_assignment_name: str,
+ job_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs/{jobName}") # 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]$'),
+ "workspaceManagerAssignmentName": _SERIALIZER.url("workspace_manager_assignment_name", workspace_manager_assignment_name, 'str', pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'),
+ "jobName": _SERIALIZER.url("job_name", job_name, 'str', 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')
+
+ # Construct headers
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class WorkspaceManagerAssignmentJobsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`workspace_manager_assignment_jobs` 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,
+ workspace_manager_assignment_name: str,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.Job"]:
+ """Get all jobs for the specified workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: 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
+ :return: An iterator like instance of either Job or the result of cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.Job]
+ :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.JobList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ subscription_id=self._config.subscription_id,
+ orderby=orderby,
+ top=top,
+ 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(
+ "JobList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace
+ def create(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ **kwargs: Any
+ ) -> _models.Job:
+ """Create a job for the specified workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :return: Job or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Job
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.Job] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_create_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ 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]:
+ 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)
+
+ deserialized = self._deserialize(
+ 'Job',
+ 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,
+ workspace_manager_assignment_name: str,
+ job_name: str,
+ **kwargs: Any
+ ) -> _models.Job:
+ """Gets a job.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :param job_name: The job name. Required.
+ :type job_name: str
+ :return: Job or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.Job
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.Job] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ job_name=job_name,
+ 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]:
+ 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)
+
+ deserialized = self._deserialize(
+ 'Job',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ job_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes the specified job from the specified workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :param job_name: The job name. Required.
+ :type job_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ job_name=job_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_assignments_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_assignments_operations.py
new file mode 100644
index 000000000000..00d5d8e469cf
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_assignments_operations.py
@@ -0,0 +1,619 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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,
+ *,
+ 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerAssignments") # 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 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,
+ workspace_manager_assignment_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerAssignments/{workspaceManagerAssignmentName}") # 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]$'),
+ "workspaceManagerAssignmentName": _SERIALIZER.url("workspace_manager_assignment_name", workspace_manager_assignment_name, 'str', 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')
+
+ # 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,
+ workspace_manager_assignment_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerAssignments/{workspaceManagerAssignmentName}") # 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]$'),
+ "workspaceManagerAssignmentName": _SERIALIZER.url("workspace_manager_assignment_name", workspace_manager_assignment_name, 'str', 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')
+
+ # 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,
+ workspace_manager_assignment_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerAssignments/{workspaceManagerAssignmentName}") # 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]$'),
+ "workspaceManagerAssignmentName": _SERIALIZER.url("workspace_manager_assignment_name", workspace_manager_assignment_name, 'str', 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')
+
+ # Construct headers
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class WorkspaceManagerAssignmentsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`workspace_manager_assignments` 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,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.WorkspaceManagerAssignment"]:
+ """Get all workspace manager assignments for the Sentinel workspace manager.
+
+ :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 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
+ :return: An iterator like instance of either WorkspaceManagerAssignment or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment]
+ :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.WorkspaceManagerAssignmentList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ orderby=orderby,
+ top=top,
+ 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(
+ "WorkspaceManagerAssignmentList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerAssignment:
+ """Gets a workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :return: WorkspaceManagerAssignment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerAssignment] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ 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]:
+ 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)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerAssignment',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ workspace_manager_assignment: _models.WorkspaceManagerAssignment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerAssignment:
+ """Creates or updates a workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :param workspace_manager_assignment: The workspace manager assignment. Required.
+ :type workspace_manager_assignment:
+ ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: WorkspaceManagerAssignment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ workspace_manager_assignment: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerAssignment:
+ """Creates or updates a workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :param workspace_manager_assignment: The workspace manager assignment. Required.
+ :type workspace_manager_assignment: 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: WorkspaceManagerAssignment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ workspace_manager_assignment: Union[_models.WorkspaceManagerAssignment, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerAssignment:
+ """Creates or updates a workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :param workspace_manager_assignment: The workspace manager assignment. Is either a
+ WorkspaceManagerAssignment type or a IO[bytes] type. Required.
+ :type workspace_manager_assignment:
+ ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment or IO[bytes]
+ :return: WorkspaceManagerAssignment or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerAssignment
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerAssignment] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(workspace_manager_assignment, (IOBase, bytes)):
+ _content = workspace_manager_assignment
+ else:
+ _json = self._serialize.body(workspace_manager_assignment, 'WorkspaceManagerAssignment')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerAssignment',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_assignment_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes a workspace manager assignment.
+
+ :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 workspace_manager_assignment_name: The name of the workspace manager assignment.
+ Required.
+ :type workspace_manager_assignment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_assignment_name=workspace_manager_assignment_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_configurations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_configurations_operations.py
new file mode 100644
index 000000000000..5bfc48f10ea5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_configurations_operations.py
@@ -0,0 +1,619 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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,
+ *,
+ 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerConfigurations") # 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 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,
+ workspace_manager_configuration_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerConfigurations/{workspaceManagerConfigurationName}") # 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]$'),
+ "workspaceManagerConfigurationName": _SERIALIZER.url("workspace_manager_configuration_name", workspace_manager_configuration_name, 'str', 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')
+
+ # 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,
+ workspace_manager_configuration_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerConfigurations/{workspaceManagerConfigurationName}") # 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]$'),
+ "workspaceManagerConfigurationName": _SERIALIZER.url("workspace_manager_configuration_name", workspace_manager_configuration_name, 'str', 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')
+
+ # Construct headers
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+
+def build_create_or_update_request(
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerConfigurations/{workspaceManagerConfigurationName}") # 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]$'),
+ "workspaceManagerConfigurationName": _SERIALIZER.url("workspace_manager_configuration_name", workspace_manager_configuration_name, 'str', 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')
+
+ # 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 WorkspaceManagerConfigurationsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`workspace_manager_configurations` 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,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.WorkspaceManagerConfiguration"]:
+ """Gets all workspace manager configurations for a Sentinel 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 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
+ :return: An iterator like instance of either WorkspaceManagerConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration]
+ :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.WorkspaceManagerConfigurationList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ orderby=orderby,
+ top=top,
+ 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(
+ "WorkspaceManagerConfigurationList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_name: str,
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerConfiguration:
+ """Gets a workspace manager configuration.
+
+ :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 workspace_manager_configuration_name: The name of the workspace manager configuration.
+ Required.
+ :type workspace_manager_configuration_name: str
+ :return: WorkspaceManagerConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerConfiguration] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_configuration_name=workspace_manager_configuration_name,
+ 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]:
+ 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)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerConfiguration',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes a workspace manager configuration.
+
+ :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 workspace_manager_configuration_name: The name of the workspace manager configuration.
+ Required.
+ :type workspace_manager_configuration_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_configuration_name=workspace_manager_configuration_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_name: str,
+ workspace_manager_configuration: _models.WorkspaceManagerConfiguration,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerConfiguration:
+ """Creates or updates a workspace manager configuration.
+
+ :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 workspace_manager_configuration_name: The name of the workspace manager configuration.
+ Required.
+ :type workspace_manager_configuration_name: str
+ :param workspace_manager_configuration: The workspace manager configuration. Required.
+ :type workspace_manager_configuration:
+ ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: WorkspaceManagerConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_name: str,
+ workspace_manager_configuration: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerConfiguration:
+ """Creates or updates a workspace manager configuration.
+
+ :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 workspace_manager_configuration_name: The name of the workspace manager configuration.
+ Required.
+ :type workspace_manager_configuration_name: str
+ :param workspace_manager_configuration: The workspace manager configuration. Required.
+ :type workspace_manager_configuration: 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: WorkspaceManagerConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_configuration_name: str,
+ workspace_manager_configuration: Union[_models.WorkspaceManagerConfiguration, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerConfiguration:
+ """Creates or updates a workspace manager configuration.
+
+ :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 workspace_manager_configuration_name: The name of the workspace manager configuration.
+ Required.
+ :type workspace_manager_configuration_name: str
+ :param workspace_manager_configuration: The workspace manager configuration. Is either a
+ WorkspaceManagerConfiguration type or a IO[bytes] type. Required.
+ :type workspace_manager_configuration:
+ ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration or IO[bytes]
+ :return: WorkspaceManagerConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerConfiguration] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(workspace_manager_configuration, (IOBase, bytes)):
+ _content = workspace_manager_configuration
+ else:
+ _json = self._serialize.body(workspace_manager_configuration, 'WorkspaceManagerConfiguration')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_configuration_name=workspace_manager_configuration_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerConfiguration',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_groups_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_groups_operations.py
new file mode 100644
index 000000000000..8e579666e3c9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_groups_operations.py
@@ -0,0 +1,612 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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,
+ *,
+ 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerGroups") # 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 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,
+ workspace_manager_group_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerGroups/{workspaceManagerGroupName}") # 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]$'),
+ "workspaceManagerGroupName": _SERIALIZER.url("workspace_manager_group_name", workspace_manager_group_name, 'str', 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')
+
+ # 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,
+ workspace_manager_group_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerGroups/{workspaceManagerGroupName}") # 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]$'),
+ "workspaceManagerGroupName": _SERIALIZER.url("workspace_manager_group_name", workspace_manager_group_name, 'str', 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')
+
+ # 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,
+ workspace_manager_group_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerGroups/{workspaceManagerGroupName}") # 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]$'),
+ "workspaceManagerGroupName": _SERIALIZER.url("workspace_manager_group_name", workspace_manager_group_name, 'str', 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')
+
+ # Construct headers
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class WorkspaceManagerGroupsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`workspace_manager_groups` 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,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.WorkspaceManagerGroup"]:
+ """Gets all workspace manager groups in the Sentinel workspace manager.
+
+ :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 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
+ :return: An iterator like instance of either WorkspaceManagerGroup or the result of
+ cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.WorkspaceManagerGroup]
+ :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.WorkspaceManagerGroupList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ orderby=orderby,
+ top=top,
+ 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(
+ "WorkspaceManagerGroupList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_group_name: str,
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerGroup:
+ """Gets a workspace manager group.
+
+ :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 workspace_manager_group_name: The name of the workspace manager group. Required.
+ :type workspace_manager_group_name: str
+ :return: WorkspaceManagerGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerGroup] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_group_name=workspace_manager_group_name,
+ 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]:
+ 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)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerGroup',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_group_name: str,
+ workspace_manager_group: _models.WorkspaceManagerGroup,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerGroup:
+ """Creates or updates a workspace manager group.
+
+ :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 workspace_manager_group_name: The name of the workspace manager group. Required.
+ :type workspace_manager_group_name: str
+ :param workspace_manager_group: The workspace manager group object. Required.
+ :type workspace_manager_group: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: WorkspaceManagerGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_group_name: str,
+ workspace_manager_group: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerGroup:
+ """Creates or updates a workspace manager group.
+
+ :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 workspace_manager_group_name: The name of the workspace manager group. Required.
+ :type workspace_manager_group_name: str
+ :param workspace_manager_group: The workspace manager group object. Required.
+ :type workspace_manager_group: 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: WorkspaceManagerGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_group_name: str,
+ workspace_manager_group: Union[_models.WorkspaceManagerGroup, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerGroup:
+ """Creates or updates a workspace manager group.
+
+ :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 workspace_manager_group_name: The name of the workspace manager group. Required.
+ :type workspace_manager_group_name: str
+ :param workspace_manager_group: The workspace manager group object. Is either a
+ WorkspaceManagerGroup type or a IO[bytes] type. Required.
+ :type workspace_manager_group: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup or
+ IO[bytes]
+ :return: WorkspaceManagerGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerGroup] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(workspace_manager_group, (IOBase, bytes)):
+ _content = workspace_manager_group
+ else:
+ _json = self._serialize.body(workspace_manager_group, 'WorkspaceManagerGroup')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_group_name=workspace_manager_group_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerGroup',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_group_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes a workspace manager group.
+
+ :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 workspace_manager_group_name: The name of the workspace manager group. Required.
+ :type workspace_manager_group_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_group_name=workspace_manager_group_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_members_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_members_operations.py
new file mode 100644
index 000000000000..c5a1e9813461
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/operations/_workspace_manager_members_operations.py
@@ -0,0 +1,612 @@
+# pylint: disable=too-many-lines,too-many-statements
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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, Iterable, Optional, Type, 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.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 # 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,
+ *,
+ 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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerMembers/") # 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 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,
+ workspace_manager_member_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerMembers/{workspaceManagerMemberName}") # 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]$'),
+ "workspaceManagerMemberName": _SERIALIZER.url("workspace_manager_member_name", workspace_manager_member_name, 'str', 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')
+
+ # 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,
+ workspace_manager_member_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerMembers/{workspaceManagerMemberName}") # 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]$'),
+ "workspaceManagerMemberName": _SERIALIZER.url("workspace_manager_member_name", workspace_manager_member_name, 'str', 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')
+
+ # 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,
+ workspace_manager_member_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: str = kwargs.pop('api_version', _params.pop('api-version', "2024-04-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/workspaceManagerMembers/{workspaceManagerMemberName}") # 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]$'),
+ "workspaceManagerMemberName": _SERIALIZER.url("workspace_manager_member_name", workspace_manager_member_name, 'str', 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')
+
+ # Construct headers
+ _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
+
+ return HttpRequest(
+ method="DELETE",
+ url=_url,
+ params=_params,
+ headers=_headers,
+ **kwargs
+ )
+
+class WorkspaceManagerMembersOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.securityinsight.SecurityInsights`'s
+ :attr:`workspace_manager_members` 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,
+ orderby: Optional[str] = None,
+ top: Optional[int] = None,
+ skip_token: Optional[str] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.WorkspaceManagerMember"]:
+ """Gets all workspace manager members that exist for the given Sentinel workspace manager.
+
+ :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 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
+ :return: An iterator like instance of either WorkspaceManagerMember or the result of
+ cls(response)
+ :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.securityinsight.models.WorkspaceManagerMember]
+ :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.WorkspaceManagerMembersList] = kwargs.pop(
+ 'cls', None
+ )
+
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ orderby=orderby,
+ top=top,
+ 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(
+ "WorkspaceManagerMembersList",
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+
+ return ItemPaged(
+ get_next, extract_data
+ )
+
+
+ @distributed_trace
+ def get(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_member_name: str,
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerMember:
+ """Gets a workspace manager member.
+
+ :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 workspace_manager_member_name: The name of the workspace manager member. Required.
+ :type workspace_manager_member_name: str
+ :return: WorkspaceManagerMember or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerMember] = kwargs.pop(
+ 'cls', None
+ )
+
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_member_name=workspace_manager_member_name,
+ 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]:
+ 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)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerMember',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_member_name: str,
+ workspace_manager_member: _models.WorkspaceManagerMember,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerMember:
+ """Creates or updates a workspace manager member.
+
+ :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 workspace_manager_member_name: The name of the workspace manager member. Required.
+ :type workspace_manager_member_name: str
+ :param workspace_manager_member: The workspace manager member object. Required.
+ :type workspace_manager_member: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: WorkspaceManagerMember or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_member_name: str,
+ workspace_manager_member: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerMember:
+ """Creates or updates a workspace manager member.
+
+ :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 workspace_manager_member_name: The name of the workspace manager member. Required.
+ :type workspace_manager_member_name: str
+ :param workspace_manager_member: The workspace manager member object. Required.
+ :type workspace_manager_member: 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: WorkspaceManagerMember or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_member_name: str,
+ workspace_manager_member: Union[_models.WorkspaceManagerMember, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.WorkspaceManagerMember:
+ """Creates or updates a workspace manager member.
+
+ :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 workspace_manager_member_name: The name of the workspace manager member. Required.
+ :type workspace_manager_member_name: str
+ :param workspace_manager_member: The workspace manager member object. Is either a
+ WorkspaceManagerMember type or a IO[bytes] type. Required.
+ :type workspace_manager_member: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember or
+ IO[bytes]
+ :return: WorkspaceManagerMember or the result of cls(response)
+ :rtype: ~azure.mgmt.securityinsight.models.WorkspaceManagerMember
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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.WorkspaceManagerMember] = kwargs.pop(
+ 'cls', None
+ )
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(workspace_manager_member, (IOBase, bytes)):
+ _content = workspace_manager_member
+ else:
+ _json = self._serialize.body(workspace_manager_member, 'WorkspaceManagerMember')
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ workspace_name=workspace_name,
+ workspace_manager_member_name=workspace_manager_member_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize(
+ 'WorkspaceManagerMember',
+ pipeline_response.http_response
+ )
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+
+ @distributed_trace
+ def delete( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ workspace_name: str,
+ workspace_manager_member_name: str,
+ **kwargs: Any
+ ) -> None:
+ """Deletes a workspace manager member.
+
+ :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 workspace_manager_member_name: The name of the workspace manager member. Required.
+ :type workspace_manager_member_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ 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,
+ workspace_manager_member_name=workspace_manager_member_name,
+ 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)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # 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 65%
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..b0ca5f4018ee 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,21 +28,14 @@ def main():
)
response = client.actions.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- action_id="912bec42-cb66-4c03-ac63-1761b6898c3e",
- action={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "properties": {
- "logicAppResourceId": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.Logic/workflows/MyAlerts",
- "triggerUri": "https://prod-31.northcentralus.logic.azure.com:443/workflows/cd3765391efd48549fd7681ded1d48d7/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=signature",
- },
- },
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ rule_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ action_id='912bec42-cb66-4c03-ac63-1761b6898c3e',
+ action={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'properties': {'logicAppResourceId': '/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.Logic/workflows/MyAlerts', 'triggerUri': 'https://prod-31.northcentralus.logic.azure.com:443/workflows/cd3765391efd48549fd7681ded1d48d7/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=signature'}},
)
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/preview/2024-04-01-preview/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 81%
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..652f3a4d2ec1 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,23 +21,19 @@
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.actions.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- action_id="912bec42-cb66-4c03-ac63-1761b6898c3e",
+ 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/preview/2024-04-01-preview/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 85%
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..7c841f439766 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.actions.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- action_id="912bec42-cb66-4c03-ac63-1761b6898c3e",
+ 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/GetActionOfAlertRuleById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 88%
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..e53ef47796a6 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.actions.list_by_alert_rule(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ rule_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
)
for item in response:
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/preview/2024-04-01-preview/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 87%
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..f5dbd1bb977e 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.alert_rule_templates.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- alert_rule_template_id="65360bb0-8986-4ade-a89d-af3cf44d28aa",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ alert_rule_template_id='65360bb0-8986-4ade-a89d-af3cf44d28aa',
)
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/preview/2024-04-01-preview/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 91%
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..18a8fece1a7b 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.alert_rule_templates.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/alertRuleTemplates/GetAlertRuleTemplates.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplates.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_fusion_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_fusion_alert_rule.py
new file mode 100644
index 000000000000..d1ad227e69c0
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_fusion_alert_rule.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.
+# --------------------------------------------------------------------------
+
+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/2024-04-01-preview/examples/alertRules/CreateFusionAlertRule.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_fusion_alert_rule_with_fusion_scenario_exclusion.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_fusion_alert_rule_with_fusion_scenario_exclusion.py
new file mode 100644
index 000000000000..28729f274333
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_fusion_alert_rule_with_fusion_scenario_exclusion.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.
+# --------------------------------------------------------------------------
+
+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/2024-04-01-preview/examples/alertRules/CreateFusionAlertRuleWithFusionScenarioExclusion.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 73%
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..4884ce448c12 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,22 +28,13 @@ def main():
)
response = client.alert_rules.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="microsoftSecurityIncidentCreationRuleExample",
- alert_rule={
- "etag": '"260097e0-0000-0d00-0000-5d6fa88f0000"',
- "kind": "MicrosoftSecurityIncidentCreation",
- "properties": {
- "displayName": "testing displayname",
- "enabled": True,
- "productFilter": "Microsoft Cloud App Security",
- },
- },
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ rule_id='microsoftSecurityIncidentCreationRuleExample',
+ alert_rule={'etag': '"260097e0-0000-0d00-0000-5d6fa88f0000"', 'kind': 'MicrosoftSecurityIncidentCreation', 'properties': {'displayName': 'testing displayname', 'enabled': True, 'productFilter': 'Microsoft Cloud App Security'}},
)
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/preview/2024-04-01-preview/examples/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_nrt_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_nrt_alert_rule.py
new file mode 100644
index 000000000000..e4dee79c8340
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_nrt_alert_rule.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.
+# --------------------------------------------------------------------------
+
+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/2024-04-01-preview/examples/alertRules/CreateNrtAlertRule.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_scheduled_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_scheduled_alert_rule.py
new file mode 100644
index 000000000000..99d4584c3278
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/create_scheduled_alert_rule.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_scheduled_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': 'Scheduled', 'properties': {'alertDetailsOverride': {'alertDescriptionFormat': 'Suspicious activity was made by {{ComputerIP}}', 'alertDisplayNameFormat': 'Alert from {{Computer}}', 'alertDynamicProperties': [{'alertProperty': 'ProductComponentName', 'value': 'ProductComponentNameCustomColumn'}, {'alertProperty': 'ProductName', 'value': 'ProductNameCustomColumn'}, {'alertProperty': 'AlertLink', 'value': 'Link'}]}, 'customDetails': {'OperatingSystemName': 'OSName', 'OperatingSystemType': 'OSType'}, 'description': 'An example for a scheduled rule', 'displayName': 'My scheduled rule', 'enabled': True, 'entityMappings': [{'entityType': 'Host', 'fieldMappings': [{'columnName': 'Computer', 'identifier': 'FullName'}]}, {'entityType': 'IP', 'fieldMappings': [{'columnName': 'ComputerIP', 'identifier': 'Address'}]}], 'eventGroupingSettings': {'aggregationKind': 'AlertPerResult'}, 'incidentConfiguration': {'createIncident': True, 'groupingConfiguration': {'enabled': True, 'groupByAlertDetails': ['DisplayName'], 'groupByCustomDetails': ['OperatingSystemType', 'OperatingSystemName'], 'groupByEntities': ['Host'], 'lookbackDuration': 'PT5H', 'matchingMethod': 'Selected', 'reopenClosedIncident': False}}, '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}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 84%
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..3146276e2f04 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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/preview/2024-04-01-preview/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 91%
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..f4166ecda46e 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.alert_rules.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/alertRules/GetAllAlertRules.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 89%
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..20929227cfb7 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.alert_rules.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="myFirstFusionRule",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ rule_id='myFirstFusionRule',
)
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/preview/2024-04-01-preview/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 87%
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..0d072e30445d 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.alert_rules.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="microsoftSecurityIncidentCreationRuleExample",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ rule_id='microsoftSecurityIncidentCreationRuleExample',
)
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/preview/2024-04-01-preview/examples/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.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/alert_rules/get_nrt_alert_rule.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_nrt_alert_rule.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_nrt_alert_rule.py
index e3ffcd9605df..ddb409110995 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_nrt_alert_rule.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/alert_rules/get_nrt_alert_rule.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.alert_rules.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/alertRules/GetNrtAlertRule.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 88%
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..72fef50f36cb 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.alert_rules.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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/GetScheduledAlertRule.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 87%
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..21422f6451af 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.automation_rules.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- automation_rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ automation_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/automationRules/AutomationRules_CreateOrUpdate.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 87%
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..11130327ffca 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.automation_rules.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- automation_rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ automation_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/automationRules/AutomationRules_Delete.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 87%
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..b578325dc9c3 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.automation_rules.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- automation_rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ automation_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/automationRules/AutomationRules_Get.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 91%
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..69046f677a21 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.automation_rules.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/automationRules/AutomationRules_List.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/automationRules/AutomationRules_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/billing_statistics/get_all_billing_statistics.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/billing_statistics/get_all_billing_statistics.py
new file mode 100644
index 000000000000..31c7e58de3b5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/billing_statistics/get_all_billing_statistics.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.
+# --------------------------------------------------------------------------
+
+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_billing_statistics.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.billing_statistics.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/2024-04-01-preview/examples/billingStatistics/GetAllBillingStatistics.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/billing_statistics/get_billing_statistic.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/billing_statistics/get_billing_statistic.py
new file mode 100644
index 000000000000..81293be17308
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/billing_statistics/get_billing_statistic.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_billing_statistic.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.billing_statistics.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ billing_statistic_name='sapSolutionUsage',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/billingStatistics/GetBillingStatistic.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/bookmarks/create_bookmark.py
similarity index 56%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/connect_api_polling_v2_logs.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/create_bookmark.py
index f63f252194af..5bcb69f93c8c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/connect_api_polling_v2_logs.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/create_bookmark.py
@@ -7,51 +7,34 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python connect_api_polling_v2_logs.py
+ python create_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.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",
- }
- ],
- },
+ response = client.bookmarks.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ bookmark_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ bookmark={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'properties': {'created': '2021-09-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', 'updatedBy': {'objectId': '2046feea-040d-4a46-9e2b-91c2941bfa70'}}},
)
print(response)
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/dataConnectors/ConnectAPIPollingV2Logs.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 84%
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..d3fc00cff80a 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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.bookmarks.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- bookmark_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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/preview/2024-04-01-preview/examples/bookmarks/DeleteBookmark.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/bookmarks/expand/post_expand_bookmark.py
similarity index 78%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_expand_bookmark.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/expand/post_expand_bookmark.py
index 49329bae179a..d93a55f4a8c0 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_expand_bookmark.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/expand/post_expand_bookmark.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,18 +28,13 @@ def main():
)
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",
- },
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/expand/PostExpandBookmark.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 87%
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..992ee37f5ee8 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.bookmarks.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- bookmark_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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/GetBookmarkById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 91%
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..875301fc711a 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.bookmarks.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/bookmarks/GetBookmarks.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/GetBookmarks.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/bookmarks/relations/create_bookmark_relation.py
similarity index 71%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_bookmark_relation.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/relations/create_bookmark_relation.py
index fa4c8433745e..729248b2c980 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_bookmark_relation.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/relations/create_bookmark_relation.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,19 +28,14 @@ def main():
)
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"
- }
- },
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/CreateBookmarkRelation.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/bookmarks/relations/delete_bookmark_relation.py
similarity index 80%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_bookmark_relation.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/relations/delete_bookmark_relation.py
index 940f286c435e..e9c776158ca6 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_bookmark_relation.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/relations/delete_bookmark_relation.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,23 +21,19 @@
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.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- bookmark_id="2216d0e1-91e3-4902-89fd-d2df8c535096",
- relation_name="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
+ client.bookmark_relations.delete(
+ 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/DeleteBookmarkRelation.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/DeleteBookmarkRelation.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/bookmarks/relations/get_all_bookmark_relations.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_bookmark_relations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/relations/get_all_bookmark_relations.py
index dd257f859112..30413c4b4ffd 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_bookmark_relations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/relations/get_all_bookmark_relations.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.bookmark_relations.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- bookmark_id="2216d0e1-91e3-4902-89fd-d2df8c535096",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/GetAllBookmarkRelations.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/bookmarks/relations/get_bookmark_relation_by_name.py
similarity index 84%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmark_relation_by_name.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/relations/get_bookmark_relation_by_name.py
index 7426af196f31..d756e98dd508 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_bookmark_relation_by_name.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/bookmarks/relations/get_bookmark_relation_by_name.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
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",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/bookmarks/relations/GetBookmarkRelationByName.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/actions/list_actions.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/actions/list_actions.py
new file mode 100644
index 000000000000..5a47b2ae0745
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/actions/list_actions.py
@@ -0,0 +1,41 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python list_actions.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.systems.list_actions(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ agent_resource_name='247b377a-7137-4b3c-bf15-df1d3260ef1b',
+ system_resource_name='3d69632b-0b60-4af3-8720-77f01a25d34a',
+ )
+ for item in response:
+ print(item)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/actions/ListActions.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/actions/report_action_status.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/actions/report_action_status.py
new file mode 100644
index 000000000000..e878bc9d96a8
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/actions/report_action_status.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python report_action_status.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",
+ )
+
+ client.systems.report_action_status(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ agent_resource_name='247b377a-7137-4b3c-bf15-df1d3260ef1b',
+ system_resource_name='3d69632b-0b60-4af3-8720-77f01a25d34a',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/actions/ReportActionStatus.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/actions/undo_action.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/actions/undo_action.py
new file mode 100644
index 000000000000..8564c4089d6d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/actions/undo_action.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python undo_action.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",
+ )
+
+ client.systems.undo_action(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ agent_resource_name='247b377a-7137-4b3c-bf15-df1d3260ef1b',
+ system_resource_name='3d69632b-0b60-4af3-8720-77f01a25d34a',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/actions/UndoAction.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agent_get.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agent_get.py
new file mode 100644
index 000000000000..6dbe168adf9a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agent_get.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python business_application_agent_get.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.business_application_agent.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ agent_resource_name='3d69632b-0b60-4af3-8720-77f01a25d34a',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgent_Get.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agents_create_or_update.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agents_create_or_update.py
new file mode 100644
index 000000000000..401c5e68c35f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agents_create_or_update.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python business_application_agents_create_or_update.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.business_application_agents.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ agent_resource_name='3d69632b-0b60-4af3-8720-77f01a25d34a',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgents_CreateOrUpdate.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agents_delete.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agents_delete.py
new file mode 100644
index 000000000000..2dd21bd7b57a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agents_delete.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 business_application_agents_delete.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",
+ )
+
+ client.business_application_agents.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ agent_resource_name='3d69632b-0b60-4af3-8720-77f01a25d34a',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgents_Delete.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agents_list.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agents_list.py
new file mode 100644
index 000000000000..0d172492e4e2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/business_application_agents_list.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python business_application_agents_list.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.business_application_agents.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/2024-04-01-preview/examples/businessApplicationAgents/BusinessApplicationAgents_List.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_create_or_update.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_create_or_update.py
new file mode 100644
index 000000000000..880466adb8d8
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_create_or_update.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python systems_create_or_update.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.systems.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ agent_resource_name='3123432b-0b60-4af3-8720-77f01a25d34a',
+ system_resource_name='3d69632b-0b60-4af3-8720-77f01a25d34a',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_CreateOrUpdate.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_delete.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_delete.py
new file mode 100644
index 000000000000..3e9358df3db0
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_delete.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python systems_delete.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",
+ )
+
+ client.systems.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ agent_resource_name='3123432b-0b60-4af3-8720-77f01a25d34a',
+ system_resource_name='3d69632b-0b60-4af3-8720-77f01a25d34a',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_Delete.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_get.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_get.py
new file mode 100644
index 000000000000..965f074afd4d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_get.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python systems_get.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.systems.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ agent_resource_name='3123432b-0b60-4af3-8720-77f01a25d34a',
+ system_resource_name='3d69632b-0b60-4af3-8720-77f01a25d34a',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_Get.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_list.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_list.py
new file mode 100644
index 000000000000..a882ebaea143
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/business_application_agents/systems/systems_list.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python systems_list.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.systems.list(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ agent_resource_name='3123432b-0b60-4af3-8720-77f01a25d34a',
+ )
+ for item in response:
+ print(item)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/businessApplicationAgents/systems/Systems_List.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_package_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_package_by_id.py
new file mode 100644
index 000000000000..f7dca0c2a61c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_package_by_id.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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_packages.get(
+ 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/2024-04-01-preview/examples/contentPackages/GetPackageById.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_packages.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_packages.py
new file mode 100644
index 000000000000..12e3c170d3bf
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_packages.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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_packages.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/2024-04-01-preview/examples/contentPackages/GetPackages.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_package_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_package_by_id.py
new file mode 100644
index 000000000000..241760a0d958
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_package_by_id.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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.product_package.get(
+ 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/2024-04-01-preview/examples/contentPackages/GetProductPackageById.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_packages.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_packages.py
new file mode 100644
index 000000000000..aa0385087b3a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/get_product_packages.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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.product_packages.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/2024-04-01-preview/examples/contentPackages/GetProductPackages.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/install_package.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/install_package.py
new file mode 100644
index 000000000000..2a4f03712b05
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/install_package.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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_package.install(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ package_id='str.azure-sentinel-solution-str',
+ package_installation_properties={'properties': {'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/2024-04-01-preview/examples/contentPackages/InstallPackage.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/uninstall_package.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/uninstall_package.py
new file mode 100644
index 000000000000..10ac83282d3a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_packages/uninstall_package.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 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,
+ 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_package.uninstall(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ package_id='str.azure-sentinel-solution-str',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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..9aa81069add3
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/delete_template.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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/preview/2024-04-01-preview/examples/contentTemplates/DeleteTemplate.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_template_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_template_by_id.py
new file mode 100644
index 000000000000..eaf900281045
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_template_by_id.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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.product_template.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ template_id='8365ebfe-a381-45b7-ad08-7d818070e11f',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/contentTemplates/GetProductTemplateById.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_templates.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_templates.py
new file mode 100644
index 000000000000..138de0e63ad4
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_product_templates.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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.product_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/2024-04-01-preview/examples/contentTemplates/GetProductTemplates.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_template_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_template_by_id.py
new file mode 100644
index 000000000000..2d3dad77f11a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_template_by_id.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ template_id='8365ebfe-a381-45b7-ad08-7d818070e11f',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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..e1d52122e658
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/get_templates.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.
+# --------------------------------------------------------------------------
+
+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/preview/2024-04-01-preview/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..4e40149b2d6b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/content_templates/install_template.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.
+# --------------------------------------------------------------------------
+
+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/preview/2024-04-01-preview/examples/contentTemplates/InstallTemplate.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/create_api_polling.py
deleted file mode 100644
index ceceb21be0af..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_api_polling.py
+++ /dev/null
@@ -1,126 +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_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.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
- data_connector={
- "kind": "APIPolling",
- "properties": {
- "connectorUiConfig": {
- "availability": {"isPreview": True, "status": 1},
- "connectivityCriteria": [{"type": "SentinelKindsV2", "value": []}],
- "dataTypes": [
- {
- "lastDataReceivedQuery": "{{graphQueriesTableName}}\n | summarize Time = max(TimeGenerated)\n | where isnotempty(Time)",
- "name": "{{graphQueriesTableName}}",
- }
- ],
- "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}}",
- "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",
- }
- ],
- },
- "type": "APIKey",
- }
- ],
- "title": "Connect GitHub Enterprise Audit Log to Azure Sentinel",
- }
- ],
- "permissions": {
- "customs": [
- {
- "description": "You need access to GitHub personal token, the key should have 'admin:org' scope",
- "name": "GitHub API personal token Key",
- }
- ],
- "resourceProvider": [
- {
- "permissionsDisplayText": "read and write permissions are required.",
- "provider": "Microsoft.OperationalInsights/workspaces",
- "providerDisplayName": "Workspace",
- "requiredPermissions": {"delete": True, "read": True, "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
-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/create_bookmark.py
deleted file mode 100644
index 44e578eca8d0..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_bookmark.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_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.bookmarks.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- bookmark_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- bookmark={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "properties": {
- "created": "2021-09-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",
- "updatedBy": {"objectId": "2046feea-040d-4a46-9e2b-91c2941bfa70"},
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/bookmarks/CreateBookmark.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_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_scheduled_alert_rule.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_scheduled_alert_rule.py
deleted file mode 100644
index 41f7815cc6e8..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_scheduled_alert_rule.py
+++ /dev/null
@@ -1,89 +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_scheduled_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": "Scheduled",
- "properties": {
- "alertDetailsOverride": {
- "alertDescriptionFormat": "Suspicious activity was made by {{ComputerIP}}",
- "alertDisplayNameFormat": "Alert from {{Computer}}",
- "alertDynamicProperties": [
- {"alertProperty": "ProductComponentName", "value": "ProductComponentNameCustomColumn"},
- {"alertProperty": "ProductName", "value": "ProductNameCustomColumn"},
- {"alertProperty": "AlertLink", "value": "Link"},
- ],
- },
- "customDetails": {"OperatingSystemName": "OSName", "OperatingSystemType": "OSType"},
- "description": "An example for a scheduled rule",
- "displayName": "My scheduled rule",
- "enabled": True,
- "entityMappings": [
- {"entityType": "Host", "fieldMappings": [{"columnName": "Computer", "identifier": "FullName"}]},
- {"entityType": "IP", "fieldMappings": [{"columnName": "ComputerIP", "identifier": "Address"}]},
- ],
- "eventGroupingSettings": {"aggregationKind": "AlertPerResult"},
- "incidentConfiguration": {
- "createIncident": True,
- "groupingConfiguration": {
- "enabled": True,
- "groupByAlertDetails": ["DisplayName"],
- "groupByCustomDetails": ["OperatingSystemType", "OperatingSystemName"],
- "groupByEntities": ["Host"],
- "lookbackDuration": "PT5H",
- "matchingMethod": "Selected",
- "reopenClosedIncident": False,
- },
- },
- "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,
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/alertRules/CreateScheduledAlertRule.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/create_source_control.py
deleted file mode 100644
index e4ba898e9ea7..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_source_control.py
+++ /dev/null
@@ -1,60 +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_source_control.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.source_controls.create(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- source_control_id="789e0c1f-4a3d-43ad-809c-e713b677b04a",
- source_control={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "properties": {
- "contentTypes": ["AnalyticRules", "Workbook"],
- "description": "This is a source control",
- "displayName": "My Source Control",
- "repoType": "Github",
- "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",
- },
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/sourcecontrols/CreateSourceControl.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_watchlist_and_watchlist_items.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist_and_watchlist_items.py
deleted file mode 100644
index 96205b46222e..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_watchlist_and_watchlist_items.py
+++ /dev/null
@@ -1,56 +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_watchlist_and_watchlist_items.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.watchlists.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- watchlist_alias="highValueAsset",
- watchlist={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "properties": {
- "contentType": "text/csv",
- "description": "Watchlist from CSV content",
- "displayName": "High Value Assets Watchlist",
- "itemsSearchKey": "header1",
- "numberOfLinesToSkip": 1,
- "provider": "Microsoft",
- "rawContent": "This line will be skipped\nheader1,header2\nvalue1,value2",
- "source": "watchlist.csv",
- "sourceType": "Local file",
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/watchlists/CreateWatchlistAndWatchlistItems.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/create_customizable_data_connector_definition.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/create_customizable_data_connector_definition.py
new file mode 100644
index 000000000000..23b963994619
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/create_customizable_data_connector_definition.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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_connector_definitions.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_definition_name='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ connector_definition_input={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'kind': 'Customizable', 'properties': {'connectorUiConfig': {'availability': {'isPreview': False, 'status': 1}, 'connectivityCriteria': [{'type': 'IsConnectedQuery', 'value': ['GitHubAuditLogPolling_CL \n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(30d)']}], 'dataTypes': [{'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': 'GitHubAuditLogPolling_CL', 'legend': 'GitHub audit log events', 'metricName': 'Total events received'}], 'instructionSteps': [{'description': 'Enable GitHub audit Logs. \n Follow `this `_ to create or find your personal key', 'instructions': [{'parameters': {'clientIdLabel': 'Client ID', 'clientSecretLabel': 'Client Secret', 'connectButtonLabel': 'Connect', 'disconnectButtonLabel': 'Disconnect'}, 'type': 'OAuthForm'}], 'title': 'Connect GitHub Enterprise Audit Log to Azure Sentinel'}], 'permissions': {'customs': [{'description': "You need access to GitHub personal token, the key should have 'admin:org' scope", 'name': 'GitHub API personal token Key'}], 'resourceProvider': [{'permissionsDisplayText': 'read and write permissions are required.', 'provider': 'Microsoft.OperationalInsights/workspaces', 'providerDisplayName': 'Workspace', 'requiredPermissions': {'action': False, 'delete': False, 'read': False, 'write': True}, 'scope': 'Workspace'}]}, 'publisher': 'GitHub', 'title': 'GitHub Enterprise Audit Log'}}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectorDefinitions/CreateCustomizableDataConnectorDefinition.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/delete_data_connector_definition_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/delete_data_connector_definition_by_id.py
new file mode 100644
index 000000000000..eefa4459a54b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/delete_data_connector_definition_by_id.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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,
+ 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",
+ )
+
+ client.data_connector_definitions.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_definition_name='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectorDefinitions/DeleteDataConnectorDefinitionById.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_customizable_data_connectoe_definition_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_customizable_data_connectoe_definition_by_id.py
new file mode 100644
index 000000000000..f55cc4002823
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_customizable_data_connectoe_definition_by_id.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_customizable_data_connectoe_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,
+ 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_connector_definitions.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_definition_name='763f9fa1-c2d3-4fa2-93e9-bccd4899aa12',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectorDefinitions/GetCustomizableDataConnectoeDefinitionById.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_data_connector_definitions.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_data_connector_definitions.py
new file mode 100644
index 000000000000..69f0c9d8dfce
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connector_definitions/get_data_connector_definitions.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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_connector_definitions.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/2024-04-01-preview/examples/dataConnectorDefinitions/GetDataConnectorDefinitions.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/data_connectors/connect_api_polling.py
similarity index 66%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/connect_api_polling.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/connect_api_polling.py
index 2a05669c46df..938307c62917 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/connect_api_polling.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/connect_api_polling.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,34 +21,19 @@
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",
- }
- ],
- },
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/ConnectAPIPolling.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/connect_api_polling_v2_logs.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/connect_api_polling_v2_logs.py
new file mode 100644
index 000000000000..a527d0d6e5b3
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/connect_api_polling_v2_logs.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.
+# --------------------------------------------------------------------------
+
+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",
+ )
+
+ 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'}]},
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/ConnectAPIPollingV2Logs.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_api_polling.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_api_polling.py
new file mode 100644
index 000000000000..015d437b8e19
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_api_polling.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_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.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='316ec55e-7138-4d63-ab18-90c8a60fd1c8',
+ data_connector={'kind': 'APIPolling', 'properties': {'connectorUiConfig': {'availability': {'isPreview': True, 'status': 1}, 'connectivityCriteria': [{'type': 'SentinelKindsV2', 'value': []}], 'dataTypes': [{'lastDataReceivedQuery': '{{graphQueriesTableName}}\n | summarize Time = max(TimeGenerated)\n | where isnotempty(Time)', 'name': '{{graphQueriesTableName}}'}], '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}}', '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'}]}, 'type': 'APIKey'}], 'title': 'Connect GitHub Enterprise Audit Log to Azure Sentinel'}], 'permissions': {'customs': [{'description': "You need access to GitHub personal token, the key should have 'admin:org' scope", 'name': 'GitHub API personal token Key'}], 'resourceProvider': [{'permissionsDisplayText': 'read and write permissions are required.', 'provider': 'Microsoft.OperationalInsights/workspaces', 'providerDisplayName': 'Workspace', 'requiredPermissions': {'delete': True, 'read': True, '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/2024-04-01-preview/examples/dataConnectors/CreateAPIPolling.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_dynamics365_data_connetor.py
similarity index 73%
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_dynamics365_data_connetor.py
index 14c0e141de06..ebcb5ed8accb 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_dynamics365_data_connetor.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,21 +28,13 @@ 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={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "kind": "Dynamics365",
- "properties": {
- "dataTypes": {"dynamics365CdsActivities": {"state": "Enabled"}},
- "tenantId": "2070ecc9-b4d5-4ae4-adaa-936fa1954fa8",
- },
- },
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='c2541efb-c9a6-47fe-9501-87d1017d1512',
+ data_connector={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'kind': 'Dynamics365', 'properties': {'dataTypes': {'dynamics365CdsActivities': {'state': 'Enabled'}}, 'tenantId': '2070ecc9-b4d5-4ae4-adaa-936fa1954fa8'}},
)
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/preview/2024-04-01-preview/examples/dataConnectors/CreateDynamics365DataConnetor.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_generic_ui.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_generic_ui.py
new file mode 100644
index 000000000000..4f5e3408f09f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_generic_ui.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.
+# --------------------------------------------------------------------------
+
+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/2024-04-01-preview/examples/dataConnectors/CreateGenericUI.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_google_cloud_platform.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_google_cloud_platform.py
new file mode 100644
index 000000000000..56233d2e7671
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_google_cloud_platform.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_google_cloud_platform.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='GCP_fce27b90-d6f5-4d30-991a-af509a2b50a1',
+ data_connector={'kind': 'GCP', 'properties': {'auth': {'projectNumber': '123456789012', 'serviceAccountEmail': 'sentinel-service-account@project-id.iam.gserviceaccount.com', 'type': 'GCP', 'workloadIdentityProviderId': 'sentinel-identity-provider'}, 'connectorDefinitionName': 'GcpConnector', 'dcrConfig': {'dataCollectionEndpoint': 'https://microsoft-sentinel-datacollectionendpoint-123m.westeurope-1.ingest.monitor.azure.com', 'dataCollectionRuleImmutableId': 'dcr-de21b053bd5a44beb99a256c9db85023', 'streamName': 'SENTINEL_GCP_AUDIT_LOGS'}, 'request': {'projectId': 'project-id', 'subscriptionNames': ['sentinel-subscription']}}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateGoogleCloudPlatform.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_purview_information_protection_data_connetor.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_purview_information_protection_data_connetor.py
new file mode 100644
index 000000000000..bcead6018b98
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_purview_information_protection_data_connetor.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_microsoft_purview_information_protection_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.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ data_connector={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'kind': 'MicrosoftPurviewInformationProtection', 'properties': {'dataTypes': {'logs': {'state': 'Enabled'}}, 'tenantId': '2070ecc9-b4d5-4ae4-adaa-936fa1954fa8'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateMicrosoftPurviewInformationProtectionDataConnetor.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_threat_intelligence_data_connector.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_threat_intelligence_data_connector.py
new file mode 100644
index 000000000000..3f8979faec9c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_threat_intelligence_data_connector.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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='c345bf40-8509-4ed2-b947-50cb773aaf04',
+ data_connector={'kind': 'MicrosoftThreatIntelligence', 'properties': {'dataTypes': {'microsoftEmergingThreatFeed': {'lookbackPeriod': '1970-01-01T00:00:00.000Z', 'state': 'Enabled'}}, 'tenantId': '06b3ccb8-1384-4bcc-aec7-852f6d57161b'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateMicrosoftThreatIntelligenceDataConnector.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_threat_protection_data_connetor.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_threat_protection_data_connetor.py
new file mode 100644
index 000000000000..8c960c6687dd
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_microsoft_threat_protection_data_connetor.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_microsoft_threat_protection_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.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ data_connector={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'kind': 'MicrosoftThreatProtection', 'properties': {'dataTypes': {'alerts': {'state': 'Enabled'}, 'incidents': {'state': 'Disabled'}}, 'filteredProviders': {'alerts': ['microsoftDefenderForCloudApps']}, 'tenantId': '178265c4-3136-4ff6-8ed1-b5b62b4cb5f5'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/CreateMicrosoftThreatProtectionDataConnetor.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_office365_project_data_connetor.py
similarity index 74%
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_office365_project_data_connetor.py
index 17400d2e0bbe..e41e36a2cb4d 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_office365_project_data_connetor.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,21 +28,13 @@ def main():
)
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": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "kind": "Office365Project",
- "properties": {
- "dataTypes": {"logs": {"state": "Enabled"}},
- "tenantId": "2070ecc9-b4d5-4ae4-adaa-936fa1954fa8",
- },
- },
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ data_connector={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'kind': 'Office365Project', 'properties': {'dataTypes': {'logs': {'state': 'Enabled'}}, 'tenantId': '2070ecc9-b4d5-4ae4-adaa-936fa1954fa8'}},
)
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/preview/2024-04-01-preview/examples/dataConnectors/CreateOffice365ProjectDataConnetor.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 69%
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..c0e0b49ce240 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,25 +28,13 @@ def main():
)
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": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "kind": "Office365",
- "properties": {
- "dataTypes": {
- "exchange": {"state": "Enabled"},
- "sharePoint": {"state": "Enabled"},
- "teams": {"state": "Enabled"},
- },
- "tenantId": "2070ecc9-b4d5-4ae4-adaa-936fa1954fa8",
- },
- },
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ data_connector={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'kind': 'Office365', 'properties': {'dataTypes': {'exchange': {'state': 'Enabled'}, 'sharePoint': {'state': 'Enabled'}, 'teams': {'state': 'Enabled'}}, 'tenantId': '2070ecc9-b4d5-4ae4-adaa-936fa1954fa8'}},
)
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/preview/2024-04-01-preview/examples/dataConnectors/CreateOfficeDataConnetor.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/data_connectors/create_office_power_bi_data_connector.py
similarity index 74%
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/data_connectors/create_office_power_bi_data_connector.py
index c2c0e69ee1c2..f42984f8c6b0 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_office_power_bi_data_connector.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_office_power_bi_data_connector.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,21 +28,13 @@ def main():
)
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": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "kind": "OfficePowerBI",
- "properties": {
- "dataTypes": {"logs": {"state": "Enabled"}},
- "tenantId": "2070ecc9-b4d5-4ae4-adaa-936fa1954fa8",
- },
- },
+ 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', 'properties': {'dataTypes': {'logs': {'state': 'Enabled'}}, 'tenantId': '2070ecc9-b4d5-4ae4-adaa-936fa1954fa8'}},
)
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/preview/2024-04-01-preview/examples/dataConnectors/CreateOfficePowerBIDataConnector.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 74%
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..9260ea08cb81 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,21 +28,13 @@ def main():
)
response = client.data_connectors.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- data_connector={
- "kind": "ThreatIntelligence",
- "properties": {
- "dataTypes": {"indicators": {"state": "Enabled"}},
- "tenantId": "06b3ccb8-1384-4bcc-aec7-852f6d57161b",
- "tipLookbackPeriod": "2020-01-01T13:00:30.123Z",
- },
- },
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ data_connector={'kind': 'ThreatIntelligence', 'properties': {'dataTypes': {'indicators': {'state': 'Enabled'}}, 'tenantId': '06b3ccb8-1384-4bcc-aec7-852f6d57161b', 'tipLookbackPeriod': '2020-01-01T13:00:30.123Z'}},
)
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/preview/2024-04-01-preview/examples/dataConnectors/CreateThreatIntelligenceDataConnector.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_threat_intelligence_taxii_data_connector.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_threat_intelligence_taxii_data_connector.py
new file mode 100644
index 000000000000..0c880f99244c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/create_threat_intelligence_taxii_data_connector.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.
+# --------------------------------------------------------------------------
+
+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/2024-04-01-preview/examples/dataConnectors/CreateThreatIntelligenceTaxiiDataConnector.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_connectors/delete_api_polling.py
similarity index 83%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_api_polling.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_api_polling.py
index 49864982ae30..99cc763b1d25 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_api_polling.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_api_polling.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
+ client.data_connectors.delete(
+ 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/DeleteAPIPolling.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteAPIPolling.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_generic_ui.py
similarity index 83%
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_generic_ui.py
index b73a6e33886e..64b7774adcf9 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_generic_ui.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_generic_ui.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
+ client.data_connectors.delete(
+ 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/DeleteGenericUI.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteGenericUI.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_google_cloud_platform.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_google_cloud_platform.py
new file mode 100644
index 000000000000..0b9e8aaf8c3a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_google_cloud_platform.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_google_cloud_platform.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",
+ )
+
+ client.data_connectors.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='GCP_fce27b90-d6f5-4d30-991a-af509a2b50a1',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteGoogleCloudPlatform.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_microsoft_purview_information_protection_data_connetor.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_microsoft_purview_information_protection_data_connetor.py
new file mode 100644
index 000000000000..4e95b8aed954
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_microsoft_purview_information_protection_data_connetor.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_microsoft_purview_information_protection_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",
+ )
+
+ client.data_connectors.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteMicrosoftPurviewInformationProtectionDataConnetor.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_microsoft_threat_intelligence_data_connector.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_microsoft_threat_intelligence_data_connector.py
new file mode 100644
index 000000000000..ca86d25c6588
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_microsoft_threat_intelligence_data_connector.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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,
+ 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",
+ )
+
+ client.data_connectors.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='c345bf40-8509-4ed2-b947-50cb773aaf04',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteMicrosoftThreatIntelligenceDataConnector.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_office365_project_data_connetor.py
similarity index 84%
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_office365_project_data_connetor.py
index 8b565c226eb2..3887fc346526 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_office365_project_data_connetor.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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",
+ 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/DeleteOffice365ProjectDataConnetor.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DeleteOffice365ProjectDataConnetor.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 83%
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..9193b96e5268 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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",
+ 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/preview/2024-04-01-preview/examples/dataConnectors/DeleteOfficeDataConnetor.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/data_connectors/delete_office_power_bi_data_connetor.py
similarity index 83%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_power_bi_data_connetor.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_office_power_bi_data_connetor.py
index 9e48c8e08851..78099da3e947 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_power_bi_data_connetor.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/delete_office_power_bi_data_connetor.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/data_connectors/disconnect_api_polling.py
similarity index 83%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/disconnect_api_polling.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/disconnect_api_polling.py
index 86acefb3218e..f4195810d328 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/disconnect_api_polling.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/disconnect_api_polling.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/DisconnectAPIPolling.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 87%
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..c73ebc24bfff 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="c345bf40-8509-4ed2-b947-50cb773aaf04",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ 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/GetAmazonWebServicesCloudTrailById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAmazonWebServicesCloudTrailById.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_amazon_web_services_s3_by_id.py
similarity index 87%
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_amazon_web_services_s3_by_id.py
index 6738b3b06f21..4a9fb765ee2f 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_amazon_web_services_s3_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="afef3743-0c88-469c-84ff-ca2e87dc1e48",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='afef3743-0c88-469c-84ff-ca2e87dc1e48',
)
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/preview/2024-04-01-preview/examples/dataConnectors/GetAmazonWebServicesS3ById.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_api_polling.py
similarity index 87%
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_api_polling.py
index e36510675dde..f73b8b882872 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_api_polling.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_api_polling.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
+ 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/GetAPIPolling.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetAPIPolling.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 87%
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..cd154a9bda4a 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d',
)
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/preview/2024-04-01-preview/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 87%
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..eb268d516673 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="07e42cb3-e658-4e90-801c-efa0f29d3d44",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='07e42cb3-e658-4e90-801c-efa0f29d3d44',
)
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/preview/2024-04-01-preview/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 87%
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..7376eec3626a 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="763f9fa1-c2d3-4fa2-93e9-bccd4899aa12",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='763f9fa1-c2d3-4fa2-93e9-bccd4899aa12',
)
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/preview/2024-04-01-preview/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 91%
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..f3acdc7817f8 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/dataConnectors/GetDataConnectors.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetDataConnectors.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/data_connectors/get_dynamics365_data_connector_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_dynamics365_data_connector_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_dynamics365_data_connector_by_id.py
index 7b5578864e8a..776f80b2a2e2 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_dynamics365_data_connector_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_dynamics365_data_connector_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="c2541efb-c9a6-47fe-9501-87d1017d1512",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetDynamics365DataConnectorById.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/data_connectors/get_generic_ui.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_generic_ui.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_generic_ui.py
index 3d93903adcd8..93390c2c3d3b 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_generic_ui.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_generic_ui.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="316ec55e-7138-4d63-ab18-90c8a60fd1c8",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetGenericUI.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_google_cloud_platform_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_google_cloud_platform_by_id.py
new file mode 100644
index 000000000000..d4f6dbe4e8c6
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_google_cloud_platform_by_id.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_google_cloud_platform_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='GCP_fce27b90-d6f5-4d30-991a-af509a2b50a1',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetGoogleCloudPlatformById.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/data_connectors/get_io_tby_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_io_tby_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_io_tby_id.py
index 2862942122ce..a136252a7fc9 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_io_tby_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_io_tby_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="d2e5dc7a-f3a2-429d-954b-939fa8c2932e",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetIoTById.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 87%
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..788f12bc96a2 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="b96d014d-b5c2-4a01-9aba-a8058f629d42",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='b96d014d-b5c2-4a01-9aba-a8058f629d42',
)
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/preview/2024-04-01-preview/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 88%
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..a7a151dc20e0 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="06b3ccb8-1384-4bcc-aec7-852f6d57161b",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ data_connector_id='06b3ccb8-1384-4bcc-aec7-852f6d57161b',
)
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/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.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/data_connectors/get_microsoft_insider_risk_management_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_insider_risk_management_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_insider_risk_management_by_id.py
index 51ae83893b7d..92a3012ce8f8 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_microsoft_insider_risk_management_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_insider_risk_management_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="3d3e955e-33eb-401d-89a7-251c81ddd660",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftInsiderRiskManagementById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_purview_information_protection_data_connetor_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_purview_information_protection_data_connetor_by_id.py
new file mode 100644
index 000000000000..af30f7c50e43
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_microsoft_purview_information_protection_data_connetor_by_id.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.
+# --------------------------------------------------------------------------
+
+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_purview_information_protection_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/2024-04-01-preview/examples/dataConnectors/GetMicrosoftPurviewInformationProtectionDataConnetorById.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 87%
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..527679054690 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="c345bf40-8509-4ed2-b947-50cb773aaf04",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ 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/GetMicrosoftThreatIntelligenceById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftThreatIntelligenceById.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_microsoft_threat_protection_by_id.py
similarity index 87%
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_microsoft_threat_protection_by_id.py
index d97c5ff04218..e8ab303f3971 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_microsoft_threat_protection_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="c345bf40-8509-4ed2-b947-50cb773aaf04",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ 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/GetMicrosoftThreatProtectionById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetMicrosoftThreatProtectionById.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/data_connectors/get_office365_advanced_threat_protection_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office365_advanced_threat_protection_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_office365_advanced_threat_protection_by_id.py
index ce52eaf4847f..af9e59d98f91 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office365_advanced_threat_protection_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_office365_advanced_threat_protection_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="3d3e955e-33eb-401d-89a7-251c81ddd660",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/data_connectors/get_office365_project_data_connetor_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office365_project_data_connetor_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_office365_project_data_connetor_by_id.py
index 5486268cc6f0..30c41ac22017 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office365_project_data_connetor_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_office365_project_data_connetor_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetOffice365ProjectDataConnetorById.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 87%
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..5533bbf09e8e 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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/GetOfficeDataConnetorById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetOfficeDataConnetorById.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/data_connectors/get_office_power_bi_data_connetor_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_power_bi_data_connetor_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_office_power_bi_data_connetor_by_id.py
index 6136caf31c43..294ba42fc494 100644
--- 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/data_connectors/get_office_power_bi_data_connetor_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetOfficePowerBIDataConnetorById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_rest_api_poller_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_rest_api_poller_by_id.py
new file mode 100644
index 000000000000..f1fe3336212f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_rest_api_poller_by_id.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ 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,
+ 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='RestApiPoller_fce27b90-d6f5-4d30-991a-af509a2b50a1',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetRestApiPollerById.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_threat_intelligence_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_threat_intelligence_by_id.py
new file mode 100644
index 000000000000..309a32466381
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_threat_intelligence_by_id.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.
+# --------------------------------------------------------------------------
+
+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_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='c345bf40-8509-4ed2-b947-50cb773aaf04',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetThreatIntelligenceById.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/data_connectors/get_threat_intelligence_taxii_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence_taxii_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_threat_intelligence_taxii_by_id.py
index 52cb79c118e1..45b5ff1dfe37 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_threat_intelligence_taxii_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/data_connectors/get_threat_intelligence_taxii_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.data_connectors.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- data_connector_id="c39bb458-02a7-4b3f-b0c8-71a1d2692652",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/dataConnectors/GetThreatIntelligenceTaxiiById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/enrichment/get_geodata_with_workspace_by_ip.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/enrichment/get_geodata_with_workspace_by_ip.py
new file mode 100644
index 000000000000..0476b22369db
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/enrichment/get_geodata_with_workspace_by_ip.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.
+# --------------------------------------------------------------------------
+
+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_with_workspace_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.list_geodata_by_ip(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ enrichment_type='main',
+ ip_address_body={'ipAddress': '1.2.3.4'},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/enrichment/GetGeodataWithWorkspaceByIp.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/enrichment/get_whois_with_workspace_by_domain_name.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/enrichment/get_whois_with_workspace_by_domain_name.py
new file mode 100644
index 000000000000..2db8bcdd17b7
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/enrichment/get_whois_with_workspace_by_domain_name.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.
+# --------------------------------------------------------------------------
+
+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_with_workspace_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.list_whois_by_domain(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ enrichment_type='main',
+ domain_body={'domain': 'microsoft.com'},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/enrichment/GetWhoisWithWorkspaceByDomainName.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/entities/expand/post_expand_entity.py
similarity index 78%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_expand_entity.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/expand/post_expand_entity.py
index 6419a34d794d..aa3dd9414dd8 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_expand_entity.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/expand/post_expand_entity.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,18 +28,13 @@ def main():
)
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",
- },
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/expand/PostExpandEntity.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/entities/get_account_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_account_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_account_entity_by_id.py
index 4cdf7445de26..9c31535454cb 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_account_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_account_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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/GetAccountEntityById.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetAccountEntityById.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/entities/get_azure_resource_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_resource_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_azure_resource_entity_by_id.py
index b050cca4c7c5..1083ccc57c1e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_azure_resource_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_azure_resource_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetAzureResourceEntityById.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/entities/get_cloud_application_entity_by_id.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_cloud_application_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_cloud_application_entity_by_id.py
index 6f0e16b2e736..b69ce015954a 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_cloud_application_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_cloud_application_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_dns_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_dns_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_dns_entity_by_id.py
index d12e56266b46..c892e3060a63 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_dns_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_dns_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="f4e74920-f2c0-4412-a45f-66d94fdf01f8",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetDnsEntityById.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/entities/get_entities.py
similarity index 91%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entities.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_entities.py
index 7497dda7be87..c1ee02516d18 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entities.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_entities.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/entities/GetEntities.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetEntities.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/entities/get_file_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_file_entity_by_id.py
index 91f2d212d0ef..a59ad7099861 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_file_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="af378b21-b4aa-4fe7-bc70-13f8621a322f",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_file_hash_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_hash_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_file_hash_entity_by_id.py
index e3191f6d250b..5742726927dc 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_hash_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_file_hash_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="ea359fa6-c1e5-f878-e105-6344f3e399a1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetFileHashEntityById.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/entities/get_host_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_host_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_host_entity_by_id.py
index da73796bf50e..4661d1d647b5 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_host_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_host_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetHostEntityById.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/entities/get_io_tdevice_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_io_tdevice_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_io_tdevice_entity_by_id.py
index eb492445a610..ae3f3b6b7720 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_io_tdevice_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_io_tdevice_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_ip_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_ip_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_ip_entity_by_id.py
index 0df0f6826bed..3b162a1fc130 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_ip_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_ip_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_mail_cluster_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mail_cluster_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_mail_cluster_entity_by_id.py
index f43526065efd..5e08296f15c0 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mail_cluster_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_mail_cluster_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_mail_message_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mail_message_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_mail_message_entity_by_id.py
index 5d9c55a18e9f..d8e45ed83738 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mail_message_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_mail_message_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_mailbox_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mailbox_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_mailbox_entity_by_id.py
index ab443b71cfd7..81a742d3d23a 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_mailbox_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_mailbox_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_malware_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_malware_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_malware_entity_by_id.py
index 5c8a14d51428..7bd8f9a1f632 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_malware_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_malware_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="af378b21-b4aa-4fe7-bc70-13f8621a322f",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetMalwareEntityById.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/entities/get_process_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_process_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_process_entity_by_id.py
index f00cd0a7d744..b3e35ec4e80c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_process_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_process_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="7264685c-038c-42c6-948c-38e14ef1fb98",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_queries.py
similarity index 84%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_queries.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_queries.py
index eb816400aa67..26aa969f2379 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_queries.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_queries.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,14 @@ def main():
)
response = client.entities.queries(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
- kind="Insight",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ entity_id='e1d3d618-e11f-478b-98e3-bb381539a8e1',
+ kind='Insight',
)
- print(response)
-
+ for item in response:
+ print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/entities/GetQueries.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetQueries.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/entities/get_registry_key_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_registry_key_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_registry_key_entity_by_id.py
index cb4e42df61ca..633dde2707cb 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_registry_key_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_registry_key_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_registry_value_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_registry_value_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_registry_value_entity_by_id.py
index 5081e924eae9..a29a79b7e927 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_registry_value_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_registry_value_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="dc44bd11-b348-4d76-ad29-37bf7aa41356",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_security_alert_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_security_alert_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_security_alert_entity_by_id.py
index d97f34e82268..42138d240292 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_security_alert_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_security_alert_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="4aa486e0-6f85-41af-99ea-7acdce7be6c8",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_security_group_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_security_group_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_security_group_entity_by_id.py
index 4dbc57ea7730..99dd5ddd5432 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_security_group_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_security_group_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-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/entities/get_submission_mail_entity_by_id.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_submission_mail_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_submission_mail_entity_by_id.py
index 3ee652535e57..2f1cc8301f7e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_submission_mail_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_submission_mail_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetSubmissionMailEntityById.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/entities/get_url_entity_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_url_entity_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_url_entity_by_id.py
index fb4d819a677e..97536fb2b51c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_url_entity_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/get_url_entity_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entities.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="e1d3d618-e11f-478b-98e3-bb381539a8e1",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/GetUrlEntityById.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/entities/insights/post_get_insights.py
similarity index 76%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_get_insights.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/insights/post_get_insights.py
index 4e210c82efb3..32aa18768fdf 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_get_insights.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/insights/post_get_insights.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,19 +28,13 @@ def main():
)
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",
- },
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/insights/PostGetInsights.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/entities/relations/get_all_entity_relations.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_entity_relations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/relations/get_all_entity_relations.py
index 292751766fbf..e2dbcf09b9c4 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_entity_relations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/relations/get_all_entity_relations.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.entities_relations.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/relations/GetAllEntityRelations.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/entities/relations/get_entity_relation_by_name.py
similarity index 85%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_relation_by_name.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/relations/get_entity_relation_by_name.py
index 9f6da60a51c1..63575fde1df3 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_relation_by_name.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/relations/get_entity_relation_by_name.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
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",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/relations/GetEntityRelationByName.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/entities/timeline/post_timeline_entity.py
similarity index 79%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_timeline_entity.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/timeline/post_timeline_entity.py
index 8d224b26250a..7ea0dfeafedd 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/post_timeline_entity.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entities/timeline/post_timeline_entity.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,18 +28,13 @@ def main():
)
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",
- },
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entities/timeline/PostTimelineEntity.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/create_entity_query_activity.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/create_entity_query_activity.py
new file mode 100644
index 000000000000..ffae22cee800
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/create_entity_query_activity.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.
+# --------------------------------------------------------------------------
+
+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/2024-04-01-preview/examples/entityQueries/CreateEntityQueryActivity.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/entity_queries/delete_entity_query.py
similarity index 83%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_entity_query.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/delete_entity_query.py
index a65893898988..1ac5209e3356 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_entity_query.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/delete_entity_query.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_query_id="07da3cc8-c8ad-4710-a44e-334cdcb7882b",
+ client.entity_queries.delete(
+ 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/DeleteEntityQuery.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/DeleteEntityQuery.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/entity_queries/get_activity_entity_query_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_activity_entity_query_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/get_activity_entity_query_by_id.py
index 627d89dee6b5..1181e7c7e6ab 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_activity_entity_query_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/get_activity_entity_query_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entity_queries.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_query_id="07da3cc8-c8ad-4710-a44e-334cdcb7882b",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/GetActivityEntityQueryById.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/entity_queries/get_entity_queries.py
similarity index 91%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_queries.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/get_entity_queries.py
index 8cee24ba1398..f03540653b85 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_queries.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/get_entity_queries.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entity_queries.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/entityQueries/GetEntityQueries.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/GetEntityQueries.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/entity_queries/get_expansion_entity_query_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_expansion_entity_query_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/get_expansion_entity_query_by_id.py
index b602cd4c4c5f..3d5499eb0c98 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_expansion_entity_query_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_queries/get_expansion_entity_query_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entity_queries.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_query_id="07da3cc8-c8ad-4710-a44e-334cdcb7882b",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueries/GetExpansionEntityQueryById.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/entity_query_templates/get_activity_entity_query_template_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_activity_entity_query_template_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_query_templates/get_activity_entity_query_template_by_id.py
index 8535ed42977e..957a757ee4f5 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_activity_entity_query_template_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_query_templates/get_activity_entity_query_template_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entity_query_templates.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- entity_query_template_id="07da3cc8-c8ad-4710-a44e-334cdcb7882b",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueryTemplates/GetActivityEntityQueryTemplateById.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/entity_query_templates/get_entity_query_templates.py
similarity index 91%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_query_templates.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_query_templates/get_entity_query_templates.py
index 9891a363b78b..6cc9c069cd68 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_entity_query_templates.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/entity_query_templates/get_entity_query_templates.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.entity_query_templates.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/entityQueryTemplates/GetEntityQueryTemplates.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/file_imports/create_file_import.py
similarity index 73%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_file_import.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/file_imports/create_file_import.py
index 9a9744fd6ec9..b7e1c73980b6 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/create_file_import.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/file_imports/create_file_import.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,21 +28,13 @@ def main():
)
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",
- }
- },
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/fileImports/CreateFileImport.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/file_imports/delete_file_import.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_file_import.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/file_imports/delete_file_import.py
index 3b966a3523f3..5df8ef688c4c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_file_import.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/file_imports/delete_file_import.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.file_imports.begin_delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- file_import_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/fileImports/DeleteFileImport.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/file_imports/get_file_import_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_import_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/file_imports/get_file_import_by_id.py
index 31cca3f33ca3..4ff6da6c9281 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_import_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/file_imports/get_file_import_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.file_imports.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- file_import_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/fileImports/GetFileImportById.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/file_imports/get_file_imports.py
similarity index 91%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_imports.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/file_imports/get_file_imports.py
index 453ebae65bdc..83f4eb01e45e 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_file_imports.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/file_imports/get_file_imports.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.file_imports.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/fileImports/GetFileImports.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/fileImports/GetFileImports.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/create_hunt.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/create_hunt.py
new file mode 100644
index 000000000000..83f4f03ac8cb
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/create_hunt.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_hunt.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.hunts.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
+ hunt={'properties': {'attackTactics': ['Reconnaissance'], 'attackTechniques': ['T1595'], 'description': 'Log4J Hunt Description', 'displayName': 'Log4J new hunt', 'hypothesisStatus': 'Unknown', 'labels': ['Label1', 'Label2'], 'owner': {'objectId': '873b5263-5d34-4149-b356-ad341b01e123'}, 'status': 'New'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/CreateHunt.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/create_hunt_comment.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/create_hunt_comment.py
new file mode 100644
index 000000000000..dcb9b1c08b0b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/create_hunt_comment.py
@@ -0,0 +1,41 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_hunt_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,
+ 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.hunt_comments.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
+ hunt_comment_id='2216d0e1-91e3-4902-89fd-d2df8c535096',
+ hunt_comment={'properties': {'message': 'This is a test comment.'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/CreateHuntComment.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/create_hunt_relation.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/create_hunt_relation.py
new file mode 100644
index 000000000000..c5f8ec775ef9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/create_hunt_relation.py
@@ -0,0 +1,41 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_hunt_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="bd794837-4d29-4647-9105-6339bfdb4e6a",
+ )
+
+ response = client.hunt_relations.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
+ hunt_relation_id='2216d0e1-91e3-4902-89fd-d2df8c535096',
+ hunt_relation={'properties': {'labels': ['Test Label'], 'relatedResourceId': '/subscriptions/bd794837-4d29-4647-9105-6339bfdb4e6a/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/avdvirint/providers/Microsoft.SecurityInsights/Bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/CreateHuntRelation.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/hunts/delete_hunt.py
similarity index 82%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_whois_by_domain_name.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/delete_hunt.py
index 53f54bfb1d25..3bab3f61709f 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_whois_by_domain_name.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/delete_hunt.py
@@ -7,35 +7,32 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_whois_by_domain_name.py
+ python delete_hunt.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",
+ client.hunts.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
)
- print(response)
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/enrichment/GetWhoisByDomainName.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/DeleteHunt.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/delete_hunt_comment.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/delete_hunt_comment.py
new file mode 100644
index 000000000000..388418888957
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/delete_hunt_comment.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python delete_hunt_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,
+ 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",
+ )
+
+ client.hunt_comments.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
+ hunt_comment_id='2216d0e1-91e3-4902-89fd-d2df8c123456',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/DeleteHuntComment.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/delete_hunt_relation.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/delete_hunt_relation.py
new file mode 100644
index 000000000000..7f00bef74e88
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/delete_hunt_relation.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python delete_hunt_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="bd794837-4d29-4647-9105-6339bfdb4e6a",
+ )
+
+ client.hunt_relations.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
+ hunt_relation_id='2216d0e1-91e3-4902-89fd-d2df8c535096',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/DeleteHuntRelation.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_by_id.py
new file mode 100644
index 000000000000..6f7fc5155337
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_by_id.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_hunt_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="bd794837-4d29-4647-9105-6339bfdb4e6a",
+ )
+
+ response = client.hunts.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/GetHuntById.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_comment_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_comment_by_id.py
new file mode 100644
index 000000000000..5c21bfd0f41c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_comment_by_id.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_hunt_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,
+ 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.hunt_comments.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
+ hunt_comment_id='2216d0e1-91e3-4902-89fd-d2df8c535096',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/GetHuntCommentById.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_comments.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_comments.py
new file mode 100644
index 000000000000..0b66e0b99f54
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_comments.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_hunt_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,
+ 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.hunt_comments.list(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
+ )
+ for item in response:
+ print(item)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/GetHuntComments.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_relation_by_id.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_relation_by_id.py
new file mode 100644
index 000000000000..9dfd242ba8da
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_relation_by_id.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_hunt_relation_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="bd794837-4d29-4647-9105-6339bfdb4e6a",
+ )
+
+ response = client.hunt_relations.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
+ hunt_relation_id='2216d0e1-91e3-4902-89fd-d2df8c535096',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/GetHuntRelationById.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_relations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_relations.py
new file mode 100644
index 000000000000..cd8151edc41b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunt_relations.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_hunt_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="bd794837-4d29-4647-9105-6339bfdb4e6a",
+ )
+
+ response = client.hunt_relations.list(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ hunt_id='163e7b2a-a2ec-4041-aaba-d878a38f265f',
+ )
+ for item in response:
+ print(item)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/GetHuntRelations.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/hunts/get_hunts.py
similarity index 83%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_geodata_by_ip.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunts.py
index 93496f23f2d7..5880cbdd62c2 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_geodata_by_ip.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/hunts/get_hunts.py
@@ -7,35 +7,33 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-securityinsight
# USAGE
- python get_geodata_by_ip.py
+ python get_hunts.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",
+ response = client.hunts.list(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
)
- print(response)
-
+ for item in response:
+ print(item)
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/enrichment/GetGeodataByIp.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/hunts/GetHunts.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/incident_alerts/incidents_list_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/incident_alerts/incidents_list_alerts.py
index a62de178a146..7a712ec8cb40 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_alerts.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_alerts/incidents_list_alerts.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.incidents.list_alerts(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="69a30280-6a4c-4aa7-9af0-5d63f335d600",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ incident_id='69a30280-6a4c-4aa7-9af0-5d63f335d600',
)
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/preview/2024-04-01-preview/examples/incidents/IncidentAlerts/Incidents_ListAlerts.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/incident_bookmarks/incidents_list_bookmarks.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_bookmarks.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_bookmarks/incidents_list_bookmarks.py
index b931f0ff5499..a9db645d84bb 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_bookmarks.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_bookmarks/incidents_list_bookmarks.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.incidents.list_bookmarks(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="69a30280-6a4c-4aa7-9af0-5d63f335d600",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ incident_id='69a30280-6a4c-4aa7-9af0-5d63f335d600',
)
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/preview/2024-04-01-preview/examples/incidents/IncidentBookmarks/Incidents_ListBookmarks.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/incident_comments/incident_comments_create_or_update.py
similarity index 81%
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/incident_comments/incident_comments_create_or_update.py
index 76b762bca38f..a071f3c7fe3f 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_create_or_update.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_comments/incident_comments_create_or_update.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,15 +28,14 @@ def main():
)
response = client.incident_comments.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- incident_comment_id="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
- incident_comment={"properties": {"message": "Some message"}},
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ incident_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ incident_comment_id='4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014',
+ incident_comment={'properties': {'message': 'Some message'}},
)
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/preview/2024-04-01-preview/examples/incidents/IncidentComments/IncidentComments_CreateOrUpdate.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/incident_comments/incident_comments_delete.py
similarity index 80%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_delete.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_comments/incident_comments_delete.py
index 41de0f2f027c..9ca3bb75df02 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_delete.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_comments/incident_comments_delete.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,23 +21,19 @@
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.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",
+ 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/preview/2024-04-01-preview/examples/incidents/IncidentComments/IncidentComments_Delete.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/incident_comments/incident_comments_get.py
similarity index 84%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_get.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_comments/incident_comments_get.py
index 376e884be9ca..015c54c4845b 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_get.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_comments/incident_comments_get.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.incident_comments.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- incident_comment_id="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
+ 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_Get.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/IncidentComments/IncidentComments_Get.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/incident_comments/incident_comments_list.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_list.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_comments/incident_comments_list.py
index 7fce290b89df..a66b29c0d2fd 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_comments_list.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_comments/incident_comments_list.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.incident_comments.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ incident_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
)
for item in response:
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/preview/2024-04-01-preview/examples/incidents/IncidentComments/IncidentComments_List.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/incident_entities/incidents_list_entities.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_entities.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_entities/incidents_list_entities.py
index 93dbebcc10c5..98c92d7d0256 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list_entities.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_entities/incidents_list_entities.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.incidents.list_entities(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="69a30280-6a4c-4aa7-9af0-5d63f335d600",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ incident_id='69a30280-6a4c-4aa7-9af0-5d63f335d600',
)
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/preview/2024-04-01-preview/examples/incidents/IncidentEntities/Incidents_ListEntities.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/incident_tasks/incident_tasks_create_or_update.py
similarity index 79%
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/incident_tasks/incident_tasks_create_or_update.py
index 358cd15f754e..8cf59611833a 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_create_or_update.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_tasks/incident_tasks_create_or_update.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,15 +28,14 @@ def main():
)
response = client.incident_tasks.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- incident_task_id="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
- incident_task={"properties": {"description": "Task description", "status": "New", "title": "Task title"}},
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ incident_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ incident_task_id='4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014',
+ incident_task={'properties': {'description': 'Task description', 'status': 'New', 'title': 'Task title'}},
)
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/preview/2024-04-01-preview/examples/incidents/IncidentTasks/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/incident_tasks/incident_tasks_delete.py
similarity index 80%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_delete.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_tasks/incident_tasks_delete.py
index 4e742bfbd432..f5bafc01dcbd 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_delete.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_tasks/incident_tasks_delete.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,23 +21,19 @@
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.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",
+ 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/preview/2024-04-01-preview/examples/incidents/IncidentTasks/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/incident_tasks/incident_tasks_get.py
similarity index 84%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_get.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_tasks/incident_tasks_get.py
index e825d109fd60..33173f5f193c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_get.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_tasks/incident_tasks_get.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.incident_tasks.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- incident_task_id="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
+ 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_Get.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/IncidentTasks/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/incident_tasks/incident_tasks_list.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_list.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_tasks/incident_tasks_list.py
index 371a20ddd697..62c97f1ada15 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incident_tasks_list.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_tasks/incident_tasks_list.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.incident_tasks.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ incident_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
)
for item in response:
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/preview/2024-04-01-preview/examples/incidents/IncidentTasks/IncidentTasks_List.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/incidents/incident_team/incidents_create_team.py
similarity index 79%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_create_team.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_team/incidents_create_team.py
index 6f3462eb2a73..091a0497d7ae 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_create_team.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incident_team/incidents_create_team.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,19 +28,13 @@ def main():
)
response = client.incidents.create_team(
- 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",
- },
+ 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'},
)
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/preview/2024-04-01-preview/examples/incidents/IncidentTeam/Incidents_CreateTeam.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incidents_create_or_update.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incidents_create_or_update.py
new file mode 100644
index 000000000000..03a0a05903a5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incidents_create_or_update.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python incidents_create_or_update.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.incidents.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ incident_id='73e01a99-5cd7-4139-a149-9f2736ff2ab5',
+ incident={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'properties': {'classification': 'FalsePositive', 'classificationComment': 'Not a malicious activity', 'classificationReason': 'InaccurateData', '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}, 'severity': 'High', 'status': 'Closed', 'title': 'My incident'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/Incidents_CreateOrUpdate.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/incidents_delete.py
similarity index 84%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_delete.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incidents_delete.py
index 46d6ef624106..230915d598d7 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_delete.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incidents_delete.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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.incidents.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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/preview/2024-04-01-preview/examples/incidents/Incidents_Delete.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/incidents_get.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_get.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incidents_get.py
index 159a603b2460..4a75a883edfa 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_get.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incidents_get.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.incidents.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
+ 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_Get.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/Incidents_Get.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/incidents_list.py
similarity index 91%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incidents_list.py
index 92ad2ea10b6b..4c452866f591 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_list.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents/incidents_list.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.incidents.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/incidents/Incidents_List.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/Incidents_List.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 71%
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..8c00a2fb6977 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,19 +28,14 @@ def main():
)
response = client.incident_relations.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
- 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"
- }
- },
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ incident_id='afbd324f-6c48-459c-8710-8d1e1cd03812',
+ 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'}},
)
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/preview/2024-04-01-preview/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 80%
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..dcd2a943dde8 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,23 +21,19 @@
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.incident_relations.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
- relation_name="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
+ 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/preview/2024-04-01-preview/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 88%
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..719972a6d779 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.incident_relations.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ incident_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/incidents/relations/GetAllIncidentRelations.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 84%
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..9d00ed5be6ba 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.incident_relations.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="afbd324f-6c48-459c-8710-8d1e1cd03812",
- relation_name="4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
+ 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/GetIncidentRelationByName.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/incidents/relations/GetIncidentRelationByName.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_or_update.py
deleted file mode 100644
index 99dd33a78950..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/incidents_create_or_update.py
+++ /dev/null
@@ -1,63 +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 incidents_create_or_update.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.incidents.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
- incident={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "properties": {
- "classification": "FalsePositive",
- "classificationComment": "Not a malicious activity",
- "classificationReason": "InaccurateData",
- "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,
- },
- "severity": "High",
- "status": "Closed",
- "title": "My incident",
- },
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/incidents/Incidents_CreateOrUpdate.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/manual_trigger/entities_run_playbook.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/manual_trigger/entities_run_playbook.py
new file mode 100644
index 000000000000..ac23d53f8f49
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/manual_trigger/entities_run_playbook.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 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,
+ 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",
+ )
+
+ client.entities.run_playbook(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ entity_identifier='72e01a22-5cd2-4139-a149-9f2736ff2ar2',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 87%
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..2ec6ed7cb585 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.incidents.run_playbook(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- incident_identifier="73e01a99-5cd7-4139-a149-9f2736ff2ar4",
+ 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/preview/2024-04-01-preview/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 85%
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..f212763339ff 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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.metadata.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- metadata_name="metadataName",
+ 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/preview/2024-04-01-preview/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 91%
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..cdf08e30b5e5 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.metadata.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/metadata/GetAllMetadata.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 91%
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..9705fecc5731 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.metadata.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/metadata/GetAllMetadataOData.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 88%
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..886eda2bce80 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.metadata.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- metadata_name="metadataName",
+ 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/GetMetadata.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 83%
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..01c7c1a458d0 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.metadata.update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- metadata_name="metadataName",
- metadata_patch={"properties": {"author": {"email": "email@microsoft.com", "name": "User Name"}}},
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ metadata_name='metadataName',
+ metadata_patch={'properties': {'author': {'email': 'email@microsoft.com', 'name': 'User Name'}}},
)
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/preview/2024-04-01-preview/examples/metadata/PatchMetadata.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/put_metadata.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/put_metadata.py
new file mode 100644
index 000000000000..3518aa0c5f32
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/metadata/put_metadata.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python put_metadata.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.metadata.create(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ metadata_name='metadataName',
+ metadata={'properties': {'author': {'email': 'email@microsoft.com', 'name': 'User Name'}, 'categories': {'domains': ['Application', 'Security – Insider Threat'], 'verticals': ['Healthcare']}, 'contentId': 'c00ee137-7475-47c8-9cce-ec6f0f1bedd0', 'contentSchemaVersion': '2.0', 'customVersion': '1.0', 'dependencies': {'criteria': [{'criteria': [{'contentId': '045d06d0-ee72-4794-aba4-cf5646e4c756', 'kind': 'DataConnector', 'name': 'Microsoft Defender for Endpoint'}, {'contentId': 'dbfcb2cc-d782-40ef-8d94-fe7af58a6f2d', 'kind': 'DataConnector'}, {'contentId': 'de4dca9b-eb37-47d6-a56f-b8b06b261593', 'kind': 'DataConnector', 'version': '2.0'}], 'operator': 'OR'}, {'contentId': '31ee11cc-9989-4de8-b176-5e0ef5c4dbab', 'kind': 'Playbook', 'version': '1.0'}, {'contentId': '21ba424a-9438-4444-953a-7059539a7a1b', 'kind': 'Parser'}], 'operator': 'AND'}, 'firstPublishDate': '2021-05-18', 'kind': 'AnalyticsRule', 'lastPublishDate': '2021-05-18', 'parentId': '/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName', 'previewImages': ['firstImage.png', 'secondImage.jpeg'], 'previewImagesDark': ['firstImageDark.png', 'secondImageDark.jpeg'], 'providers': ['Amazon', 'Microsoft'], 'source': {'kind': 'Solution', 'name': 'Contoso Solution 1.0', 'sourceId': 'b688a130-76f4-4a07-bf57-762222a3cadf'}, 'support': {'email': 'support@microsoft.com', 'link': 'https://support.microsoft.com/', 'name': 'Microsoft', 'tier': 'Partner'}, 'threatAnalysisTactics': ['reconnaissance', 'commandandcontrol'], 'threatAnalysisTechniques': ['T1548', 'T1548.001'], 'version': '1.0.0.0'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 71%
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..6b3c24ef163d 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,20 +28,13 @@ def main():
)
response = client.metadata.create(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- metadata_name="metadataName",
- metadata={
- "properties": {
- "contentId": "c00ee137-7475-47c8-9cce-ec6f0f1bedd0",
- "kind": "AnalyticsRule",
- "parentId": "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName",
- }
- },
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ metadata_name='metadataName',
+ metadata={'properties': {'contentId': 'c00ee137-7475-47c8-9cce-ec6f0f1bedd0', 'kind': 'AnalyticsRule', 'parentId': '/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName'}},
)
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/preview/2024-04-01-preview/examples/metadata/PutMetadataMinimal.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/office_consents/delete_office_consents.py
similarity index 83%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_consents.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/office_consents/delete_office_consents.py
index d66ae4ac7351..acf1717240ca 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_office_consents.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/office_consents/delete_office_consents.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/officeConsents/DeleteOfficeConsents.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/office_consents/get_office_consents.py
similarity index 91%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_consents.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/office_consents/get_office_consents.py
index 047adb41a559..c6c2f1e1bfa3 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_consents.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/office_consents/get_office_consents.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.office_consents.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/officeConsents/GetOfficeConsents.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/officeConsents/GetOfficeConsents.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/office_consents/get_office_consents_by_id.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_consents_by_id.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/office_consents/get_office_consents_by_id.py
index 07d171e85fe9..86b8d94e9028 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_office_consents_by_id.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/office_consents/get_office_consents_by_id.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.office_consents.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- consent_id="04e5fd05-ff86-4b97-b8d2-1c20933cb46c",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/officeConsents/GetOfficeConsentsById.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 88%
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..3a176a0e7e3d 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.sentinel_onboarding_states.create(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- sentinel_onboarding_state_name="default",
+ 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/CreateSentinelOnboardingState.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 84%
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..44f652c94632 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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.sentinel_onboarding_states.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- sentinel_onboarding_state_name="default",
+ 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/preview/2024-04-01-preview/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 91%
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..2d7b700e44c7 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,12 +28,11 @@ def main():
)
response = client.sentinel_onboarding_states.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
)
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/preview/2024-04-01-preview/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 88%
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..27f2e9d0ff1d 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.sentinel_onboarding_states.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- sentinel_onboarding_state_name="default",
+ 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/GetSentinelOnboardingState.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 92%
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..787090fe56a5 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,19 +21,17 @@
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="SUBSCRIPTION_ID",
)
- response = client.operations.list()
+ response = client.operations.list(
+ )
for item in response:
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/preview/2024-04-01-preview/examples/operations/ListOperations.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/put_metadata.py
deleted file mode 100644
index 62ff77bced8a..000000000000
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/put_metadata.py
+++ /dev/null
@@ -1,95 +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 put_metadata.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.metadata.create(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- metadata_name="metadataName",
- metadata={
- "properties": {
- "author": {"email": "email@microsoft.com", "name": "User Name"},
- "categories": {"domains": ["Application", "Security – Insider Threat"], "verticals": ["Healthcare"]},
- "contentId": "c00ee137-7475-47c8-9cce-ec6f0f1bedd0",
- "contentSchemaVersion": "2.0",
- "customVersion": "1.0",
- "dependencies": {
- "criteria": [
- {
- "criteria": [
- {
- "contentId": "045d06d0-ee72-4794-aba4-cf5646e4c756",
- "kind": "DataConnector",
- "name": "Microsoft Defender for Endpoint",
- },
- {"contentId": "dbfcb2cc-d782-40ef-8d94-fe7af58a6f2d", "kind": "DataConnector"},
- {
- "contentId": "de4dca9b-eb37-47d6-a56f-b8b06b261593",
- "kind": "DataConnector",
- "version": "2.0",
- },
- ],
- "operator": "OR",
- },
- {"contentId": "31ee11cc-9989-4de8-b176-5e0ef5c4dbab", "kind": "Playbook", "version": "1.0"},
- {"contentId": "21ba424a-9438-4444-953a-7059539a7a1b", "kind": "Parser"},
- ],
- "operator": "AND",
- },
- "firstPublishDate": "2021-05-18",
- "kind": "AnalyticsRule",
- "lastPublishDate": "2021-05-18",
- "parentId": "/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName",
- "previewImages": ["firstImage.png", "secondImage.jpeg"],
- "previewImagesDark": ["firstImageDark.png", "secondImageDark.jpeg"],
- "providers": ["Amazon", "Microsoft"],
- "source": {
- "kind": "Solution",
- "name": "Contoso Solution 1.0",
- "sourceId": "b688a130-76f4-4a07-bf57-762222a3cadf",
- },
- "support": {
- "email": "support@microsoft.com",
- "link": "https://support.microsoft.com/",
- "name": "Microsoft",
- "tier": "Partner",
- },
- "threatAnalysisTactics": ["reconnaissance", "commandandcontrol"],
- "threatAnalysisTechniques": ["T1548", "T1548.001"],
- "version": "1.0.0.0",
- }
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/metadata/PutMetadata.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/recommendations/get_recommendation.py
similarity index 87%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_recommendation.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/recommendations/get_recommendation.py
index 10ce219569fc..db3b9ffd745c 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_recommendation.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/recommendations/get_recommendation.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.get.single_recommendation(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- recommendation_id="6d4b54eb-8684-4aa3-a156-3aa37b8014bc",
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/recommendations/GetRecommendation.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/recommendations/get_recommendations.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_recommendations.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/recommendations/get_recommendations.py
index 049b5a6b8a82..bc824acdaf59 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_recommendations.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/recommendations/get_recommendations.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,12 +28,12 @@ def main():
)
response = client.get_recommendations.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
)
- print(response)
-
+ for item in response:
+ print(item)
-# 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/preview/2024-04-01-preview/examples/recommendations/GetRecommendations.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/recommendations/patch_recommendation.py
similarity index 81%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/patch_recommendation.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/recommendations/patch_recommendation.py
index 42ed7cf1e6ac..edf174c68d8f 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/patch_recommendation.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/recommendations/patch_recommendation.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,23 +21,20 @@
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()
+ response = client.update.recommendation(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ recommendation_id='6d4b54eb-8684-4aa3-a156-3aa37b8014bc',
+ recommendation_patch={'properties': {'state': 'Active'}},
+ )
print(response)
-
-# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-12-01-preview/examples/recommendations/PatchRecommendation.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/recommendations/PatchRecommendation.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/recommendations/reevaluate_recommendation.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/recommendations/reevaluate_recommendation.py
new file mode 100644
index 000000000000..c95f025237de
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/recommendations/reevaluate_recommendation.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python reevaluate_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.reevaluate.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/2024-04-01-preview/examples/recommendations/ReevaluateRecommendation.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 79%
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..5ae56f576ca9 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.source_control.list_repositories(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- repo_type="Github",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ 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/preview/2024-04-01-preview/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 83%
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..3badef3d745d 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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.security_ml_analytics_settings.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- settings_resource_name="f209187f-1d17-4431-94af-c141bf5f23db",
+ 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/preview/2024-04-01-preview/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..da06742852b1 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.security_ml_analytics_settings.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 88%
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..4ae47eb3895a 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.security_ml_analytics_settings.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- settings_resource_name="myFirstAnomalySettings",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ settings_resource_name='myFirstAnomalySettings',
)
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/preview/2024-04-01-preview/examples/securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.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/settings/delete_eyes_on_setting.py
similarity index 85%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_eyes_on_setting.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/settings/delete_eyes_on_setting.py
index 599eaa20379e..50451fbd1874 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/delete_eyes_on_setting.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/settings/delete_eyes_on_setting.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- settings_name="EyesOn",
+ client.product_settings.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ settings_name='EyesOn',
)
- 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/preview/2024-04-01-preview/examples/settings/DeleteEyesOnSetting.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/settings/get_all_settings.py
similarity index 88%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_settings.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/settings/get_all_settings.py
index 9686f64f3e57..d0ce4fe2440a 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_all_settings.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/settings/get_all_settings.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,12 +28,12 @@ def main():
)
response = client.product_settings.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
)
- print(response)
-
+ for item in response:
+ print(item)
-# 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/preview/2024-04-01-preview/examples/settings/GetAllSettings.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/settings/get_eyes_on_setting.py
similarity index 89%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_eyes_on_setting.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/settings/get_eyes_on_setting.py
index 631125a81101..b01339353e96 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/get_eyes_on_setting.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/settings/get_eyes_on_setting.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.product_settings.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- settings_name="EyesOn",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ settings_name='EyesOn',
)
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/preview/2024-04-01-preview/examples/settings/GetEyesOnSetting.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/settings/update_eyes_on_setting.py
similarity index 83%
rename from sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/update_eyes_on_setting.py
rename to sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/settings/update_eyes_on_setting.py
index 9f10f20bb113..694ae3b122f5 100644
--- a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/update_eyes_on_setting.py
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/settings/update_eyes_on_setting.py
@@ -7,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
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": {}},
+ 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
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/settings/UpdateEyesOnSetting.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/create_source_control.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/create_source_control.py
new file mode 100644
index 000000000000..cac130e40225
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/sourcecontrols/create_source_control.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_source_control.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.source_controls.create(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ source_control_id='789e0c1f-4a3d-43ad-809c-e713b677b04a',
+ source_control={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'properties': {'contentTypes': ['AnalyticRules', 'Workbook'], 'description': 'This is a source control', 'displayName': 'My Source Control', 'repoType': 'Github', 'repository': {'branch': 'master', 'displayUrl': 'https://github.com/user/repo', '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/2024-04-01-preview/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 79%
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..ab71fdf327d8 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,13 @@ def main():
)
response = client.source_controls.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- source_control_id="789e0c1f-4a3d-43ad-809c-e713b677b04a",
+ 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/preview/2024-04-01-preview/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 87%
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..7d8cbea35825 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.source_controls.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- source_control_id="789e0c1f-4a3d-43ad-809c-e713b677b04a",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ source_control_id='789e0c1f-4a3d-43ad-809c-e713b677b04a',
)
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/preview/2024-04-01-preview/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 91%
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..9bb3cc3cd561 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.source_controls.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/sourcecontrols/GetSourceControls.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 91%
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..907625842b62 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,12 +28,11 @@ def main():
)
response = client.threat_intelligence_indicator_metrics.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
)
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/preview/2024-04-01-preview/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 83%
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..597b01ebce81 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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.threat_intelligence_indicator.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- name="d9cd6f0b-96b9-3984-17cd-a779d1e15a93",
+ 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/preview/2024-04-01-preview/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 91%
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..9a8fa4d2922d 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.threat_intelligence_indicators.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/threatintelligence/GetThreatIntelligence.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 88%
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..3e14f1b8e2f6 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.threat_intelligence_indicator.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- name="e16ef847-962e-d7b6-9c8b-a33e4bd30e47",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ name='e16ef847-962e-d7b6-9c8b-a33e4bd30e47',
)
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/preview/2024-04-01-preview/examples/threatintelligence/GetThreatIntelligenceById.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/post_threat_intelligence_count.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/post_threat_intelligence_count.py
new file mode 100644
index 000000000000..aae8b7445bfc
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/post_threat_intelligence_count.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python post_threat_intelligence_count.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.threat_intelligence.count(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ ti_type='main',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/PostThreatIntelligenceCount.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/post_threat_intelligence_query.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/post_threat_intelligence_query.py
new file mode 100644
index 000000000000..0d899550554d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/threatintelligence/post_threat_intelligence_query.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python post_threat_intelligence_query.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.threat_intelligence.query(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ ti_type='main',
+ )
+ for item in response:
+ print(item)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/threatintelligence/PostThreatIntelligenceQuery.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/triggered_analytics_rule_runs/trigger_rule_run_post.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/triggered_analytics_rule_runs/trigger_rule_run_post.py
new file mode 100644
index 000000000000..d97278d84785
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/triggered_analytics_rule_runs/trigger_rule_run_post.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python trigger_rule_run_post.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",
+ )
+
+ client.alert_rule.begin_trigger_rule_run(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ rule_id='65360bb0-8986-4ade-a89d-af3cf44d28aa',
+ analytics_rule_run_trigger_parameter={'properties': {'executionTimeUtc': '2022-12-22T15:37:03.074Z'}},
+ ).result()
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/triggeredAnalyticsRuleRuns/triggerRuleRun_Post.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/triggered_analytics_rule_runs/triggered_analytics_rule_run_get.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/triggered_analytics_rule_runs/triggered_analytics_rule_run_get.py
new file mode 100644
index 000000000000..30e246318678
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/triggered_analytics_rule_runs/triggered_analytics_rule_run_get.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python triggered_analytics_rule_run_get.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.triggered_analytics_rule_run.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ rule_run_id='65360bb0-8986-4ade-a89d-af3cf44d28aa',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/triggeredAnalyticsRuleRuns/triggeredAnalyticsRuleRun_Get.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/triggered_analytics_rule_runs/triggered_analytics_rule_runs_get.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/triggered_analytics_rule_runs/triggered_analytics_rule_runs_get.py
new file mode 100644
index 000000000000..542dd8eb57bf
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/triggered_analytics_rule_runs/triggered_analytics_rule_runs_get.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python triggered_analytics_rule_runs_get.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_triggered_analytics_rule_runs.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/2024-04-01-preview/examples/triggeredAnalyticsRuleRuns/triggeredAnalyticsRuleRuns_Get.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 67%
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..788de934f1b0 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,33 +21,20 @@
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.watchlists.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- watchlist_alias="highValueAsset",
- watchlist={
- "etag": '"0300bf09-0000-0000-0000-5c37296e0000"',
- "properties": {
- "description": "Watchlist from CSV content",
- "displayName": "High Value Assets Watchlist",
- "itemsSearchKey": "header1",
- "provider": "Microsoft",
- "source": "watchlist.csv",
- "sourceType": "Local file",
- },
- },
- )
+ response = client.watchlists.begin_create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ watchlist_alias='highValueAsset',
+ watchlist={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'properties': {'description': 'Watchlist from CSV content', 'displayName': 'High Value Assets Watchlist', 'itemsSearchKey': 'header1', 'provider': 'Microsoft', 'source': 'watchlist.csv', '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/preview/2024-04-01-preview/examples/watchlists/CreateWatchlist.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist_and_watchlist_items.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist_and_watchlist_items.py
new file mode 100644
index 000000000000..4ccf5172a362
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/watchlists/create_watchlist_and_watchlist_items.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_watchlist_and_watchlist_items.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.watchlists.begin_create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ watchlist_alias='highValueAsset',
+ watchlist={'etag': '"0300bf09-0000-0000-0000-5c37296e0000"', 'properties': {'contentType': 'text/csv', 'description': 'Watchlist from CSV content', 'displayName': 'High Value Assets Watchlist', 'itemsSearchKey': 'header1', 'numberOfLinesToSkip': 1, 'provider': 'Microsoft', 'rawContent': 'This line will be skipped\nheader1,header2\nvalue1,value2', 'source': 'watchlist.csv', 'sourceType': 'Local file'}},
+ ).result()
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/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 66%
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..353982d716b9 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,27 +28,14 @@ def main():
)
response = client.watchlist_items.create_or_update(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- watchlist_alias="highValueAsset",
- watchlist_item_id="82ba292c-dc97-4dfc-969d-d4dd9e666842",
- watchlist_item={
- "etag": "0300bf09-0000-0000-0000-5c37296e0000",
- "properties": {
- "itemsKeyValue": {
- "Business tier": "10.0.2.0/24",
- "Data tier": "10.0.2.0/24",
- "Gateway subnet": "10.0.255.224/27",
- "Private DMZ in": "10.0.0.0/27",
- "Public DMZ out": "10.0.0.96/27",
- "Web Tier": "10.0.1.0/24",
- }
- },
- },
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ watchlist_alias='highValueAsset',
+ watchlist_item_id='82ba292c-dc97-4dfc-969d-d4dd9e666842',
+ watchlist_item={'etag': '0300bf09-0000-0000-0000-5c37296e0000', 'properties': {'itemsKeyValue': {'Business tier': '10.0.2.0/24', 'Data tier': '10.0.2.0/24', 'Gateway subnet': '10.0.255.224/27', 'Private DMZ in': '10.0.0.0/27', 'Public DMZ out': '10.0.0.96/27', 'Web Tier': '10.0.1.0/24'}}},
)
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/preview/2024-04-01-preview/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 84%
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..04b25d2e16cf 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,22 +21,18 @@
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.watchlists.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- watchlist_alias="highValueAsset",
- )
- print(response)
-
+ client.watchlists.begin_delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ watchlist_alias='highValueAsset',
+ ).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/preview/2024-04-01-preview/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 81%
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..ea0f28a7709e 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,23 +21,19 @@
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.watchlist_items.delete(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- watchlist_alias="highValueAsset",
- watchlist_item_id="4008512e-1d30-48b2-9ee2-d3612ed9d3ea",
+ 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/preview/2024-04-01-preview/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 88%
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..251a73b5e8d9 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.watchlists.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- watchlist_alias="highValueAsset",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ watchlist_alias='highValueAsset',
)
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/preview/2024-04-01-preview/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 85%
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..d1cd93afbca5 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.watchlist_items.get(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- watchlist_alias="highValueAsset",
- watchlist_item_id="3f8901fe-63d9-4875-9ad5-9fb3b8105797",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ watchlist_alias='highValueAsset',
+ watchlist_item_id='3f8901fe-63d9-4875-9ad5-9fb3b8105797',
)
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/preview/2024-04-01-preview/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 88%
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..b7da2ee5ae79 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,14 +28,13 @@ def main():
)
response = client.watchlist_items.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
- watchlist_alias="highValueAsset",
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ watchlist_alias='highValueAsset',
)
for item in response:
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/preview/2024-04-01-preview/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 91%
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..982df2d4ef28 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,8 +7,8 @@
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
-from azure.mgmt.securityinsight import SecurityInsights
+from azure.mgmt.securityinsight import SecurityInsights
"""
# PREREQUISITES
pip install azure-identity
@@ -21,8 +21,6 @@
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(),
@@ -30,13 +28,12 @@ def main():
)
response = client.watchlists.list(
- resource_group_name="myRg",
- workspace_name="myWorkspace",
+ 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/watchlists/GetWatchlists.json
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/watchlists/GetWatchlists.json
if __name__ == "__main__":
main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/create_job.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/create_job.py
new file mode 100644
index 000000000000..d304cfa0a3e9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/create_job.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_job.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.workspace_manager_assignment_jobs.create(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_assignment_name='47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerAssignments/CreateJob.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/create_or_update_workspace_manager_assignment.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/create_or_update_workspace_manager_assignment.py
new file mode 100644
index 000000000000..dde408e07b30
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/create_or_update_workspace_manager_assignment.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_or_update_workspace_manager_assignment.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.workspace_manager_assignments.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_assignment_name='47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58',
+ workspace_manager_assignment={'properties': {'items': [{'resourceId': '/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspac-es/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/microsoftSecurityIncidentCreationRuleExampleOne'}, {'resourceId': '/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspac-es/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/microsoftSecurityIncidentCreationRuleExampleTwo'}], 'targetResourceName': '37207a7a-3b8a-438f-a559-c7df400e1b96'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerAssignments/CreateOrUpdateWorkspaceManagerAssignment.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/delete_job.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/delete_job.py
new file mode 100644
index 000000000000..5bdd8194a65c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/delete_job.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python delete_job.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",
+ )
+
+ client.workspace_manager_assignment_jobs.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_assignment_name='47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58',
+ job_name='cfbe1338-8276-4d5d-8b96-931117f9fa0e',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerAssignments/DeleteJob.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/delete_workspace_manager_assignment.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/delete_workspace_manager_assignment.py
new file mode 100644
index 000000000000..236c2040d1fb
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/delete_workspace_manager_assignment.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_workspace_manager_assignment.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",
+ )
+
+ client.workspace_manager_assignments.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_assignment_name='47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerAssignments/DeleteWorkspaceManagerAssignment.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_all_jobs.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_all_jobs.py
new file mode 100644
index 000000000000..f43cd2f674fa
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_all_jobs.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.
+# --------------------------------------------------------------------------
+
+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_jobs.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.workspace_manager_assignment_jobs.list(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_assignment_name='47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58',
+ )
+ for item in response:
+ print(item)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerAssignments/GetAllJobs.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_all_workspace_manager_assignments.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_all_workspace_manager_assignments.py
new file mode 100644
index 000000000000..b48f1ae3cd29
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_all_workspace_manager_assignments.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.
+# --------------------------------------------------------------------------
+
+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_workspace_manager_assignments.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.workspace_manager_assignments.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/2024-04-01-preview/examples/workspaceManagerAssignments/GetAllWorkspaceManagerAssignments.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_job.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_job.py
new file mode 100644
index 000000000000..c06dcace0857
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_job.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_job.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.workspace_manager_assignment_jobs.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_assignment_name='47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58',
+ job_name='cfbe1338-8276-4d5d-8b96-931117f9fa0e',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerAssignments/GetJob.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_workspace_manager_assignment.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_workspace_manager_assignment.py
new file mode 100644
index 000000000000..f283827b94bf
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_assignments/get_workspace_manager_assignment.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_workspace_manager_assignment.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.workspace_manager_assignments.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_assignment_name='47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerAssignments/GetWorkspaceManagerAssignment.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/create_or_update_workspace_manager_configuration.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/create_or_update_workspace_manager_configuration.py
new file mode 100644
index 000000000000..d8dfc7364b3d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/create_or_update_workspace_manager_configuration.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_or_update_workspace_manager_configuration.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.workspace_manager_configurations.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_configuration_name='default',
+ workspace_manager_configuration={'properties': {'mode': 'Enabled'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerConfigurations/CreateOrUpdateWorkspaceManagerConfiguration.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/delete_workspace_manager_configuration.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/delete_workspace_manager_configuration.py
new file mode 100644
index 000000000000..31648fd96f38
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/delete_workspace_manager_configuration.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_workspace_manager_configuration.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",
+ )
+
+ client.workspace_manager_configurations.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_configuration_name='default',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerConfigurations/DeleteWorkspaceManagerConfiguration.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/get_all_workspace_manager_configurations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/get_all_workspace_manager_configurations.py
new file mode 100644
index 000000000000..33431f6978d8
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/get_all_workspace_manager_configurations.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.
+# --------------------------------------------------------------------------
+
+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_workspace_manager_configurations.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.workspace_manager_configurations.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/2024-04-01-preview/examples/workspaceManagerConfigurations/GetAllWorkspaceManagerConfigurations.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/get_workspace_manager_configuration.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/get_workspace_manager_configuration.py
new file mode 100644
index 000000000000..e9b658209a26
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_configurations/get_workspace_manager_configuration.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_workspace_manager_configuration.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.workspace_manager_configurations.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_configuration_name='default',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerConfigurations/GetWorkspaceManagerConfiguration.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/create_or_update_workspace_manager_group.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/create_or_update_workspace_manager_group.py
new file mode 100644
index 000000000000..e59eef68c5de
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/create_or_update_workspace_manager_group.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_or_update_workspace_manager_group.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.workspace_manager_groups.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_group_name='37207a7a-3b8a-438f-a559-c7df400e1b96',
+ workspace_manager_group={'properties': {'description': 'Group of all financial and banking institutions', 'displayName': 'Banks', 'memberResourceNames': ['afbd324f-6c48-459c-8710-8d1e1cd03812', 'f5fa104e-c0e3-4747-9182-d342dc048a9e']}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerGroups/CreateOrUpdateWorkspaceManagerGroup.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/delete_workspace_manager_group.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/delete_workspace_manager_group.py
new file mode 100644
index 000000000000..87547b68f241
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/delete_workspace_manager_group.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_workspace_manager_group.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",
+ )
+
+ client.workspace_manager_groups.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_group_name='37207a7a-3b8a-438f-a559-c7df400e1b96',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerGroups/DeleteWorkspaceManagerGroup.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/get_all_workspace_manager_groups.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/get_all_workspace_manager_groups.py
new file mode 100644
index 000000000000..8897327a9147
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/get_all_workspace_manager_groups.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.
+# --------------------------------------------------------------------------
+
+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_workspace_manager_groups.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.workspace_manager_groups.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/2024-04-01-preview/examples/workspaceManagerGroups/GetAllWorkspaceManagerGroups.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/get_workspace_manager_group.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/get_workspace_manager_group.py
new file mode 100644
index 000000000000..d58f43ad17e2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_groups/get_workspace_manager_group.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_workspace_manager_group.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.workspace_manager_groups.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_group_name='37207a7a-3b8a-438f-a559-c7df400e1b96',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerGroups/GetWorkspaceManagerGroup.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/create_or_update_workspace_manager_member.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/create_or_update_workspace_manager_member.py
new file mode 100644
index 000000000000..a51b172e89d2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/create_or_update_workspace_manager_member.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python create_or_update_workspace_manager_member.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.workspace_manager_members.create_or_update(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_member_name='afbd324f-6c48-459c-8710-8d1e1cd03812',
+ workspace_manager_member={'properties': {'targetWorkspaceResourceId': '/subscriptions/7aef9d48-814f-45ad-b644-b0343316e174/resourceGroups/otherRg/providers/Microsoft.OperationalInsights/workspaces/Example_Workspace', 'targetWorkspaceTenantId': 'f676d436-8d16-42db-81b7-ab578e110ccd'}},
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerMembers/CreateOrUpdateWorkspaceManagerMember.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/delete_workspace_manager_member.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/delete_workspace_manager_member.py
new file mode 100644
index 000000000000..abfa6fe40e45
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/delete_workspace_manager_member.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_workspace_manager_member.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",
+ )
+
+ client.workspace_manager_members.delete(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_member_name='afbd324f-6c48-459c-8710-8d1e1cd03812',
+ )
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerMembers/DeleteWorkspaceManagerMember.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/get_all_workspace_manager_members.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/get_all_workspace_manager_members.py
new file mode 100644
index 000000000000..8b50ead562b3
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/get_all_workspace_manager_members.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.
+# --------------------------------------------------------------------------
+
+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_workspace_manager_members.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.workspace_manager_members.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/2024-04-01-preview/examples/workspaceManagerMembers/GetAllWorkspaceManagerMembers.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/get_workspace_manager_member.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/get_workspace_manager_member.py
new file mode 100644
index 000000000000..5c3cdb2513a9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_samples/workspace_manager_members/get_workspace_manager_member.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.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.securityinsight import SecurityInsights
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-securityinsight
+# USAGE
+ python get_workspace_manager_member.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.workspace_manager_members.get(
+ resource_group_name='myRg',
+ workspace_name='myWorkspace',
+ workspace_manager_member_name='afbd324f-6c48-459c-8710-8d1e1cd03812',
+ )
+ print(response)
+
+# x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2024-04-01-preview/examples/workspaceManagerMembers/GetWorkspaceManagerMember.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..bbfa0cd3ff84
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/conftest.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 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()
+
+# aovid 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.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights.py
new file mode 100644
index 000000000000..99411a206fca
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights.py
@@ -0,0 +1,58 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsights(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list_geodata_by_ip(self, resource_group):
+ response = self.client.list_geodata_by_ip(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ enrichment_type="str"
+,
+ ip_address_body={
+ "ipAddress": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list_whois_by_domain(self, resource_group):
+ response = self.client.list_whois_by_domain(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ enrichment_type="str"
+,
+ domain_body={
+ "domain": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
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..6e2909e74a0d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_actions_operations.py
@@ -0,0 +1,105 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..9195ab4a65ce
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_actions_operations_async.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.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_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="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_operations.py
new file mode 100644
index 000000000000..b4b768720ee2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_operations.py
@@ -0,0 +1,38 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsAlertRuleOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_begin_trigger_rule_run(self, resource_group):
+ response = self.client.alert_rule.begin_trigger_rule_run(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ rule_id="str"
+,
+ analytics_rule_run_trigger_parameter={
+ "executionTimeUtc": "2020-02-20 00:00:00"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ ).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_alert_rule_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_operations_async.py
new file mode 100644
index 000000000000..80c759ec0934
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_operations_async.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.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 TestSecurityInsightsAlertRuleOperationsAsync(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_begin_trigger_rule_run(self, resource_group):
+ response = await (await self.client.alert_rule.begin_trigger_rule_run(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ rule_id="str"
+,
+ analytics_rule_run_trigger_parameter={
+ "executionTimeUtc": "2020-02-20 00:00:00"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )).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_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..d9e69b2d40af
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_templates_operations.py
@@ -0,0 +1,48 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.alert_rule_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..79fddee2d17f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rule_templates_operations_async.py
@@ -0,0 +1,49 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.alert_rule_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # 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..1a7a40f6d44d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rules_operations.py
@@ -0,0 +1,139 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.alert_rules.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.alert_rules.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ rule_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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",
+ "scenarioExclusionPatterns": [
+ {
+ "dateAddedInUTC": "str",
+ "exclusionPattern": "str"
+ }
+ ],
+ "severity": "str",
+ "sourceSettings": [
+ {
+ "enabled": bool,
+ "sourceName": "str",
+ "sourceSubTypes": [
+ {
+ "enabled": bool,
+ "severityFilters": {
+ "filters": [
+ {
+ "enabled": bool,
+ "severity": "str"
+ }
+ ],
+ "isSupported": bool
+ },
+ "sourceSubTypeName": "str",
+ "sourceSubTypeDisplayName": "str"
+ }
+ ]
+ }
+ ],
+ "subTechniques": [
+ "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.alert_rules.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ rule_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..66f1bdba4ba3
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_alert_rules_operations_async.py
@@ -0,0 +1,140 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.alert_rules.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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",
+ "scenarioExclusionPatterns": [
+ {
+ "dateAddedInUTC": "str",
+ "exclusionPattern": "str"
+ }
+ ],
+ "severity": "str",
+ "sourceSettings": [
+ {
+ "enabled": bool,
+ "sourceName": "str",
+ "sourceSubTypes": [
+ {
+ "enabled": bool,
+ "severityFilters": {
+ "filters": [
+ {
+ "enabled": bool,
+ "severity": "str"
+ }
+ ],
+ "isSupported": bool
+ },
+ "sourceSubTypeName": "str",
+ "sourceSubTypeDisplayName": "str"
+ }
+ ]
+ }
+ ],
+ "subTechniques": [
+ "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_async.py
new file mode 100644
index 000000000000..4cfbb8babad8
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_async.py
@@ -0,0 +1,59 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsAsync(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_list_geodata_by_ip(self, resource_group):
+ response = await self.client.list_geodata_by_ip(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ enrichment_type="str"
+,
+ ip_address_body={
+ "ipAddress": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_list_whois_by_domain(self, resource_group):
+ response = await self.client.list_whois_by_domain(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ enrichment_type="str"
+,
+ domain_body={
+ "domain": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..79d9ad510869
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_automation_rules_operations.py
@@ -0,0 +1,80 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.automation_rules.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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..c548c598bd99
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_automation_rules_operations_async.py
@@ -0,0 +1,81 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_list(self, resource_group):
+ response = self.client.automation_rules.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_billing_statistics_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_billing_statistics_operations.py
new file mode 100644
index 000000000000..b2ca6b452531
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_billing_statistics_operations.py
@@ -0,0 +1,48 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsBillingStatisticsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.billing_statistics.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.billing_statistics.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ billing_statistic_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_billing_statistics_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_billing_statistics_operations_async.py
new file mode 100644
index 000000000000..a7bd2dd9cbd7
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_billing_statistics_operations_async.py
@@ -0,0 +1,49 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsBillingStatisticsOperationsAsync(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_list(self, resource_group):
+ response = self.client.billing_statistics.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.billing_statistics.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ billing_statistic_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_operations.py
new file mode 100644
index 000000000000..aabb82cc2775
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_operations.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 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 TestSecurityInsightsBookmarkOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_expand(self, resource_group):
+ response = self.client.bookmark.expand(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ parameters={
+ "endTime": "2020-02-20 00:00:00",
+ "expansionId": "str",
+ "startTime": "2020-02-20 00:00:00"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_operations_async.py
new file mode 100644
index 000000000000..fae727370949
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_operations_async.py
@@ -0,0 +1,41 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsBookmarkOperationsAsync(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_expand(self, resource_group):
+ response = await self.client.bookmark.expand(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ parameters={
+ "endTime": "2020-02-20 00:00:00",
+ "expansionId": "str",
+ "startTime": "2020-02-20 00:00:00"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_relations_operations.py
new file mode 100644
index 000000000000..0f90dba8d796
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_relations_operations.py
@@ -0,0 +1,107 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsBookmarkRelationsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.bookmark_relations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.bookmark_relations.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ relation_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.bookmark_relations.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.bookmark_relations.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ relation_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_relations_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_relations_operations_async.py
new file mode 100644
index 000000000000..db185b861539
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmark_relations_operations_async.py
@@ -0,0 +1,108 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsBookmarkRelationsOperationsAsync(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_list(self, resource_group):
+ response = self.client.bookmark_relations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.bookmark_relations.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ relation_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create_or_update(self, resource_group):
+ response = await self.client.bookmark_relations.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.bookmark_relations.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ relation_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..b598130cf58e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmarks_operations.py
@@ -0,0 +1,140 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.bookmarks.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.bookmarks.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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",
+ "entityMappings": [
+ {
+ "entityType": "str",
+ "fieldMappings": [
+ {
+ "identifier": "str",
+ "value": "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"
+ },
+ "tactics": [
+ "str"
+ ],
+ "techniques": [
+ "str"
+ ],
+ "type": "str",
+ "updated": "2020-02-20 00:00:00",
+ "updatedBy": {
+ "email": "str",
+ "name": "str",
+ "objectId": "str"
+ }
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.bookmarks.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..5d2c770fe140
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_bookmarks_operations_async.py
@@ -0,0 +1,141 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.bookmarks.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.bookmarks.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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",
+ "entityMappings": [
+ {
+ "entityType": "str",
+ "fieldMappings": [
+ {
+ "identifier": "str",
+ "value": "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"
+ },
+ "tactics": [
+ "str"
+ ],
+ "techniques": [
+ "str"
+ ],
+ "type": "str",
+ "updated": "2020-02-20 00:00:00",
+ "updatedBy": {
+ "email": "str",
+ "name": "str",
+ "objectId": "str"
+ }
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.bookmarks.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ bookmark_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agent_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agent_operations.py
new file mode 100644
index 000000000000..cc84a34f6e5a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agent_operations.py
@@ -0,0 +1,34 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsBusinessApplicationAgentOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.business_application_agent.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agent_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agent_operations_async.py
new file mode 100644
index 000000000000..b3ebf840486f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agent_operations_async.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 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 TestSecurityInsightsBusinessApplicationAgentOperationsAsync(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_get(self, resource_group):
+ response = await self.client.business_application_agent.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agents_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agents_operations.py
new file mode 100644
index 000000000000..ceab51ad8a26
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agents_operations.py
@@ -0,0 +1,64 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsBusinessApplicationAgentsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.business_application_agents.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.business_application_agents.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.business_application_agents.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_business_application_agents_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agents_operations_async.py
new file mode 100644
index 000000000000..f1f1e49370eb
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_business_application_agents_operations_async.py
@@ -0,0 +1,65 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsBusinessApplicationAgentsOperationsAsync(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_create_or_update(self, resource_group):
+ response = await self.client.business_application_agents.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.business_application_agents.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_list(self, resource_group):
+ response = self.client.business_application_agents.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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..ffda481e4a01
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_package_operations.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 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_uninstall(self, resource_group):
+ response = self.client.content_package.uninstall(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ package_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..0e7815390558
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_package_operations_async.py
@@ -0,0 +1,124 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..39acb95102ff
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_packages_operations.py
@@ -0,0 +1,48 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.content_packages.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.content_packages.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ package_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..68df0ed9d819
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_packages_operations_async.py
@@ -0,0 +1,49 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.content_packages.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # 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..8cfa1d5887af
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_template_operations.py
@@ -0,0 +1,218 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.content_template.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ template_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.content_template.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ template_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..92ddb6024c77
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_template_operations_async.py
@@ -0,0 +1,219 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..5e8daded2dd4
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_templates_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 TestSecurityInsightsContentTemplatesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.content_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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..056c76a04ab0
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_content_templates_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 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_list(self, resource_group):
+ response = self.client.content_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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..478b1fcd5bc1
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connector_definitions_operations.py
@@ -0,0 +1,178 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.data_connector_definitions.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..1b2c3e8d9421
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connector_definitions_operations_async.py
@@ -0,0 +1,179 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.data_connector_definitions.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_check_requirements_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_check_requirements_operations.py
new file mode 100644
index 000000000000..6a6d559d54ca
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_check_requirements_operations.py
@@ -0,0 +1,36 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsDataConnectorsCheckRequirementsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_post(self, resource_group):
+ response = self.client.data_connectors_check_requirements.post(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ data_connectors_check_requirements={
+ "kind": "AmazonWebServicesCloudTrail"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_check_requirements_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_check_requirements_operations_async.py
new file mode 100644
index 000000000000..e3ba14da928b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_check_requirements_operations_async.py
@@ -0,0 +1,37 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsDataConnectorsCheckRequirementsOperationsAsync(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_post(self, resource_group):
+ response = await self.client.data_connectors_check_requirements.post(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ data_connectors_check_requirements={
+ "kind": "AmazonWebServicesCloudTrail"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..6abdd07d0d2c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_operations.py
@@ -0,0 +1,267 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.data_connectors.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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": "APIPolling",
+ "connectorUiConfig": {
+ "availability": {
+ "isPreview": bool,
+ "status": 1
+ },
+ "connectivityCriteria": [
+ {
+ "type": "str",
+ "value": [
+ "str"
+ ]
+ }
+ ],
+ "dataTypes": [
+ {
+ "lastDataReceivedQuery": "str",
+ "name": "str"
+ }
+ ],
+ "descriptionMarkdown": "str",
+ "graphQueries": [
+ {
+ "baseQuery": "str",
+ "legend": "str",
+ "metricName": "str"
+ }
+ ],
+ "graphQueriesTableName": "str",
+ "instructionSteps": [
+ {
+ "description": "str",
+ "instructions": [
+ {
+ "type": "str",
+ "parameters": {}
+ }
+ ],
+ "title": "str"
+ }
+ ],
+ "permissions": {
+ "customs": [
+ {
+ "description": "str",
+ "name": "str"
+ }
+ ],
+ "resourceProvider": [
+ {
+ "permissionsDisplayText": "str",
+ "provider": "str",
+ "providerDisplayName": "str",
+ "requiredPermissions": {
+ "action": bool,
+ "delete": bool,
+ "read": bool,
+ "write": bool
+ },
+ "scope": "str"
+ }
+ ]
+ },
+ "publisher": "str",
+ "sampleQueries": [
+ {
+ "description": "str",
+ "query": "str"
+ }
+ ],
+ "title": "str",
+ "customImage": "str"
+ },
+ "etag": "str",
+ "id": "str",
+ "name": "str",
+ "pollingConfig": {
+ "auth": {
+ "authType": "str",
+ "apiKeyIdentifier": "str",
+ "apiKeyName": "str",
+ "authorizationEndpoint": "str",
+ "authorizationEndpointQueryParameters": {},
+ "flowName": "str",
+ "isApiKeyInPostPayload": "str",
+ "isClientSecretInHeader": bool,
+ "redirectionEndpoint": "str",
+ "scope": "str",
+ "tokenEndpoint": "str",
+ "tokenEndpointHeaders": {},
+ "tokenEndpointQueryParameters": {}
+ },
+ "request": {
+ "apiEndpoint": "str",
+ "httpMethod": "str",
+ "queryTimeFormat": "str",
+ "queryWindowInMin": 0,
+ "endTimeAttributeName": "str",
+ "headers": {},
+ "queryParameters": {},
+ "queryParametersTemplate": "str",
+ "rateLimitQps": 0,
+ "retryCount": 0,
+ "startTimeAttributeName": "str",
+ "timeoutInSeconds": 0
+ },
+ "isActive": bool,
+ "paging": {
+ "pagingType": "str",
+ "nextPageParaName": "str",
+ "nextPageTokenJsonPath": "str",
+ "pageCountAttributePath": "str",
+ "pageSize": 0,
+ "pageSizeParaName": "str",
+ "pageTimeStampAttributePath": "str",
+ "pageTotalCountAttributePath": "str",
+ "searchTheLatestTimeStampFromEventsList": "str"
+ },
+ "response": {
+ "eventsJsonPaths": [
+ "str"
+ ],
+ "isGzipCompressed": bool,
+ "successStatusJsonPath": "str",
+ "successStatusValue": "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_connect(self, resource_group):
+ response = self.client.data_connectors.connect(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ data_connector_id="str"
+,
+ connect_body={
+ "apiKey": "str",
+ "authorizationCode": "str",
+ "clientId": "str",
+ "clientSecret": "str",
+ "dataCollectionEndpoint": "str",
+ "dataCollectionRuleImmutableId": "str",
+ "kind": "str",
+ "outputStream": "str",
+ "password": "str",
+ "requestConfigUserInputValues": [
+ {}
+ ],
+ "userName": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_disconnect(self, resource_group):
+ response = self.client.data_connectors.disconnect(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ data_connector_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..d972598a722b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_data_connectors_operations_async.py
@@ -0,0 +1,268 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.data_connectors.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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": "APIPolling",
+ "connectorUiConfig": {
+ "availability": {
+ "isPreview": bool,
+ "status": 1
+ },
+ "connectivityCriteria": [
+ {
+ "type": "str",
+ "value": [
+ "str"
+ ]
+ }
+ ],
+ "dataTypes": [
+ {
+ "lastDataReceivedQuery": "str",
+ "name": "str"
+ }
+ ],
+ "descriptionMarkdown": "str",
+ "graphQueries": [
+ {
+ "baseQuery": "str",
+ "legend": "str",
+ "metricName": "str"
+ }
+ ],
+ "graphQueriesTableName": "str",
+ "instructionSteps": [
+ {
+ "description": "str",
+ "instructions": [
+ {
+ "type": "str",
+ "parameters": {}
+ }
+ ],
+ "title": "str"
+ }
+ ],
+ "permissions": {
+ "customs": [
+ {
+ "description": "str",
+ "name": "str"
+ }
+ ],
+ "resourceProvider": [
+ {
+ "permissionsDisplayText": "str",
+ "provider": "str",
+ "providerDisplayName": "str",
+ "requiredPermissions": {
+ "action": bool,
+ "delete": bool,
+ "read": bool,
+ "write": bool
+ },
+ "scope": "str"
+ }
+ ]
+ },
+ "publisher": "str",
+ "sampleQueries": [
+ {
+ "description": "str",
+ "query": "str"
+ }
+ ],
+ "title": "str",
+ "customImage": "str"
+ },
+ "etag": "str",
+ "id": "str",
+ "name": "str",
+ "pollingConfig": {
+ "auth": {
+ "authType": "str",
+ "apiKeyIdentifier": "str",
+ "apiKeyName": "str",
+ "authorizationEndpoint": "str",
+ "authorizationEndpointQueryParameters": {},
+ "flowName": "str",
+ "isApiKeyInPostPayload": "str",
+ "isClientSecretInHeader": bool,
+ "redirectionEndpoint": "str",
+ "scope": "str",
+ "tokenEndpoint": "str",
+ "tokenEndpointHeaders": {},
+ "tokenEndpointQueryParameters": {}
+ },
+ "request": {
+ "apiEndpoint": "str",
+ "httpMethod": "str",
+ "queryTimeFormat": "str",
+ "queryWindowInMin": 0,
+ "endTimeAttributeName": "str",
+ "headers": {},
+ "queryParameters": {},
+ "queryParametersTemplate": "str",
+ "rateLimitQps": 0,
+ "retryCount": 0,
+ "startTimeAttributeName": "str",
+ "timeoutInSeconds": 0
+ },
+ "isActive": bool,
+ "paging": {
+ "pagingType": "str",
+ "nextPageParaName": "str",
+ "nextPageTokenJsonPath": "str",
+ "pageCountAttributePath": "str",
+ "pageSize": 0,
+ "pageSizeParaName": "str",
+ "pageTimeStampAttributePath": "str",
+ "pageTotalCountAttributePath": "str",
+ "searchTheLatestTimeStampFromEventsList": "str"
+ },
+ "response": {
+ "eventsJsonPaths": [
+ "str"
+ ],
+ "isGzipCompressed": bool,
+ "successStatusJsonPath": "str",
+ "successStatusValue": "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_connect(self, resource_group):
+ response = await self.client.data_connectors.connect(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ data_connector_id="str"
+,
+ connect_body={
+ "apiKey": "str",
+ "authorizationCode": "str",
+ "clientId": "str",
+ "clientSecret": "str",
+ "dataCollectionEndpoint": "str",
+ "dataCollectionRuleImmutableId": "str",
+ "kind": "str",
+ "outputStream": "str",
+ "password": "str",
+ "requestConfigUserInputValues": [
+ {}
+ ],
+ "userName": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_disconnect(self, resource_group):
+ response = await self.client.data_connectors.disconnect(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ data_connector_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_get_timeline_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_get_timeline_operations.py
new file mode 100644
index 000000000000..fafcdaa30eac
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_get_timeline_operations.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.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsEntitiesGetTimelineOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.entities_get_timeline.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ parameters={
+ "endTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "kinds": [
+ "str"
+ ],
+ "numberOfBucket": 0
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_get_timeline_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_get_timeline_operations_async.py
new file mode 100644
index 000000000000..446d46d0c28d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_get_timeline_operations_async.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.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 TestSecurityInsightsEntitiesGetTimelineOperationsAsync(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_list(self, resource_group):
+ response = await self.client.entities_get_timeline.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ parameters={
+ "endTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "kinds": [
+ "str"
+ ],
+ "numberOfBucket": 0
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..4f5741b3d7f6
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_operations.py
@@ -0,0 +1,129 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.entities.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.entities.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_expand(self, resource_group):
+ response = self.client.entities.expand(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ parameters={
+ "endTime": "2020-02-20 00:00:00",
+ "expansionId": "str",
+ "startTime": "2020-02-20 00:00:00"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_queries(self, resource_group):
+ response = self.client.entities.queries(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ kind="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get_insights(self, resource_group):
+ response = self.client.entities.get_insights(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ parameters={
+ "endTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "addDefaultExtendedTimeRange": bool,
+ "insightQueryIds": [
+ "str"
+ ]
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..6f9de5164195
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_operations_async.py
@@ -0,0 +1,130 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_list(self, resource_group):
+ response = self.client.entities.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.entities.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_expand(self, resource_group):
+ response = await self.client.entities.expand(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ parameters={
+ "endTime": "2020-02-20 00:00:00",
+ "expansionId": "str",
+ "startTime": "2020-02-20 00:00:00"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_queries(self, resource_group):
+ response = self.client.entities.queries(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ kind="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get_insights(self, resource_group):
+ response = await self.client.entities.get_insights(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ parameters={
+ "endTime": "2020-02-20 00:00:00",
+ "startTime": "2020-02-20 00:00:00",
+ "addDefaultExtendedTimeRange": bool,
+ "insightQueryIds": [
+ "str"
+ ]
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_relations_operations.py
new file mode 100644
index 000000000000..b3b3cd76579f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_relations_operations.py
@@ -0,0 +1,34 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsEntitiesRelationsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.entities_relations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_entities_relations_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_relations_operations_async.py
new file mode 100644
index 000000000000..c5e63f0df0cc
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entities_relations_operations_async.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 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 TestSecurityInsightsEntitiesRelationsOperationsAsync(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_list(self, resource_group):
+ response = self.client.entities_relations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_entity_queries_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_queries_operations.py
new file mode 100644
index 000000000000..ab7d3568fbe2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_queries_operations.py
@@ -0,0 +1,117 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsEntityQueriesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.entity_queries.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.entity_queries.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_query_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.entity_queries.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_query_id="str"
+,
+ entity_query={
+ "kind": "Activity",
+ "content": "str",
+ "createdTimeUtc": "2020-02-20 00:00:00",
+ "description": "str",
+ "enabled": bool,
+ "entitiesFilter": {
+ "str": [
+ "str"
+ ]
+ },
+ "etag": "str",
+ "id": "str",
+ "inputEntityType": "str",
+ "lastModifiedTimeUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "queryDefinitions": {
+ "query": "str"
+ },
+ "requiredInputFieldsSets": [
+ [
+ "str"
+ ]
+ ],
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str"
+ },
+ "templateName": "str",
+ "title": "str",
+ "type": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.entity_queries.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_query_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_queries_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_queries_operations_async.py
new file mode 100644
index 000000000000..4fb1c7126655
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_queries_operations_async.py
@@ -0,0 +1,118 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsEntityQueriesOperationsAsync(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_list(self, resource_group):
+ response = self.client.entity_queries.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.entity_queries.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_query_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create_or_update(self, resource_group):
+ response = await self.client.entity_queries.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_query_id="str"
+,
+ entity_query={
+ "kind": "Activity",
+ "content": "str",
+ "createdTimeUtc": "2020-02-20 00:00:00",
+ "description": "str",
+ "enabled": bool,
+ "entitiesFilter": {
+ "str": [
+ "str"
+ ]
+ },
+ "etag": "str",
+ "id": "str",
+ "inputEntityType": "str",
+ "lastModifiedTimeUtc": "2020-02-20 00:00:00",
+ "name": "str",
+ "queryDefinitions": {
+ "query": "str"
+ },
+ "requiredInputFieldsSets": [
+ [
+ "str"
+ ]
+ ],
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str"
+ },
+ "templateName": "str",
+ "title": "str",
+ "type": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.entity_queries.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_query_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_query_templates_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_query_templates_operations.py
new file mode 100644
index 000000000000..5572170fe3b9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_query_templates_operations.py
@@ -0,0 +1,48 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsEntityQueryTemplatesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.entity_query_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.entity_query_templates.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_query_template_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_query_templates_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_query_templates_operations_async.py
new file mode 100644
index 000000000000..f885464ad7e3
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_query_templates_operations_async.py
@@ -0,0 +1,49 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsEntityQueryTemplatesOperationsAsync(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_list(self, resource_group):
+ response = self.client.entity_query_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.entity_query_templates.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_query_template_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_relations_operations.py
new file mode 100644
index 000000000000..0570e5fbea57
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_relations_operations.py
@@ -0,0 +1,36 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsEntityRelationsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get_relation(self, resource_group):
+ response = self.client.entity_relations.get_relation(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ relation_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_relations_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_relations_operations_async.py
new file mode 100644
index 000000000000..7a41efdd5d2a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_entity_relations_operations_async.py
@@ -0,0 +1,37 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsEntityRelationsOperationsAsync(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_get_relation(self, resource_group):
+ response = await self.client.entity_relations.get_relation(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ entity_id="str"
+,
+ relation_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_file_imports_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_file_imports_operations.py
new file mode 100644
index 000000000000..7f40889ac20c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_file_imports_operations.py
@@ -0,0 +1,126 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsFileImportsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.file_imports.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.file_imports.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ file_import_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create(self, resource_group):
+ response = self.client.file_imports.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ file_import_id="str"
+,
+ file_import={
+ "contentType": "str",
+ "createdTimeUTC": "2020-02-20 00:00:00",
+ "errorFile": {
+ "deleteStatus": "str",
+ "fileContentUri": "str",
+ "fileFormat": "str",
+ "fileName": "str",
+ "fileSize": 0
+ },
+ "errorsPreview": [
+ {
+ "errorMessages": [
+ "str"
+ ],
+ "recordIndex": 0
+ }
+ ],
+ "filesValidUntilTimeUTC": "2020-02-20 00:00:00",
+ "id": "str",
+ "importFile": {
+ "deleteStatus": "str",
+ "fileContentUri": "str",
+ "fileFormat": "str",
+ "fileName": "str",
+ "fileSize": 0
+ },
+ "importValidUntilTimeUTC": "2020-02-20 00:00:00",
+ "ingestedRecordCount": 0,
+ "ingestionMode": "str",
+ "name": "str",
+ "source": "str",
+ "state": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str"
+ },
+ "totalRecordCount": 0,
+ "type": "str",
+ "validRecordCount": 0
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_begin_delete(self, resource_group):
+ response = self.client.file_imports.begin_delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ file_import_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ ).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_file_imports_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_file_imports_operations_async.py
new file mode 100644
index 000000000000..491bfa1ddab4
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_file_imports_operations_async.py
@@ -0,0 +1,127 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsFileImportsOperationsAsync(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_list(self, resource_group):
+ response = self.client.file_imports.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.file_imports.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ file_import_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create(self, resource_group):
+ response = await self.client.file_imports.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ file_import_id="str"
+,
+ file_import={
+ "contentType": "str",
+ "createdTimeUTC": "2020-02-20 00:00:00",
+ "errorFile": {
+ "deleteStatus": "str",
+ "fileContentUri": "str",
+ "fileFormat": "str",
+ "fileName": "str",
+ "fileSize": 0
+ },
+ "errorsPreview": [
+ {
+ "errorMessages": [
+ "str"
+ ],
+ "recordIndex": 0
+ }
+ ],
+ "filesValidUntilTimeUTC": "2020-02-20 00:00:00",
+ "id": "str",
+ "importFile": {
+ "deleteStatus": "str",
+ "fileContentUri": "str",
+ "fileFormat": "str",
+ "fileName": "str",
+ "fileSize": 0
+ },
+ "importValidUntilTimeUTC": "2020-02-20 00:00:00",
+ "ingestedRecordCount": 0,
+ "ingestionMode": "str",
+ "name": "str",
+ "source": "str",
+ "state": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str"
+ },
+ "totalRecordCount": 0,
+ "type": "str",
+ "validRecordCount": 0
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_begin_delete(self, resource_group):
+ response = await (await self.client.file_imports.begin_delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ file_import_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )).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_get_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_operations.py
new file mode 100644
index 000000000000..0f37a876eaac
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_operations.py
@@ -0,0 +1,34 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsGetOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_single_recommendation(self, resource_group):
+ response = self.client.get.single_recommendation(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ recommendation_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_operations_async.py
new file mode 100644
index 000000000000..597b1cdc7948
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_operations_async.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 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 TestSecurityInsightsGetOperationsAsync(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_single_recommendation(self, resource_group):
+ response = await self.client.get.single_recommendation(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ recommendation_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_recommendations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_recommendations_operations.py
new file mode 100644
index 000000000000..94c7635848e1
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_recommendations_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 TestSecurityInsightsGetRecommendationsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.get_recommendations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get_recommendations_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_recommendations_operations_async.py
new file mode 100644
index 000000000000..73a5cc4299c1
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_recommendations_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 TestSecurityInsightsGetRecommendationsOperationsAsync(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_list(self, resource_group):
+ response = self.client.get_recommendations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get_triggered_analytics_rule_runs_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_triggered_analytics_rule_runs_operations.py
new file mode 100644
index 000000000000..ba42939366b3
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_triggered_analytics_rule_runs_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 TestSecurityInsightsGetTriggeredAnalyticsRuleRunsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.get_triggered_analytics_rule_runs.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get_triggered_analytics_rule_runs_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_triggered_analytics_rule_runs_operations_async.py
new file mode 100644
index 000000000000..d25f4c279d95
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_get_triggered_analytics_rule_runs_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 TestSecurityInsightsGetTriggeredAnalyticsRuleRunsOperationsAsync(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_list(self, resource_group):
+ response = self.client.get_triggered_analytics_rule_runs.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_hunt_comments_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_comments_operations.py
new file mode 100644
index 000000000000..e3e87a54dec6
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_comments_operations.py
@@ -0,0 +1,104 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsHuntCommentsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.hunt_comments.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.hunt_comments.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_comment_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.hunt_comments.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_comment_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.hunt_comments.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_comment_id="str"
+,
+ hunt_comment={
+ "etag": "str",
+ "id": "str",
+ "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_comments_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_comments_operations_async.py
new file mode 100644
index 000000000000..7a915fc8f3f0
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_comments_operations_async.py
@@ -0,0 +1,105 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsHuntCommentsOperationsAsync(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_list(self, resource_group):
+ response = self.client.hunt_comments.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.hunt_comments.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_comment_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.hunt_comments.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_comment_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create_or_update(self, resource_group):
+ response = await self.client.hunt_comments.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_comment_id="str"
+,
+ hunt_comment={
+ "etag": "str",
+ "id": "str",
+ "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_relations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_relations_operations.py
new file mode 100644
index 000000000000..067b63542307
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_relations_operations.py
@@ -0,0 +1,110 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsHuntRelationsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.hunt_relations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.hunt_relations.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_relation_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.hunt_relations.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_relation_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.hunt_relations.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_relation_id="str"
+,
+ hunt_relation={
+ "etag": "str",
+ "id": "str",
+ "labels": [
+ "str"
+ ],
+ "name": "str",
+ "relatedResourceId": "str",
+ "relatedResourceKind": "str",
+ "relatedResourceName": "str",
+ "relationType": "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_relations_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_relations_operations_async.py
new file mode 100644
index 000000000000..36356985beb2
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunt_relations_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 TestSecurityInsightsHuntRelationsOperationsAsync(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_list(self, resource_group):
+ response = self.client.hunt_relations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.hunt_relations.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_relation_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.hunt_relations.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_relation_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create_or_update(self, resource_group):
+ response = await self.client.hunt_relations.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt_relation_id="str"
+,
+ hunt_relation={
+ "etag": "str",
+ "id": "str",
+ "labels": [
+ "str"
+ ],
+ "name": "str",
+ "relatedResourceId": "str",
+ "relatedResourceKind": "str",
+ "relatedResourceName": "str",
+ "relationType": "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunts_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunts_operations.py
new file mode 100644
index 000000000000..ad7fd0ca94ee
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunts_operations.py
@@ -0,0 +1,115 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsHuntsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.hunts.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.hunts.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.hunts.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.hunts.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt={
+ "attackTactics": [
+ "str"
+ ],
+ "attackTechniques": [
+ "str"
+ ],
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "hypothesisStatus": "Unknown",
+ "id": "str",
+ "labels": [
+ "str"
+ ],
+ "name": "str",
+ "owner": {
+ "assignedTo": "str",
+ "email": "str",
+ "objectId": "str",
+ "ownerType": "str",
+ "userPrincipalName": "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"
+ },
+ "type": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunts_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunts_operations_async.py
new file mode 100644
index 000000000000..d534c18f6ad5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_hunts_operations_async.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.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsHuntsOperationsAsync(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_list(self, resource_group):
+ response = self.client.hunts.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.hunts.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.hunts.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create_or_update(self, resource_group):
+ response = await self.client.hunts.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ hunt_id="str"
+,
+ hunt={
+ "attackTactics": [
+ "str"
+ ],
+ "attackTechniques": [
+ "str"
+ ],
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "hypothesisStatus": "Unknown",
+ "id": "str",
+ "labels": [
+ "str"
+ ],
+ "name": "str",
+ "owner": {
+ "assignedTo": "str",
+ "email": "str",
+ "objectId": "str",
+ "ownerType": "str",
+ "userPrincipalName": "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"
+ },
+ "type": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..f798b8ed7044
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_comments_operations.py
@@ -0,0 +1,112 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.incident_comments.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..5a512c579acb
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_comments_operations_async.py
@@ -0,0 +1,113 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.incident_comments.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..ddad1a8ba62a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_relations_operations.py
@@ -0,0 +1,107 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.incident_relations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..ba72f4de99c8
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_relations_operations_async.py
@@ -0,0 +1,108 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.incident_relations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..4467a1d14fb8
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_tasks_operations.py
@@ -0,0 +1,120 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.incident_tasks.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..1ee156f20a90
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incident_tasks_operations_async.py
@@ -0,0 +1,121 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.incident_tasks.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..4a59ecbfbf5e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incidents_operations.py
@@ -0,0 +1,236 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.incidents.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.incidents.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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"
+ ],
+ "techniques": [
+ "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"
+ },
+ "teamInformation": {
+ "description": "str",
+ "name": "str",
+ "primaryChannelUrl": "str",
+ "teamCreationTimeUtc": "2020-02-20 00:00:00",
+ "teamId": "str"
+ },
+ "title": "str",
+ "type": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.incidents.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_team(self, resource_group):
+ response = self.client.incidents.create_team(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ team_properties={
+ "description": "str",
+ "name": "str",
+ "primaryChannelUrl": "str",
+ "teamCreationTimeUtc": "2020-02-20 00:00:00",
+ "teamId": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..7d87d2789c91
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_incidents_operations_async.py
@@ -0,0 +1,237 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_list(self, resource_group):
+ response = self.client.incidents.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.incidents.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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"
+ ],
+ "techniques": [
+ "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"
+ },
+ "teamInformation": {
+ "description": "str",
+ "name": "str",
+ "primaryChannelUrl": "str",
+ "teamCreationTimeUtc": "2020-02-20 00:00:00",
+ "teamId": "str"
+ },
+ "title": "str",
+ "type": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.incidents.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create_team(self, resource_group):
+ response = await self.client.incidents.create_team(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ incident_id="str"
+,
+ team_properties={
+ "description": "str",
+ "name": "str",
+ "primaryChannelUrl": "str",
+ "teamCreationTimeUtc": "2020-02-20 00:00:00",
+ "teamId": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..51f3e7e92ab7
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_metadata_operations.py
@@ -0,0 +1,242 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.metadata.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.metadata.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ metadata_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.metadata.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ metadata_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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"
+ },
+ "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="2024-04-01-preview"
+,
+ )
+
+ # 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..3df978a30540
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_metadata_operations_async.py
@@ -0,0 +1,243 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.metadata.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.metadata.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ metadata_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.metadata.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ metadata_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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"
+ },
+ "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_office_consents_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_office_consents_operations.py
new file mode 100644
index 000000000000..2021ba8e21b0
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_office_consents_operations.py
@@ -0,0 +1,64 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsOfficeConsentsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.office_consents.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.office_consents.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ consent_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.office_consents.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ consent_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_office_consents_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_office_consents_operations_async.py
new file mode 100644
index 000000000000..5495b4567627
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_office_consents_operations_async.py
@@ -0,0 +1,65 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsOfficeConsentsOperationsAsync(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_list(self, resource_group):
+ response = self.client.office_consents.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.office_consents.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ consent_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.office_consents.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ consent_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..a30da8b56808
--- /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_list(self, resource_group):
+ response = self.client.operations.list(
+ api_version="2024-04-01-preview"
+,
+ )
+ 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..4dc0a0d80c75
--- /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_list(self, resource_group):
+ response = self.client.operations.list(
+ api_version="2024-04-01-preview"
+,
+ )
+ 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..2fcdbb051f28
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_package_operations.py
@@ -0,0 +1,34 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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_get(self, resource_group):
+ response = self.client.product_package.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ package_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..f072f399677f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_package_operations_async.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 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_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="2024-04-01-preview"
+,
+ )
+
+ # 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..188e1e8869e5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_packages_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 TestSecurityInsightsProductPackagesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.product_packages.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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..a4f33b2cb73c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_packages_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 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_list(self, resource_group):
+ response = self.client.product_packages.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_settings_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_settings_operations.py
new file mode 100644
index 000000000000..5b94bdab3b02
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_settings_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 TestSecurityInsightsProductSettingsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.product_settings.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.product_settings.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ settings_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.product_settings.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ settings_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_update(self, resource_group):
+ response = self.client.product_settings.update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ settings_name="str"
+,
+ settings={
+ "kind": "Anomalies",
+ "etag": "str",
+ "id": "str",
+ "isEnabled": bool,
+ "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_settings_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_settings_operations_async.py
new file mode 100644
index 000000000000..d2729fabc607
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_settings_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 TestSecurityInsightsProductSettingsOperationsAsync(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_list(self, resource_group):
+ response = self.client.product_settings.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.product_settings.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ settings_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.product_settings.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ settings_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_update(self, resource_group):
+ response = await self.client.product_settings.update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ settings_name="str"
+,
+ settings={
+ "kind": "Anomalies",
+ "etag": "str",
+ "id": "str",
+ "isEnabled": bool,
+ "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="2024-04-01-preview"
+,
+ )
+
+ # 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..3d7c3a5d6984
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_template_operations.py
@@ -0,0 +1,34 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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_get(self, resource_group):
+ response = self.client.product_template.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ template_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..33e539fdae64
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_template_operations_async.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 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_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="2024-04-01-preview"
+,
+ )
+
+ # 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..58857b1b803e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_templates_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 TestSecurityInsightsProductTemplatesOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.product_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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..da956f883e3f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_product_templates_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 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_list(self, resource_group):
+ response = self.client.product_templates.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_reevaluate_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_reevaluate_operations.py
new file mode 100644
index 000000000000..247c9b121626
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_reevaluate_operations.py
@@ -0,0 +1,34 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsReevaluateOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_recommendation(self, resource_group):
+ response = self.client.reevaluate.recommendation(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ recommendation_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_reevaluate_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_reevaluate_operations_async.py
new file mode 100644
index 000000000000..9aa3854767c3
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_reevaluate_operations_async.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 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 TestSecurityInsightsReevaluateOperationsAsync(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_recommendation(self, resource_group):
+ response = await self.client.reevaluate.recommendation(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ recommendation_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..cb5f1c3b82f0
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_security_ml_analytics_settings_operations.py
@@ -0,0 +1,121 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.security_ml_analytics_settings.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..6f1d440c9413
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_security_ml_analytics_settings_operations_async.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.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_list(self, resource_group):
+ response = self.client.security_ml_analytics_settings.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..ff72093cd3ab
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_sentinel_onboarding_states_operations.py
@@ -0,0 +1,80 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.sentinel_onboarding_states.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..68e887e88400
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_sentinel_onboarding_states_operations_async.py
@@ -0,0 +1,81 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_list(self, resource_group):
+ response = await self.client.sentinel_onboarding_states.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..0a17ef67a4dc
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_control_operations.py
@@ -0,0 +1,41 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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_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="2024-04-01-preview"
+,
+ )
+ 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..2b2a38fce04c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_control_operations_async.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.
+# --------------------------------------------------------------------------
+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_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="2024-04-01-preview"
+,
+ )
+ 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..5d38aa365d4b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_controls_operations.py
@@ -0,0 +1,161 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.source_controls.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..6dbd223ddf28
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_source_controls_operations_async.py
@@ -0,0 +1,162 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.source_controls.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_systems_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_systems_operations.py
new file mode 100644
index 000000000000..bd48786b4de5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_systems_operations.py
@@ -0,0 +1,142 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsSystemsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.systems.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.systems.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.systems.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.systems.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list_actions(self, resource_group):
+ response = self.client.systems.list_actions(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_undo_action(self, resource_group):
+ response = self.client.systems.undo_action(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_report_action_status(self, resource_group):
+ response = self.client.systems.report_action_status(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_systems_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_systems_operations_async.py
new file mode 100644
index 000000000000..0ff53087fe7f
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_systems_operations_async.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.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 TestSecurityInsightsSystemsOperationsAsync(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_create_or_update(self, resource_group):
+ response = await self.client.systems.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_get(self, resource_group):
+ response = await self.client.systems.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.systems.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_list(self, resource_group):
+ response = self.client.systems.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_list_actions(self, resource_group):
+ response = self.client.systems.list_actions(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_undo_action(self, resource_group):
+ response = await self.client.systems.undo_action(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_report_action_status(self, resource_group):
+ response = await self.client.systems.report_action_status(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ agent_resource_name="str"
+,
+ system_resource_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..066b13fdede0
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_metrics_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 TestSecurityInsightsThreatIntelligenceIndicatorMetricsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.threat_intelligence_indicator_metrics.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..711e85c2ec13
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_metrics_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 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_list(self, resource_group):
+ response = await self.client.threat_intelligence_indicator_metrics.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..28976e36b830
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_operations.py
@@ -0,0 +1,442 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.threat_intelligence_indicator.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.threat_intelligence_indicator.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..f5acf0bca7ab
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicator_operations_async.py
@@ -0,0 +1,443 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..873e98344e11
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicators_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 TestSecurityInsightsThreatIntelligenceIndicatorsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.threat_intelligence_indicators.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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..30e42644746b
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_indicators_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 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_list(self, resource_group):
+ response = self.client.threat_intelligence_indicators.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_threat_intelligence_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_operations.py
new file mode 100644
index 000000000000..d572dbfaacce
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_operations.py
@@ -0,0 +1,50 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsThreatIntelligenceOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_count(self, resource_group):
+ response = self.client.threat_intelligence.count(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ ti_type="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_query(self, resource_group):
+ response = self.client.threat_intelligence.query(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ ti_type="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_operations_async.py
new file mode 100644
index 000000000000..5ca943a3d59a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_threat_intelligence_operations_async.py
@@ -0,0 +1,51 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsThreatIntelligenceOperationsAsync(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_count(self, resource_group):
+ response = await self.client.threat_intelligence.count(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ ti_type="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_query(self, resource_group):
+ response = self.client.threat_intelligence.query(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ ti_type="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_triggered_analytics_rule_run_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_triggered_analytics_rule_run_operations.py
new file mode 100644
index 000000000000..6f0d510259a4
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_triggered_analytics_rule_run_operations.py
@@ -0,0 +1,34 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsTriggeredAnalyticsRuleRunOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.triggered_analytics_rule_run.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ rule_run_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_triggered_analytics_rule_run_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_triggered_analytics_rule_run_operations_async.py
new file mode 100644
index 000000000000..06af88089ade
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_triggered_analytics_rule_run_operations_async.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 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 TestSecurityInsightsTriggeredAnalyticsRuleRunOperationsAsync(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_get(self, resource_group):
+ response = await self.client.triggered_analytics_rule_run.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ rule_run_id="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_update_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_update_operations.py
new file mode 100644
index 000000000000..c1e18b0b4a79
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_update_operations.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 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 TestSecurityInsightsUpdateOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_recommendation(self, resource_group):
+ response = self.client.update.recommendation(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ recommendation_id="str"
+,
+ recommendation_patch={
+ "properties": {
+ "state": "str"
+ }
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_update_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_update_operations_async.py
new file mode 100644
index 000000000000..dea254f5e8a5
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_update_operations_async.py
@@ -0,0 +1,41 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+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 TestSecurityInsightsUpdateOperationsAsync(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_recommendation(self, resource_group):
+ response = await self.client.update.recommendation(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ recommendation_id="str"
+,
+ recommendation_patch={
+ "properties": {
+ "state": "str"
+ }
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # 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..752dc1725bd6
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlist_items_operations.py
@@ -0,0 +1,121 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.watchlist_items.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ watchlist_alias="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..cc22044e43f1
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlist_items_operations_async.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.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_list(self, resource_group):
+ response = self.client.watchlist_items.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ watchlist_alias="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )
+
+ # 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..8bccad334f89
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlists_operations.py
@@ -0,0 +1,127 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.watchlists.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.watchlists.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ watchlist_alias="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_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="2024-04-01-preview"
+,
+ ).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_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="2024-04-01-preview"
+,
+ ).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..a08926f97be8
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_watchlists_operations_async.py
@@ -0,0 +1,128 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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_list(self, resource_group):
+ response = self.client.watchlists.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.watchlists.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ watchlist_alias="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_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="2024-04-01-preview"
+,
+ )).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_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="2024-04-01-preview"
+,
+ )).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_workspace_manager_assignment_jobs_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignment_jobs_operations.py
new file mode 100644
index 000000000000..5f36e2c25bb4
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignment_jobs_operations.py
@@ -0,0 +1,86 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsWorkspaceManagerAssignmentJobsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.workspace_manager_assignment_jobs.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create(self, resource_group):
+ response = self.client.workspace_manager_assignment_jobs.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.workspace_manager_assignment_jobs.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ job_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.workspace_manager_assignment_jobs.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ job_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignment_jobs_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignment_jobs_operations_async.py
new file mode 100644
index 000000000000..6f46129478ce
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignment_jobs_operations_async.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.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 TestSecurityInsightsWorkspaceManagerAssignmentJobsOperationsAsync(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_list(self, resource_group):
+ response = self.client.workspace_manager_assignment_jobs.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_create(self, resource_group):
+ response = await self.client.workspace_manager_assignment_jobs.create(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_get(self, resource_group):
+ response = await self.client.workspace_manager_assignment_jobs.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ job_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.workspace_manager_assignment_jobs.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ job_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignments_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignments_operations.py
new file mode 100644
index 000000000000..092e077ac65c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignments_operations.py
@@ -0,0 +1,103 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsWorkspaceManagerAssignmentsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.workspace_manager_assignments.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.workspace_manager_assignments.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.workspace_manager_assignments.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ workspace_manager_assignment={
+ "etag": "str",
+ "id": "str",
+ "items": [
+ {
+ "resourceId": "str"
+ }
+ ],
+ "lastJobEndTime": "2020-02-20 00:00:00",
+ "lastJobProvisioningState": "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"
+ },
+ "targetResourceName": "str",
+ "type": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.workspace_manager_assignments.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignments_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignments_operations_async.py
new file mode 100644
index 000000000000..67b05aefe409
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_assignments_operations_async.py
@@ -0,0 +1,104 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsWorkspaceManagerAssignmentsOperationsAsync(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_list(self, resource_group):
+ response = self.client.workspace_manager_assignments.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.workspace_manager_assignments.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create_or_update(self, resource_group):
+ response = await self.client.workspace_manager_assignments.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ workspace_manager_assignment={
+ "etag": "str",
+ "id": "str",
+ "items": [
+ {
+ "resourceId": "str"
+ }
+ ],
+ "lastJobEndTime": "2020-02-20 00:00:00",
+ "lastJobProvisioningState": "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"
+ },
+ "targetResourceName": "str",
+ "type": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.workspace_manager_assignments.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_assignment_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_configurations_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_configurations_operations.py
new file mode 100644
index 000000000000..a930e905ce9e
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_configurations_operations.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 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 TestSecurityInsightsWorkspaceManagerConfigurationsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.workspace_manager_configurations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.workspace_manager_configurations.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_configuration_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.workspace_manager_configurations.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_configuration_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.workspace_manager_configurations.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_configuration_name="str"
+,
+ workspace_manager_configuration={
+ "etag": "str",
+ "id": "str",
+ "mode": "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_configurations_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_configurations_operations_async.py
new file mode 100644
index 000000000000..3f37d049949a
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_configurations_operations_async.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.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 TestSecurityInsightsWorkspaceManagerConfigurationsOperationsAsync(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_list(self, resource_group):
+ response = self.client.workspace_manager_configurations.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.workspace_manager_configurations.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_configuration_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.workspace_manager_configurations.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_configuration_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create_or_update(self, resource_group):
+ response = await self.client.workspace_manager_configurations.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_configuration_name="str"
+,
+ workspace_manager_configuration={
+ "etag": "str",
+ "id": "str",
+ "mode": "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_groups_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_groups_operations.py
new file mode 100644
index 000000000000..0f9eb70ec5b9
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_groups_operations.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 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 TestSecurityInsightsWorkspaceManagerGroupsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.workspace_manager_groups.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.workspace_manager_groups.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_group_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.workspace_manager_groups.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_group_name="str"
+,
+ workspace_manager_group={
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "id": "str",
+ "memberResourceNames": [
+ "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.workspace_manager_groups.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_group_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_groups_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_groups_operations_async.py
new file mode 100644
index 000000000000..740d715bf07d
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_groups_operations_async.py
@@ -0,0 +1,101 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for 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 TestSecurityInsightsWorkspaceManagerGroupsOperationsAsync(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_list(self, resource_group):
+ response = self.client.workspace_manager_groups.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.workspace_manager_groups.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_group_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create_or_update(self, resource_group):
+ response = await self.client.workspace_manager_groups.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_group_name="str"
+,
+ workspace_manager_group={
+ "description": "str",
+ "displayName": "str",
+ "etag": "str",
+ "id": "str",
+ "memberResourceNames": [
+ "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="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.workspace_manager_groups.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_group_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_members_operations.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_members_operations.py
new file mode 100644
index 000000000000..9d1ec6e82598
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_members_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 TestSecurityInsightsWorkspaceManagerMembersOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(SecurityInsights)
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_list(self, resource_group):
+ response = self.client.workspace_manager_members.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_get(self, resource_group):
+ response = self.client.workspace_manager_members.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_member_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_create_or_update(self, resource_group):
+ response = self.client.workspace_manager_members.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_member_name="str"
+,
+ workspace_manager_member={
+ "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"
+ },
+ "targetWorkspaceResourceId": "str",
+ "targetWorkspaceTenantId": "str",
+ "type": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_delete(self, resource_group):
+ response = self.client.workspace_manager_members.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_member_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
diff --git a/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_members_operations_async.py b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_members_operations_async.py
new file mode 100644
index 000000000000..820b7daf996c
--- /dev/null
+++ b/sdk/securityinsight/azure-mgmt-securityinsight/generated_tests/test_security_insights_workspace_manager_members_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 TestSecurityInsightsWorkspaceManagerMembersOperationsAsync(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_list(self, resource_group):
+ response = self.client.workspace_manager_members.list(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+ 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_get(self, resource_group):
+ response = await self.client.workspace_manager_members.get(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_member_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_create_or_update(self, resource_group):
+ response = await self.client.workspace_manager_members.create_or_update(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_member_name="str"
+,
+ workspace_manager_member={
+ "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"
+ },
+ "targetWorkspaceResourceId": "str",
+ "targetWorkspaceTenantId": "str",
+ "type": "str"
+ }
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_delete(self, resource_group):
+ response = await self.client.workspace_manager_members.delete(
+ resource_group_name=resource_group.name,
+ workspace_name="str"
+,
+ workspace_manager_member_name="str"
+,
+ api_version="2024-04-01-preview"
+,
+ )
+
+ # please add some check logic here by yourself
+ # ...
+