# pylint: disable=line-too-long,useless-suppression,too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=useless-super-delegation

import datetime
from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload

from .._utils.model_base import Model as _Model, rest_discriminator, rest_field
from ._enums import AuthenticationKind, DiscoveryRuleKind, SignalKind

if TYPE_CHECKING:
    from .. import models as _models


class AlertConfiguration(_Model):
    """Alert configuration details.

    :ivar severity: The severity of triggered alert. Required. Known values are: "Sev0", "Sev1",
     "Sev2", "Sev3", and "Sev4".
    :vartype severity: str or ~azure.mgmt.cloudhealth.models.AlertSeverity
    :ivar description: The alert rule description.
    :vartype description: str
    :ivar action_group_ids: Optional list of action group resource IDs to be notified when the
     alert is triggered.
    :vartype action_group_ids: list[str]
    """

    severity: Union[str, "_models.AlertSeverity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The severity of triggered alert. Required. Known values are: \"Sev0\", \"Sev1\", \"Sev2\",
     \"Sev3\", and \"Sev4\"."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The alert rule description."""
    action_group_ids: Optional[list[str]] = rest_field(
        name="actionGroupIds", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional list of action group resource IDs to be notified when the alert is triggered."""

    @overload
    def __init__(
        self,
        *,
        severity: Union[str, "_models.AlertSeverity"],
        description: Optional[str] = None,
        action_group_ids: Optional[list[str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DiscoveryRuleSpecification(_Model):
    """Base model for discovery rule specifications.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    ApplicationInsightsTopologySpecification, ResourceGraphQuerySpecification

    :ivar kind: Kind of the discovery rule specification. Required. Known values are:
     "ResourceGraphQuery" and "ApplicationInsightsTopology".
    :vartype kind: str or ~azure.mgmt.cloudhealth.models.DiscoveryRuleKind
    """

    __mapping__: dict[str, _Model] = {}
    kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])
    """Kind of the discovery rule specification. Required. Known values are: \"ResourceGraphQuery\"
     and \"ApplicationInsightsTopology\"."""

    @overload
    def __init__(
        self,
        *,
        kind: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ApplicationInsightsTopologySpecification(DiscoveryRuleSpecification, discriminator="ApplicationInsightsTopology"):
    """Discovery rule specification for an Application Insights topology query.

    :ivar kind: Kind of the discovery rule specification. Required. Application Insights topology
     based discovery.
    :vartype kind: str or ~azure.mgmt.cloudhealth.models.APPLICATION_INSIGHTS_TOPOLOGY
    :ivar application_insights_resource_id: Application Insights resource ID. Required.
    :vartype application_insights_resource_id: str
    """

    kind: Literal[DiscoveryRuleKind.APPLICATION_INSIGHTS_TOPOLOGY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Kind of the discovery rule specification. Required. Application Insights topology based
     discovery."""
    application_insights_resource_id: str = rest_field(
        name="applicationInsightsResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Application Insights resource ID. Required."""

    @overload
    def __init__(
        self,
        *,
        application_insights_resource_id: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.kind = DiscoveryRuleKind.APPLICATION_INSIGHTS_TOPOLOGY  # type: ignore


class Resource(_Model):
    """Resource.

    :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.cloudhealth.models.SystemData
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}."""
    name: Optional[str] = rest_field(visibility=["read"])
    """The name of the resource."""
    type: Optional[str] = rest_field(visibility=["read"])
    """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or
     \"Microsoft.Storage/storageAccounts\"."""
    system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
    """Azure Resource Manager metadata containing createdBy and modifiedBy information."""


class ProxyResource(Resource):
    """Proxy Resource.

    :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.cloudhealth.models.SystemData
    """


class AuthenticationSetting(ProxyResource):
    """An authentication setting in a health model.

    :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.cloudhealth.models.SystemData
    :ivar properties: The resource-specific properties for this resource.
    :vartype properties: ~azure.mgmt.cloudhealth.models.AuthenticationSettingProperties
    """

    properties: Optional["_models.AuthenticationSettingProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource-specific properties for this resource."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.AuthenticationSettingProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AuthenticationSettingProperties(_Model):
    """Authentication setting properties.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    ManagedIdentityAuthenticationSettingProperties

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Creating", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.cloudhealth.models.HealthModelProvisioningState
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar authentication_kind: Kind of the authentication setting. Required. "ManagedIdentity"
    :vartype authentication_kind: str or ~azure.mgmt.cloudhealth.models.AuthenticationKind
    """

    __mapping__: dict[str, _Model] = {}
    provisioning_state: Optional[Union[str, "_models.HealthModelProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\",
     \"Creating\", and \"Deleting\"."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    authentication_kind: str = rest_discriminator(
        name="authenticationKind", visibility=["read", "create", "update", "delete", "query"]
    )
    """Kind of the authentication setting. Required. \"ManagedIdentity\""""

    @overload
    def __init__(
        self,
        *,
        authentication_kind: str,
        display_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AzureMonitorWorkspaceSignals(_Model):
    """A grouping of Azure Monitor workspace signals.

    :ivar authentication_setting: Reference to the name of the authentication setting which is used
     for querying the data source. Required.
    :vartype authentication_setting: str
    :ivar azure_monitor_workspace_resource_id: Azure Monitor workspace resource ID. Required.
    :vartype azure_monitor_workspace_resource_id: str
    :ivar signals: Signals assigned to this signal group.
    :vartype signals: list[~azure.mgmt.cloudhealth.models.PrometheusMetricsSignal]
    """

    authentication_setting: str = rest_field(
        name="authenticationSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Reference to the name of the authentication setting which is used for querying the data source.
     Required."""
    azure_monitor_workspace_resource_id: str = rest_field(
        name="azureMonitorWorkspaceResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Monitor workspace resource ID. Required."""
    signals: Optional[list["_models.PrometheusMetricsSignal"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Signals assigned to this signal group."""

    @overload
    def __init__(
        self,
        *,
        authentication_setting: str,
        azure_monitor_workspace_resource_id: str,
        signals: Optional[list["_models.PrometheusMetricsSignal"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SignalInstanceProperties(_Model):
    """Additional properties for signal instances assigned to an entity.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    AzureResourceSignal, ExternalSignal, LogAnalyticsSignal, PrometheusMetricsSignal

    :ivar signal_kind: Kind of the signal instance. Required. Known values are:
     "AzureResourceMetric", "LogAnalyticsQuery", "PrometheusMetricsQuery", and "External".
    :vartype signal_kind: str or ~azure.mgmt.cloudhealth.models.SignalKind
    :ivar name: Unique name of the signal within the entity. Required.
    :vartype name: str
    :ivar signal_definition_name: Optional reference to a signal definition that provides default
     values.
    :vartype signal_definition_name: str
    :ivar status: Current status of the signal.
    :vartype status: ~azure.mgmt.cloudhealth.models.SignalStatus
    """

    __mapping__: dict[str, _Model] = {}
    signal_kind: str = rest_discriminator(name="signalKind", visibility=["read", "create", "update", "delete", "query"])
    """Kind of the signal instance. Required. Known values are: \"AzureResourceMetric\",
     \"LogAnalyticsQuery\", \"PrometheusMetricsQuery\", and \"External\"."""
    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Unique name of the signal within the entity. Required."""
    signal_definition_name: Optional[str] = rest_field(
        name="signalDefinitionName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional reference to a signal definition that provides default values."""
    status: Optional["_models.SignalStatus"] = rest_field(visibility=["read"])
    """Current status of the signal."""

    @overload
    def __init__(
        self,
        *,
        signal_kind: str,
        name: str,
        signal_definition_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class AzureResourceSignal(SignalInstanceProperties, discriminator="AzureResourceMetric"):
    """An Azure Resource Metric signal instance assigned to an entity.

    :ivar name: Unique name of the signal within the entity. Required.
    :vartype name: str
    :ivar signal_definition_name: Optional reference to a signal definition that provides default
     values.
    :vartype signal_definition_name: str
    :ivar status: Current status of the signal.
    :vartype status: ~azure.mgmt.cloudhealth.models.SignalStatus
    :ivar signal_kind: Kind of the signal instance. Required. AZURE_RESOURCE_METRIC.
    :vartype signal_kind: str or ~azure.mgmt.cloudhealth.models.AZURE_RESOURCE_METRIC
    :ivar metric_namespace: Metric namespace.
    :vartype metric_namespace: str
    :ivar metric_name: Name of the metric.
    :vartype metric_name: str
    :ivar time_grain: Time range of signal. ISO duration format like PT10M.
    :vartype time_grain: str
    :ivar aggregation_type: Type of aggregation to apply to the metric. Known values are: "None",
     "Average", "Count", "Minimum", "Maximum", and "Total".
    :vartype aggregation_type: str or ~azure.mgmt.cloudhealth.models.MetricAggregationType
    :ivar dimension: Optional: Dimension to split by.
    :vartype dimension: str
    :ivar dimension_filter: Optional: Dimension filter to apply to the dimension. Must only be set
     if also Dimension is set.
    :vartype dimension_filter: str
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar refresh_interval: Interval in which the signal is being evaluated. Defaults to PT1M (1
     minute). Known values are: "PT1M", "PT5M", "PT10M", "PT30M", "PT1H", and "PT2H".
    :vartype refresh_interval: str or ~azure.mgmt.cloudhealth.models.RefreshInterval
    :ivar data_unit: Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
    :vartype data_unit: str
    :ivar evaluation_rules: Evaluation rules for the signal definition.
    :vartype evaluation_rules: ~azure.mgmt.cloudhealth.models.EvaluationRule
    """

    signal_kind: Literal[SignalKind.AZURE_RESOURCE_METRIC] = rest_discriminator(name="signalKind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Kind of the signal instance. Required. AZURE_RESOURCE_METRIC."""
    metric_namespace: Optional[str] = rest_field(
        name="metricNamespace", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metric namespace."""
    metric_name: Optional[str] = rest_field(
        name="metricName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the metric."""
    time_grain: Optional[str] = rest_field(name="timeGrain", visibility=["read", "create", "update", "delete", "query"])
    """Time range of signal. ISO duration format like PT10M."""
    aggregation_type: Optional[Union[str, "_models.MetricAggregationType"]] = rest_field(
        name="aggregationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of aggregation to apply to the metric. Known values are: \"None\", \"Average\", \"Count\",
     \"Minimum\", \"Maximum\", and \"Total\"."""
    dimension: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Optional: Dimension to split by."""
    dimension_filter: Optional[str] = rest_field(
        name="dimensionFilter", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional: Dimension filter to apply to the dimension. Must only be set if also Dimension is
     set."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = rest_field(
        name="refreshInterval", visibility=["read", "create", "update", "delete", "query"]
    )
    """Interval in which the signal is being evaluated. Defaults to PT1M (1 minute). Known values are:
     \"PT1M\", \"PT5M\", \"PT10M\", \"PT30M\", \"PT1H\", and \"PT2H\"."""
    data_unit: Optional[str] = rest_field(name="dataUnit", visibility=["read", "create", "update", "delete", "query"])
    """Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count))."""
    evaluation_rules: Optional["_models.EvaluationRule"] = rest_field(
        name="evaluationRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """Evaluation rules for the signal definition."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        signal_definition_name: Optional[str] = None,
        metric_namespace: Optional[str] = None,
        metric_name: Optional[str] = None,
        time_grain: Optional[str] = None,
        aggregation_type: Optional[Union[str, "_models.MetricAggregationType"]] = None,
        dimension: Optional[str] = None,
        dimension_filter: Optional[str] = None,
        display_name: Optional[str] = None,
        refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = None,
        data_unit: Optional[str] = None,
        evaluation_rules: Optional["_models.EvaluationRule"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.signal_kind = SignalKind.AZURE_RESOURCE_METRIC  # type: ignore


class AzureResourceSignals(_Model):
    """A grouping of Azure resource signals.

    :ivar authentication_setting: Reference to the name of the authentication setting which is used
     for querying the data source. Required.
    :vartype authentication_setting: str
    :ivar azure_resource_id: Azure resource ID. Required.
    :vartype azure_resource_id: str
    :ivar azure_resource_kind: Azure resource kind (e.g., 'functionapp'). Populated by the UI for
     icon rendering. Can be null if not populated.
    :vartype azure_resource_kind: str
    :ivar signals: Signals assigned to this group.
    :vartype signals: list[~azure.mgmt.cloudhealth.models.AzureResourceSignal]
    """

    authentication_setting: str = rest_field(
        name="authenticationSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Reference to the name of the authentication setting which is used for querying the data source.
     Required."""
    azure_resource_id: str = rest_field(
        name="azureResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure resource ID. Required."""
    azure_resource_kind: Optional[str] = rest_field(
        name="azureResourceKind", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure resource kind (e.g., 'functionapp'). Populated by the UI for icon rendering. Can be null
     if not populated."""
    signals: Optional[list["_models.AzureResourceSignal"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Signals assigned to this group."""

    @overload
    def __init__(
        self,
        *,
        authentication_setting: str,
        azure_resource_id: str,
        azure_resource_kind: Optional[str] = None,
        signals: Optional[list["_models.AzureResourceSignal"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DependenciesSignalGroupV2(_Model):
    """Properties for dependent entities, i.e. child entities.

    :ivar aggregation_type: Aggregation type for child dependencies. Required. Known values are:
     "WorstOf", "MinHealthy", and "MaxNotHealthy".
    :vartype aggregation_type: str or ~azure.mgmt.cloudhealth.models.DependenciesAggregationType
    :ivar degraded_threshold: Degraded threshold for aggregation. For MinHealthy: parent is
     degraded when healthy count/percentage falls to or below this value. For MaxNotHealthy: parent
     is degraded when not-healthy count/percentage reaches or exceeds this value. Optional — if not
     set, there is no degraded state (transitions directly from Healthy to Unhealthy).
    :vartype degraded_threshold: float
    :ivar unhealthy_threshold: Unhealthy threshold for aggregation. For MinHealthy: parent is
     unhealthy when healthy count/percentage falls to or below this value. For MaxNotHealthy: parent
     is unhealthy when not-healthy count/percentage reaches or exceeds this value. Required when
     aggregationType is MinHealthy or MaxNotHealthy.
    :vartype unhealthy_threshold: float
    :ivar unit: Unit type for the aggregation thresholds. Required when aggregationType is
     MinHealthy or MaxNotHealthy. Known values are: "Absolute" and "Percentage".
    :vartype unit: str or ~azure.mgmt.cloudhealth.models.DependenciesAggregationUnit
    :ivar ignore_unknown: If true, children with Unknown health state are excluded from aggregation
     calculations. Defaults to true.
    :vartype ignore_unknown: bool
    """

    aggregation_type: Union[str, "_models.DependenciesAggregationType"] = rest_field(
        name="aggregationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Aggregation type for child dependencies. Required. Known values are: \"WorstOf\",
     \"MinHealthy\", and \"MaxNotHealthy\"."""
    degraded_threshold: Optional[float] = rest_field(
        name="degradedThreshold", visibility=["read", "create", "update", "delete", "query"]
    )
    """Degraded threshold for aggregation. For MinHealthy: parent is degraded when healthy
     count/percentage falls to or below this value. For MaxNotHealthy: parent is degraded when
     not-healthy count/percentage reaches or exceeds this value. Optional — if not set, there is no
     degraded state (transitions directly from Healthy to Unhealthy)."""
    unhealthy_threshold: Optional[float] = rest_field(
        name="unhealthyThreshold", visibility=["read", "create", "update", "delete", "query"]
    )
    """Unhealthy threshold for aggregation. For MinHealthy: parent is unhealthy when healthy
     count/percentage falls to or below this value. For MaxNotHealthy: parent is unhealthy when
     not-healthy count/percentage reaches or exceeds this value. Required when aggregationType is
     MinHealthy or MaxNotHealthy."""
    unit: Optional[Union[str, "_models.DependenciesAggregationUnit"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Unit type for the aggregation thresholds. Required when aggregationType is MinHealthy or
     MaxNotHealthy. Known values are: \"Absolute\" and \"Percentage\"."""
    ignore_unknown: Optional[bool] = rest_field(
        name="ignoreUnknown", visibility=["read", "create", "update", "delete", "query"]
    )
    """If true, children with Unknown health state are excluded from aggregation calculations.
     Defaults to true."""

    @overload
    def __init__(
        self,
        *,
        aggregation_type: Union[str, "_models.DependenciesAggregationType"],
        degraded_threshold: Optional[float] = None,
        unhealthy_threshold: Optional[float] = None,
        unit: Optional[Union[str, "_models.DependenciesAggregationUnit"]] = None,
        ignore_unknown: Optional[bool] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DiscoveryError(_Model):
    """Error details for a failed discovery operation.

    :ivar message: Error message. Required.
    :vartype message: str
    :ivar context: Additional context information, like resource IDs or query details.
    :vartype context: list[str]
    """

    message: str = rest_field(visibility=["read"])
    """Error message. Required."""
    context: Optional[list[str]] = rest_field(visibility=["read"])
    """Additional context information, like resource IDs or query details."""


class DiscoveryRule(ProxyResource):
    """A discovery rule which automatically finds entities and relationships in a health model based
    on an Azure Resource Graph query.

    :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.cloudhealth.models.SystemData
    :ivar properties: The resource-specific properties for this resource.
    :vartype properties: ~azure.mgmt.cloudhealth.models.DiscoveryRuleProperties
    """

    properties: Optional["_models.DiscoveryRuleProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource-specific properties for this resource."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.DiscoveryRuleProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DiscoveryRuleProperties(_Model):
    """Discovery rule properties.

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Creating", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.cloudhealth.models.HealthModelProvisioningState
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar authentication_setting: Reference to the name of the authentication setting which is used
     for querying Azure Resource Graph. The same authentication setting will also be assigned to any
     discovered entities. Required.
    :vartype authentication_setting: str
    :ivar discover_relationships: Whether to create relationships between the discovered entities
     based on a set of built-in rules. These relationships cannot be manually deleted. Required.
     Known values are: "Enabled" and "Disabled".
    :vartype discover_relationships: str or
     ~azure.mgmt.cloudhealth.models.DiscoveryRuleRelationshipDiscoveryBehavior
    :ivar add_recommended_signals: Whether to add all recommended signals to the discovered
     entities. Required. Known values are: "Enabled" and "Disabled".
    :vartype add_recommended_signals: str or
     ~azure.mgmt.cloudhealth.models.DiscoveryRuleRecommendedSignalsBehavior
    :ivar specification: Specification of the discovery rule defining how entities are discovered.
     Required.
    :vartype specification: ~azure.mgmt.cloudhealth.models.DiscoveryRuleSpecification
    :ivar error: Error details if the last discovery operation failed.
    :vartype error: ~azure.mgmt.cloudhealth.models.DiscoveryError
    :ivar entity_name: Name of the entity which represents the discovery rule. Note: It might take
     a few minutes after creating the discovery rule until the entity is created. Required.
    :vartype entity_name: str
    """

    provisioning_state: Optional[Union[str, "_models.HealthModelProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\",
     \"Creating\", and \"Deleting\"."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    authentication_setting: str = rest_field(
        name="authenticationSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Reference to the name of the authentication setting which is used for querying Azure Resource
     Graph. The same authentication setting will also be assigned to any discovered entities.
     Required."""
    discover_relationships: Union[str, "_models.DiscoveryRuleRelationshipDiscoveryBehavior"] = rest_field(
        name="discoverRelationships", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to create relationships between the discovered entities based on a set of built-in
     rules. These relationships cannot be manually deleted. Required. Known values are: \"Enabled\"
     and \"Disabled\"."""
    add_recommended_signals: Union[str, "_models.DiscoveryRuleRecommendedSignalsBehavior"] = rest_field(
        name="addRecommendedSignals", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to add all recommended signals to the discovered entities. Required. Known values are:
     \"Enabled\" and \"Disabled\"."""
    specification: "_models.DiscoveryRuleSpecification" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Specification of the discovery rule defining how entities are discovered. Required."""
    error: Optional["_models.DiscoveryError"] = rest_field(visibility=["read"])
    """Error details if the last discovery operation failed."""
    entity_name: str = rest_field(name="entityName", visibility=["read"])
    """Name of the entity which represents the discovery rule. Note: It might take a few minutes after
     creating the discovery rule until the entity is created. Required."""

    @overload
    def __init__(
        self,
        *,
        authentication_setting: str,
        discover_relationships: Union[str, "_models.DiscoveryRuleRelationshipDiscoveryBehavior"],
        add_recommended_signals: Union[str, "_models.DiscoveryRuleRecommendedSignalsBehavior"],
        specification: "_models.DiscoveryRuleSpecification",
        display_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Entity(ProxyResource):
    """An entity (aka node) of a health model.

    :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.cloudhealth.models.SystemData
    :ivar properties: The resource-specific properties for this resource.
    :vartype properties: ~azure.mgmt.cloudhealth.models.EntityProperties
    """

    properties: Optional["_models.EntityProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource-specific properties for this resource."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.EntityProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EntityAlerts(_Model):
    """Alert configuration for an entity.

    :ivar unhealthy: Alert to be triggered on state change to unhealthy.
    :vartype unhealthy: ~azure.mgmt.cloudhealth.models.AlertConfiguration
    :ivar degraded: Alert to be triggered on state change to degraded.
    :vartype degraded: ~azure.mgmt.cloudhealth.models.AlertConfiguration
    """

    unhealthy: Optional["_models.AlertConfiguration"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Alert to be triggered on state change to unhealthy."""
    degraded: Optional["_models.AlertConfiguration"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Alert to be triggered on state change to degraded."""

    @overload
    def __init__(
        self,
        *,
        unhealthy: Optional["_models.AlertConfiguration"] = None,
        degraded: Optional["_models.AlertConfiguration"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EntityCoordinates(_Model):
    """Visual position of the entity.

    :ivar x: X Coordinate. Required.
    :vartype x: float
    :ivar y: Y Coordinate. Required.
    :vartype y: float
    """

    x: float = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """X Coordinate. Required."""
    y: float = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Y Coordinate. Required."""

    @overload
    def __init__(
        self,
        *,
        x: float,
        y: float,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EntityHistoryRequest(_Model):
    """Request body for getting entity health history.

    :ivar start_at: Start time for the history query. Defaults to 24 hours ago if not specified.
    :vartype start_at: ~datetime.datetime
    :ivar end_at: End time for the history query. Defaults to now if not specified.
    :vartype end_at: ~datetime.datetime
    """

    start_at: Optional[datetime.datetime] = rest_field(
        name="startAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Start time for the history query. Defaults to 24 hours ago if not specified."""
    end_at: Optional[datetime.datetime] = rest_field(
        name="endAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """End time for the history query. Defaults to now if not specified."""

    @overload
    def __init__(
        self,
        *,
        start_at: Optional[datetime.datetime] = None,
        end_at: Optional[datetime.datetime] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EntityHistoryResponse(_Model):
    """Response containing entity health state transitions.

    :ivar entity_name: Name of the entity. Required.
    :vartype entity_name: str
    :ivar history: List of health state transitions. Required.
    :vartype history: list[~azure.mgmt.cloudhealth.models.HealthStateTransition]
    """

    entity_name: str = rest_field(name="entityName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the entity. Required."""
    history: list["_models.HealthStateTransition"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of health state transitions. Required."""

    @overload
    def __init__(
        self,
        *,
        entity_name: str,
        history: list["_models.HealthStateTransition"],
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EntityProperties(_Model):
    """Properties which are common across all kinds of entities.

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Creating", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.cloudhealth.models.HealthModelProvisioningState
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar canvas_position: Positioning of the entity on the model canvas.
    :vartype canvas_position: ~azure.mgmt.cloudhealth.models.EntityCoordinates
    :ivar icon: Visual icon definition. If not set, a default icon is used.
    :vartype icon: ~azure.mgmt.cloudhealth.models.IconDefinition
    :ivar health_objective: Health objective as a percentage of time the entity should be healthy.
    :vartype health_objective: float
    :ivar impact: Impact of the entity in health state propagation. Known values are: "Standard",
     "Limited", and "Suppressed".
    :vartype impact: str or ~azure.mgmt.cloudhealth.models.EntityImpact
    :ivar tags: Optional set of tags (key-value pairs).
    :vartype tags: dict[str, str]
    :ivar signal_groups: Signal groups which are assigned to this entity.
    :vartype signal_groups: ~azure.mgmt.cloudhealth.models.SignalGroups
    :ivar discovered_by: Discovered by which discovery rule. If set, the entity cannot be deleted
     manually.
    :vartype discovered_by: str
    :ivar health_state: Health state of this entity. Known values are: "Healthy", "Degraded",
     "Unhealthy", "Unknown", and "Deleted".
    :vartype health_state: str or ~azure.mgmt.cloudhealth.models.HealthState
    :ivar alerts: Alert configuration for this entity.
    :vartype alerts: ~azure.mgmt.cloudhealth.models.EntityAlerts
    """

    provisioning_state: Optional[Union[str, "_models.HealthModelProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\",
     \"Creating\", and \"Deleting\"."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    canvas_position: Optional["_models.EntityCoordinates"] = rest_field(
        name="canvasPosition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Positioning of the entity on the model canvas."""
    icon: Optional["_models.IconDefinition"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Visual icon definition. If not set, a default icon is used."""
    health_objective: Optional[float] = rest_field(
        name="healthObjective", visibility=["read", "create", "update", "delete", "query"]
    )
    """Health objective as a percentage of time the entity should be healthy."""
    impact: Optional[Union[str, "_models.EntityImpact"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Impact of the entity in health state propagation. Known values are: \"Standard\", \"Limited\",
     and \"Suppressed\"."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Optional set of tags (key-value pairs)."""
    signal_groups: Optional["_models.SignalGroups"] = rest_field(
        name="signalGroups", visibility=["read", "create", "update", "delete", "query"]
    )
    """Signal groups which are assigned to this entity."""
    discovered_by: Optional[str] = rest_field(name="discoveredBy", visibility=["read"])
    """Discovered by which discovery rule. If set, the entity cannot be deleted manually."""
    health_state: Optional[Union[str, "_models.HealthState"]] = rest_field(name="healthState", visibility=["read"])
    """Health state of this entity. Known values are: \"Healthy\", \"Degraded\", \"Unhealthy\",
     \"Unknown\", and \"Deleted\"."""
    alerts: Optional["_models.EntityAlerts"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Alert configuration for this entity."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        canvas_position: Optional["_models.EntityCoordinates"] = None,
        icon: Optional["_models.IconDefinition"] = None,
        health_objective: Optional[float] = None,
        impact: Optional[Union[str, "_models.EntityImpact"]] = None,
        tags: Optional[dict[str, str]] = None,
        signal_groups: Optional["_models.SignalGroups"] = None,
        alerts: Optional["_models.EntityAlerts"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ErrorAdditionalInfo(_Model):
    """The resource management error additional info.

    :ivar type: The additional info type.
    :vartype type: str
    :ivar info: The additional info.
    :vartype info: any
    """

    type: Optional[str] = rest_field(visibility=["read"])
    """The additional info type."""
    info: Optional[Any] = rest_field(visibility=["read"])
    """The additional info."""


class ErrorDetail(_Model):
    """The error detail.

    :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.cloudhealth.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.cloudhealth.models.ErrorAdditionalInfo]
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """The error code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The error message."""
    target: Optional[str] = rest_field(visibility=["read"])
    """The error target."""
    details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"])
    """The error details."""
    additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field(
        name="additionalInfo", visibility=["read"]
    )
    """The error additional info."""


class ErrorResponse(_Model):
    """Error response.

    :ivar error: The error object.
    :vartype error: ~azure.mgmt.cloudhealth.models.ErrorDetail
    """

    error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The error object."""

    @overload
    def __init__(
        self,
        *,
        error: Optional["_models.ErrorDetail"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EvaluationRule(_Model):
    """Evaluation rule for a signal definition.

    :ivar degraded_rule: Degraded rule with static threshold.
    :vartype degraded_rule: ~azure.mgmt.cloudhealth.models.ThresholdRuleV2
    :ivar unhealthy_rule: Unhealthy rule with static threshold. Required.
    :vartype unhealthy_rule: ~azure.mgmt.cloudhealth.models.ThresholdRuleV2
    """

    degraded_rule: Optional["_models.ThresholdRuleV2"] = rest_field(
        name="degradedRule", visibility=["read", "create", "update", "delete", "query"]
    )
    """Degraded rule with static threshold."""
    unhealthy_rule: "_models.ThresholdRuleV2" = rest_field(
        name="unhealthyRule", visibility=["read", "create", "update", "delete", "query"]
    )
    """Unhealthy rule with static threshold. Required."""

    @overload
    def __init__(
        self,
        *,
        unhealthy_rule: "_models.ThresholdRuleV2",
        degraded_rule: Optional["_models.ThresholdRuleV2"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ExternalSignal(SignalInstanceProperties, discriminator="External"):
    """An externally submitted signal instance assigned to an entity.

    :ivar name: Unique name of the signal within the entity. Required.
    :vartype name: str
    :ivar signal_definition_name: Optional reference to a signal definition that provides default
     values.
    :vartype signal_definition_name: str
    :ivar status: Current status of the signal.
    :vartype status: ~azure.mgmt.cloudhealth.models.SignalStatus
    :ivar signal_kind: Kind of the signal instance. Required. EXTERNAL_SIGNAL.
    :vartype signal_kind: str or ~azure.mgmt.cloudhealth.models.EXTERNAL_SIGNAL
    :ivar evaluation_rules: Evaluation rules for the external signal as submitted.
    :vartype evaluation_rules: ~azure.mgmt.cloudhealth.models.EvaluationRule
    """

    signal_kind: Literal[SignalKind.EXTERNAL_SIGNAL] = rest_discriminator(name="signalKind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Kind of the signal instance. Required. EXTERNAL_SIGNAL."""
    evaluation_rules: Optional["_models.EvaluationRule"] = rest_field(
        name="evaluationRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """Evaluation rules for the external signal as submitted."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        signal_definition_name: Optional[str] = None,
        evaluation_rules: Optional["_models.EvaluationRule"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.signal_kind = SignalKind.EXTERNAL_SIGNAL  # type: ignore


class ExternalSignalGroup(_Model):
    """A grouping of externally submitted signals.

    :ivar signals: Signals assigned to this signal group.
    :vartype signals: list[~azure.mgmt.cloudhealth.models.ExternalSignal]
    """

    signals: Optional[list["_models.ExternalSignal"]] = rest_field(visibility=["read"])
    """Signals assigned to this signal group."""


class TrackedResource(Resource):
    """Tracked Resource.

    :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.cloudhealth.models.SystemData
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""
    location: str = rest_field(visibility=["read", "create"])
    """The geo-location where the resource lives. Required."""

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class HealthModel(TrackedResource):
    """A HealthModel resource.

    :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.cloudhealth.models.SystemData
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    :ivar properties: The resource-specific properties for this resource.
    :vartype properties: ~azure.mgmt.cloudhealth.models.HealthModelProperties
    :ivar identity: The managed service identities assigned to this resource.
    :vartype identity: ~azure.mgmt.cloudhealth.models.ManagedServiceIdentity
    """

    properties: Optional["_models.HealthModelProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource-specific properties for this resource."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The managed service identities assigned to this resource."""

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.HealthModelProperties"] = None,
        identity: Optional["_models.ManagedServiceIdentity"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class HealthModelProperties(_Model):
    """HealthModel properties.

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Creating", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.cloudhealth.models.HealthModelProvisioningState
    """

    provisioning_state: Optional[Union[str, "_models.HealthModelProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\",
     \"Creating\", and \"Deleting\"."""


class HealthModelUpdate(_Model):
    """The type used for update operations of the HealthModel.

    :ivar identity: The managed service identities assigned to this resource.
    :vartype identity: ~azure.mgmt.cloudhealth.models.ManagedServiceIdentity
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    """

    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The managed service identities assigned to this resource."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""

    @overload
    def __init__(
        self,
        *,
        identity: Optional["_models.ManagedServiceIdentity"] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class HealthReportEvaluationRule(_Model):
    """Evaluation rules for the health report.

    :ivar degraded_rule: Degraded rule with static threshold.
    :vartype degraded_rule: ~azure.mgmt.cloudhealth.models.ThresholdRuleV2
    :ivar unhealthy_rule: Unhealthy rule with static threshold. Required.
    :vartype unhealthy_rule: ~azure.mgmt.cloudhealth.models.ThresholdRuleV2
    """

    degraded_rule: Optional["_models.ThresholdRuleV2"] = rest_field(
        name="degradedRule", visibility=["read", "create", "update", "delete", "query"]
    )
    """Degraded rule with static threshold."""
    unhealthy_rule: "_models.ThresholdRuleV2" = rest_field(
        name="unhealthyRule", visibility=["read", "create", "update", "delete", "query"]
    )
    """Unhealthy rule with static threshold. Required."""

    @overload
    def __init__(
        self,
        *,
        unhealthy_rule: "_models.ThresholdRuleV2",
        degraded_rule: Optional["_models.ThresholdRuleV2"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class HealthReportRequest(_Model):
    """Health report that's submitted for a specific signal.

    :ivar signal_name: Name of the entity signal to report health for. Required.
    :vartype signal_name: str
    :ivar health_state: Health state to report for the signal. Required. Known values are:
     "Healthy", "Degraded", "Unhealthy", "Unknown", and "Deleted".
    :vartype health_state: str or ~azure.mgmt.cloudhealth.models.HealthState
    :ivar value: Reported value of the signal.
    :vartype value: float
    :ivar evaluation_rules: Evaluation rules that were used to determine the reported health state.
    :vartype evaluation_rules: ~azure.mgmt.cloudhealth.models.HealthReportEvaluationRule
    :ivar expires_in_minutes: Number of minutes until the health report expires. Defaults to 60 (1
     hour) if not specified.
    :vartype expires_in_minutes: int
    :ivar additional_context: Optional additional context or description for the health report.
    :vartype additional_context: str
    """

    signal_name: str = rest_field(name="signalName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the entity signal to report health for. Required."""
    health_state: Union[str, "_models.HealthState"] = rest_field(
        name="healthState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Health state to report for the signal. Required. Known values are: \"Healthy\", \"Degraded\",
     \"Unhealthy\", \"Unknown\", and \"Deleted\"."""
    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Reported value of the signal."""
    evaluation_rules: Optional["_models.HealthReportEvaluationRule"] = rest_field(
        name="evaluationRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """Evaluation rules that were used to determine the reported health state."""
    expires_in_minutes: Optional[int] = rest_field(
        name="expiresInMinutes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Number of minutes until the health report expires. Defaults to 60 (1 hour) if not specified."""
    additional_context: Optional[str] = rest_field(
        name="additionalContext", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional additional context or description for the health report."""

    @overload
    def __init__(
        self,
        *,
        signal_name: str,
        health_state: Union[str, "_models.HealthState"],
        value: Optional[float] = None,
        evaluation_rules: Optional["_models.HealthReportEvaluationRule"] = None,
        expires_in_minutes: Optional[int] = None,
        additional_context: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class HealthStateTransition(_Model):
    """A health state transition record.

    :ivar previous_state: Previous health state before the transition. Required. Known values are:
     "Healthy", "Degraded", "Unhealthy", "Unknown", and "Deleted".
    :vartype previous_state: str or ~azure.mgmt.cloudhealth.models.HealthState
    :ivar new_state: New health state after the transition. Required. Known values are: "Healthy",
     "Degraded", "Unhealthy", "Unknown", and "Deleted".
    :vartype new_state: str or ~azure.mgmt.cloudhealth.models.HealthState
    :ivar occurred_at: Timestamp when the transition occurred. Required.
    :vartype occurred_at: ~datetime.datetime
    :ivar reason: Reason of the transition.
    :vartype reason: str
    """

    previous_state: Union[str, "_models.HealthState"] = rest_field(
        name="previousState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Previous health state before the transition. Required. Known values are: \"Healthy\",
     \"Degraded\", \"Unhealthy\", \"Unknown\", and \"Deleted\"."""
    new_state: Union[str, "_models.HealthState"] = rest_field(
        name="newState", visibility=["read", "create", "update", "delete", "query"]
    )
    """New health state after the transition. Required. Known values are: \"Healthy\", \"Degraded\",
     \"Unhealthy\", \"Unknown\", and \"Deleted\"."""
    occurred_at: datetime.datetime = rest_field(
        name="occurredAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Timestamp when the transition occurred. Required."""
    reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Reason of the transition."""

    @overload
    def __init__(
        self,
        *,
        previous_state: Union[str, "_models.HealthState"],
        new_state: Union[str, "_models.HealthState"],
        occurred_at: datetime.datetime,
        reason: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class IconDefinition(_Model):
    """Visual icon definition of an entity.

    :ivar icon_name: Name of the built-in icon, or 'Custom' to use customData. Required.
    :vartype icon_name: str
    :ivar custom_data: Custom data. Base64-encoded SVG data. If set, this overrides the built-in
     icon.
    :vartype custom_data: str
    """

    icon_name: str = rest_field(name="iconName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the built-in icon, or 'Custom' to use customData. Required."""
    custom_data: Optional[str] = rest_field(
        name="customData", visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom data. Base64-encoded SVG data. If set, this overrides the built-in icon."""

    @overload
    def __init__(
        self,
        *,
        icon_name: str,
        custom_data: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SignalDefinitionProperties(_Model):
    """SignalDefinition properties.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    ResourceMetricSignalDefinitionProperties, LogAnalyticsQuerySignalDefinitionProperties,
    PrometheusMetricsSignalDefinitionProperties

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Creating", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.cloudhealth.models.HealthModelProvisioningState
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar signal_kind: Kind of the signal definition. Required. Known values are:
     "AzureResourceMetric", "LogAnalyticsQuery", "PrometheusMetricsQuery", and "External".
    :vartype signal_kind: str or ~azure.mgmt.cloudhealth.models.SignalKind
    :ivar refresh_interval: Interval in which the signal is being evaluated. Defaults to PT1M (1
     minute). Known values are: "PT1M", "PT5M", "PT10M", "PT30M", "PT1H", and "PT2H".
    :vartype refresh_interval: str or ~azure.mgmt.cloudhealth.models.RefreshInterval
    :ivar tags: Optional set of tags (key-value pairs).
    :vartype tags: dict[str, str]
    :ivar data_unit: Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
    :vartype data_unit: str
    :ivar evaluation_rules: Evaluation rules for the signal definition. Required.
    :vartype evaluation_rules: ~azure.mgmt.cloudhealth.models.EvaluationRule
    """

    __mapping__: dict[str, _Model] = {}
    provisioning_state: Optional[Union[str, "_models.HealthModelProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\",
     \"Creating\", and \"Deleting\"."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    signal_kind: str = rest_discriminator(name="signalKind", visibility=["read", "create", "update", "delete", "query"])
    """Kind of the signal definition. Required. Known values are: \"AzureResourceMetric\",
     \"LogAnalyticsQuery\", \"PrometheusMetricsQuery\", and \"External\"."""
    refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = rest_field(
        name="refreshInterval", visibility=["read", "create", "update", "delete", "query"]
    )
    """Interval in which the signal is being evaluated. Defaults to PT1M (1 minute). Known values are:
     \"PT1M\", \"PT5M\", \"PT10M\", \"PT30M\", \"PT1H\", and \"PT2H\"."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Optional set of tags (key-value pairs)."""
    data_unit: Optional[str] = rest_field(name="dataUnit", visibility=["read", "create", "update", "delete", "query"])
    """Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count))."""
    evaluation_rules: "_models.EvaluationRule" = rest_field(
        name="evaluationRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """Evaluation rules for the signal definition. Required."""

    @overload
    def __init__(
        self,
        *,
        signal_kind: str,
        evaluation_rules: "_models.EvaluationRule",
        display_name: Optional[str] = None,
        refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = None,
        tags: Optional[dict[str, str]] = None,
        data_unit: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class LogAnalyticsQuerySignalDefinitionProperties(
    SignalDefinitionProperties, discriminator="LogAnalyticsQuery"
):  # pylint: disable=name-too-long
    """Log Analytics Query Signal Definition properties.

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Creating", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.cloudhealth.models.HealthModelProvisioningState
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar refresh_interval: Interval in which the signal is being evaluated. Defaults to PT1M (1
     minute). Known values are: "PT1M", "PT5M", "PT10M", "PT30M", "PT1H", and "PT2H".
    :vartype refresh_interval: str or ~azure.mgmt.cloudhealth.models.RefreshInterval
    :ivar tags: Optional set of tags (key-value pairs).
    :vartype tags: dict[str, str]
    :ivar data_unit: Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
    :vartype data_unit: str
    :ivar evaluation_rules: Evaluation rules for the signal definition. Required.
    :vartype evaluation_rules: ~azure.mgmt.cloudhealth.models.EvaluationRule
    :ivar signal_kind: Kind of the signal definition. Required. LOG_ANALYTICS_QUERY.
    :vartype signal_kind: str or ~azure.mgmt.cloudhealth.models.LOG_ANALYTICS_QUERY
    :ivar query_text: Query text in KQL syntax. Required.
    :vartype query_text: str
    :ivar time_grain: Time range of signal. ISO duration format like PT10M. If not specified, the
     KQL query must define a time range.
    :vartype time_grain: str
    :ivar value_column_name: Name of the column in the result set to evaluate against the
     thresholds. Defaults to the first column in the result set if not specified. The column must be
     numeric.
    :vartype value_column_name: str
    """

    signal_kind: Literal[SignalKind.LOG_ANALYTICS_QUERY] = rest_discriminator(name="signalKind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Kind of the signal definition. Required. LOG_ANALYTICS_QUERY."""
    query_text: str = rest_field(name="queryText", visibility=["read", "create", "update", "delete", "query"])
    """Query text in KQL syntax. Required."""
    time_grain: Optional[str] = rest_field(name="timeGrain", visibility=["read", "create", "update", "delete", "query"])
    """Time range of signal. ISO duration format like PT10M. If not specified, the KQL query must
     define a time range."""
    value_column_name: Optional[str] = rest_field(
        name="valueColumnName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the column in the result set to evaluate against the thresholds. Defaults to the first
     column in the result set if not specified. The column must be numeric."""

    @overload
    def __init__(
        self,
        *,
        evaluation_rules: "_models.EvaluationRule",
        query_text: str,
        display_name: Optional[str] = None,
        refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = None,
        tags: Optional[dict[str, str]] = None,
        data_unit: Optional[str] = None,
        time_grain: Optional[str] = None,
        value_column_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.signal_kind = SignalKind.LOG_ANALYTICS_QUERY  # type: ignore


class LogAnalyticsSignal(SignalInstanceProperties, discriminator="LogAnalyticsQuery"):
    """A Log Analytics Query signal instance assigned to an entity.

    :ivar name: Unique name of the signal within the entity. Required.
    :vartype name: str
    :ivar signal_definition_name: Optional reference to a signal definition that provides default
     values.
    :vartype signal_definition_name: str
    :ivar status: Current status of the signal.
    :vartype status: ~azure.mgmt.cloudhealth.models.SignalStatus
    :ivar signal_kind: Kind of the signal instance. Required. LOG_ANALYTICS_QUERY.
    :vartype signal_kind: str or ~azure.mgmt.cloudhealth.models.LOG_ANALYTICS_QUERY
    :ivar query_text: Query text in KQL syntax.
    :vartype query_text: str
    :ivar time_grain: Time range of signal. ISO duration format like PT10M. If not specified, the
     KQL query must define a time range.
    :vartype time_grain: str
    :ivar value_column_name: Name of the column in the result set to evaluate against the
     thresholds. Defaults to the first column in the result set if not specified. The column must be
     numeric.
    :vartype value_column_name: str
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar refresh_interval: Interval in which the signal is being evaluated. Defaults to PT1M (1
     minute). Known values are: "PT1M", "PT5M", "PT10M", "PT30M", "PT1H", and "PT2H".
    :vartype refresh_interval: str or ~azure.mgmt.cloudhealth.models.RefreshInterval
    :ivar data_unit: Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
    :vartype data_unit: str
    :ivar evaluation_rules: Evaluation rules for the signal definition.
    :vartype evaluation_rules: ~azure.mgmt.cloudhealth.models.EvaluationRule
    """

    signal_kind: Literal[SignalKind.LOG_ANALYTICS_QUERY] = rest_discriminator(name="signalKind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Kind of the signal instance. Required. LOG_ANALYTICS_QUERY."""
    query_text: Optional[str] = rest_field(name="queryText", visibility=["read", "create", "update", "delete", "query"])
    """Query text in KQL syntax."""
    time_grain: Optional[str] = rest_field(name="timeGrain", visibility=["read", "create", "update", "delete", "query"])
    """Time range of signal. ISO duration format like PT10M. If not specified, the KQL query must
     define a time range."""
    value_column_name: Optional[str] = rest_field(
        name="valueColumnName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the column in the result set to evaluate against the thresholds. Defaults to the first
     column in the result set if not specified. The column must be numeric."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = rest_field(
        name="refreshInterval", visibility=["read", "create", "update", "delete", "query"]
    )
    """Interval in which the signal is being evaluated. Defaults to PT1M (1 minute). Known values are:
     \"PT1M\", \"PT5M\", \"PT10M\", \"PT30M\", \"PT1H\", and \"PT2H\"."""
    data_unit: Optional[str] = rest_field(name="dataUnit", visibility=["read", "create", "update", "delete", "query"])
    """Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count))."""
    evaluation_rules: Optional["_models.EvaluationRule"] = rest_field(
        name="evaluationRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """Evaluation rules for the signal definition."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        signal_definition_name: Optional[str] = None,
        query_text: Optional[str] = None,
        time_grain: Optional[str] = None,
        value_column_name: Optional[str] = None,
        display_name: Optional[str] = None,
        refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = None,
        data_unit: Optional[str] = None,
        evaluation_rules: Optional["_models.EvaluationRule"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.signal_kind = SignalKind.LOG_ANALYTICS_QUERY  # type: ignore


class LogAnalyticsSignals(_Model):
    """A grouping of Log Analytics workspace signals.

    :ivar authentication_setting: Reference to the name of the authentication setting which is used
     for querying the data source. Required.
    :vartype authentication_setting: str
    :ivar log_analytics_workspace_resource_id: Log Analytics workspace resource ID. Required.
    :vartype log_analytics_workspace_resource_id: str
    :ivar signals: Signals assigned to this group.
    :vartype signals: list[~azure.mgmt.cloudhealth.models.LogAnalyticsSignal]
    """

    authentication_setting: str = rest_field(
        name="authenticationSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Reference to the name of the authentication setting which is used for querying the data source.
     Required."""
    log_analytics_workspace_resource_id: str = rest_field(
        name="logAnalyticsWorkspaceResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Log Analytics workspace resource ID. Required."""
    signals: Optional[list["_models.LogAnalyticsSignal"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Signals assigned to this group."""

    @overload
    def __init__(
        self,
        *,
        authentication_setting: str,
        log_analytics_workspace_resource_id: str,
        signals: Optional[list["_models.LogAnalyticsSignal"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ManagedIdentityAuthenticationSettingProperties(
    AuthenticationSettingProperties, discriminator="ManagedIdentity"
):  # pylint: disable=name-too-long
    """Authentication setting properties for Azure Managed Identity.

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Creating", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.cloudhealth.models.HealthModelProvisioningState
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar authentication_kind: Kind of the authentication setting. Required. MANAGED_IDENTITY.
    :vartype authentication_kind: str or ~azure.mgmt.cloudhealth.models.MANAGED_IDENTITY
    :ivar managed_identity_name: Name of the managed identity to use. Either 'SystemAssigned' or
     the resourceId of a user-assigned identity. Required.
    :vartype managed_identity_name: str
    """

    authentication_kind: Literal[AuthenticationKind.MANAGED_IDENTITY] = rest_discriminator(name="authenticationKind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Kind of the authentication setting. Required. MANAGED_IDENTITY."""
    managed_identity_name: str = rest_field(
        name="managedIdentityName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the managed identity to use. Either 'SystemAssigned' or the resourceId of a
     user-assigned identity. Required."""

    @overload
    def __init__(
        self,
        *,
        managed_identity_name: str,
        display_name: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.authentication_kind = AuthenticationKind.MANAGED_IDENTITY  # type: ignore


class ManagedServiceIdentity(_Model):
    """Managed service identity (system assigned and/or user assigned identities).

    :ivar principal_id: The service principal ID of the system assigned identity. This property
     will only be provided for a system assigned identity.
    :vartype principal_id: str
    :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be
     provided for a system assigned identity.
    :vartype tenant_id: str
    :ivar type: The type of managed identity assigned to this resource. Required. Known values are:
     "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned".
    :vartype type: str or ~azure.mgmt.cloudhealth.models.ManagedServiceIdentityType
    :ivar user_assigned_identities: The identities assigned to this resource by the user.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.cloudhealth.models.UserAssignedIdentity]
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """The service principal ID of the system assigned identity. This property will only be provided
     for a system assigned identity."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"])
    """The tenant ID of the system assigned identity. This property will only be provided for a system
     assigned identity."""
    type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of managed identity assigned to this resource. Required. Known values are: \"None\",
     \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\"."""
    user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field(
        name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identities assigned to this resource by the user."""

    @overload
    def __init__(
        self,
        *,
        type: Union[str, "_models.ManagedServiceIdentityType"],
        user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Operation(_Model):
    """REST API Operation.

    :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
     "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
    :vartype name: str
    :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for
     data-plane operations and "false" for Azure Resource Manager/control-plane operations.
    :vartype is_data_action: bool
    :ivar display: Localized display information for this particular operation.
    :vartype display: ~azure.mgmt.cloudhealth.models.OperationDisplay
    :ivar origin: The intended executor of the operation; as in Resource Based Access Control
     (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system",
     and "user,system".
    :vartype origin: str or ~azure.mgmt.cloudhealth.models.Origin
    :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions
     that are for internal only APIs. "Internal"
    :vartype action_type: str or ~azure.mgmt.cloudhealth.models.ActionType
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
     \"Microsoft.Compute/virtualMachines/write\",
     \"Microsoft.Compute/virtualMachines/capture/action\"."""
    is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"])
    """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and
     \"false\" for Azure Resource Manager/control-plane operations."""
    display: Optional["_models.OperationDisplay"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Localized display information for this particular operation."""
    origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"])
    """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit
     logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and
     \"user,system\"."""
    action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"])
    """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for
     internal only APIs. \"Internal\""""

    @overload
    def __init__(
        self,
        *,
        display: Optional["_models.OperationDisplay"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class OperationDisplay(_Model):
    """Localized display information for an operation.

    :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft
     Monitoring Insights" or "Microsoft Compute".
    :vartype provider: str
    :ivar resource: The localized friendly name of the resource type related to this operation.
     E.g. "Virtual Machines" or "Job Schedule Collections".
    :vartype resource: str
    :ivar operation: The concise, localized friendly name for the operation; suitable for
     dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
    :vartype operation: str
    :ivar description: The short, localized friendly description of the operation; suitable for
     tool tips and detailed views.
    :vartype description: str
    """

    provider: Optional[str] = rest_field(visibility=["read"])
    """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring
     Insights\" or \"Microsoft Compute\"."""
    resource: Optional[str] = rest_field(visibility=["read"])
    """The localized friendly name of the resource type related to this operation. E.g. \"Virtual
     Machines\" or \"Job Schedule Collections\"."""
    operation: Optional[str] = rest_field(visibility=["read"])
    """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create
     or Update Virtual Machine\", \"Restart Virtual Machine\"."""
    description: Optional[str] = rest_field(visibility=["read"])
    """The short, localized friendly description of the operation; suitable for tool tips and detailed
     views."""


class PrometheusMetricsSignal(SignalInstanceProperties, discriminator="PrometheusMetricsQuery"):
    """A Prometheus Metrics Query signal instance assigned to an entity.

    :ivar name: Unique name of the signal within the entity. Required.
    :vartype name: str
    :ivar signal_definition_name: Optional reference to a signal definition that provides default
     values.
    :vartype signal_definition_name: str
    :ivar status: Current status of the signal.
    :vartype status: ~azure.mgmt.cloudhealth.models.SignalStatus
    :ivar signal_kind: Kind of the signal instance. Required. PROMETHEUS_METRICS_QUERY.
    :vartype signal_kind: str or ~azure.mgmt.cloudhealth.models.PROMETHEUS_METRICS_QUERY
    :ivar query_text: Query text in PromQL syntax.
    :vartype query_text: str
    :ivar time_grain: Time range of signal. ISO duration format like PT10M.
    :vartype time_grain: str
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar refresh_interval: Interval in which the signal is being evaluated. Defaults to PT1M (1
     minute). Known values are: "PT1M", "PT5M", "PT10M", "PT30M", "PT1H", and "PT2H".
    :vartype refresh_interval: str or ~azure.mgmt.cloudhealth.models.RefreshInterval
    :ivar data_unit: Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
    :vartype data_unit: str
    :ivar evaluation_rules: Evaluation rules for the signal definition.
    :vartype evaluation_rules: ~azure.mgmt.cloudhealth.models.EvaluationRule
    """

    signal_kind: Literal[SignalKind.PROMETHEUS_METRICS_QUERY] = rest_discriminator(name="signalKind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Kind of the signal instance. Required. PROMETHEUS_METRICS_QUERY."""
    query_text: Optional[str] = rest_field(name="queryText", visibility=["read", "create", "update", "delete", "query"])
    """Query text in PromQL syntax."""
    time_grain: Optional[str] = rest_field(name="timeGrain", visibility=["read", "create", "update", "delete", "query"])
    """Time range of signal. ISO duration format like PT10M."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = rest_field(
        name="refreshInterval", visibility=["read", "create", "update", "delete", "query"]
    )
    """Interval in which the signal is being evaluated. Defaults to PT1M (1 minute). Known values are:
     \"PT1M\", \"PT5M\", \"PT10M\", \"PT30M\", \"PT1H\", and \"PT2H\"."""
    data_unit: Optional[str] = rest_field(name="dataUnit", visibility=["read", "create", "update", "delete", "query"])
    """Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count))."""
    evaluation_rules: Optional["_models.EvaluationRule"] = rest_field(
        name="evaluationRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """Evaluation rules for the signal definition."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        signal_definition_name: Optional[str] = None,
        query_text: Optional[str] = None,
        time_grain: Optional[str] = None,
        display_name: Optional[str] = None,
        refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = None,
        data_unit: Optional[str] = None,
        evaluation_rules: Optional["_models.EvaluationRule"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.signal_kind = SignalKind.PROMETHEUS_METRICS_QUERY  # type: ignore


class PrometheusMetricsSignalDefinitionProperties(
    SignalDefinitionProperties, discriminator="PrometheusMetricsQuery"
):  # pylint: disable=name-too-long
    """Prometheus Metrics Signal Definition properties.

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Creating", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.cloudhealth.models.HealthModelProvisioningState
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar refresh_interval: Interval in which the signal is being evaluated. Defaults to PT1M (1
     minute). Known values are: "PT1M", "PT5M", "PT10M", "PT30M", "PT1H", and "PT2H".
    :vartype refresh_interval: str or ~azure.mgmt.cloudhealth.models.RefreshInterval
    :ivar tags: Optional set of tags (key-value pairs).
    :vartype tags: dict[str, str]
    :ivar data_unit: Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
    :vartype data_unit: str
    :ivar evaluation_rules: Evaluation rules for the signal definition. Required.
    :vartype evaluation_rules: ~azure.mgmt.cloudhealth.models.EvaluationRule
    :ivar signal_kind: Kind of the signal definition. Required. PROMETHEUS_METRICS_QUERY.
    :vartype signal_kind: str or ~azure.mgmt.cloudhealth.models.PROMETHEUS_METRICS_QUERY
    :ivar query_text: Query text in PromQL syntax. Required.
    :vartype query_text: str
    :ivar time_grain: Time range of signal. ISO duration format like PT10M.
    :vartype time_grain: str
    """

    signal_kind: Literal[SignalKind.PROMETHEUS_METRICS_QUERY] = rest_discriminator(name="signalKind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Kind of the signal definition. Required. PROMETHEUS_METRICS_QUERY."""
    query_text: str = rest_field(name="queryText", visibility=["read", "create", "update", "delete", "query"])
    """Query text in PromQL syntax. Required."""
    time_grain: Optional[str] = rest_field(name="timeGrain", visibility=["read", "create", "update", "delete", "query"])
    """Time range of signal. ISO duration format like PT10M."""

    @overload
    def __init__(
        self,
        *,
        evaluation_rules: "_models.EvaluationRule",
        query_text: str,
        display_name: Optional[str] = None,
        refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = None,
        tags: Optional[dict[str, str]] = None,
        data_unit: Optional[str] = None,
        time_grain: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.signal_kind = SignalKind.PROMETHEUS_METRICS_QUERY  # type: ignore


class Relationship(ProxyResource):
    """A relationship (aka edge) between two entities in a health model.

    :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.cloudhealth.models.SystemData
    :ivar properties: The resource-specific properties for this resource.
    :vartype properties: ~azure.mgmt.cloudhealth.models.RelationshipProperties
    """

    properties: Optional["_models.RelationshipProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource-specific properties for this resource."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.RelationshipProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RelationshipProperties(_Model):
    """Relationship properties.

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Creating", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.cloudhealth.models.HealthModelProvisioningState
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar parent_entity_name: Resource name of the parent entity. Required.
    :vartype parent_entity_name: str
    :ivar child_entity_name: Resource name of the child entity. Required.
    :vartype child_entity_name: str
    :ivar tags: Optional set of tags (key-value pairs).
    :vartype tags: dict[str, str]
    :ivar discovered_by: Discovered by which discovery rule. If set, the relationship cannot be
     deleted manually.
    :vartype discovered_by: str
    """

    provisioning_state: Optional[Union[str, "_models.HealthModelProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\",
     \"Creating\", and \"Deleting\"."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name."""
    parent_entity_name: str = rest_field(name="parentEntityName", visibility=["read", "create"])
    """Resource name of the parent entity. Required."""
    child_entity_name: str = rest_field(name="childEntityName", visibility=["read", "create"])
    """Resource name of the child entity. Required."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Optional set of tags (key-value pairs)."""
    discovered_by: Optional[str] = rest_field(name="discoveredBy", visibility=["read"])
    """Discovered by which discovery rule. If set, the relationship cannot be deleted manually."""

    @overload
    def __init__(
        self,
        *,
        parent_entity_name: str,
        child_entity_name: str,
        display_name: Optional[str] = None,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ResourceGraphQuerySpecification(DiscoveryRuleSpecification, discriminator="ResourceGraphQuery"):
    """Discovery rule specification for an Azure Resource Graph query.

    :ivar kind: Kind of the discovery rule specification. Required. Azure Resource Graph query
     based discovery.
    :vartype kind: str or ~azure.mgmt.cloudhealth.models.RESOURCE_GRAPH_QUERY
    :ivar resource_graph_query: Azure Resource Graph query text in KQL syntax. The query must
     return at least a column named 'id' which contains the resource ID of the discovered resources.
     Required.
    :vartype resource_graph_query: str
    """

    kind: Literal[DiscoveryRuleKind.RESOURCE_GRAPH_QUERY] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Kind of the discovery rule specification. Required. Azure Resource Graph query based discovery."""
    resource_graph_query: str = rest_field(
        name="resourceGraphQuery", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Resource Graph query text in KQL syntax. The query must return at least a column named
     'id' which contains the resource ID of the discovered resources. Required."""

    @overload
    def __init__(
        self,
        *,
        resource_graph_query: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.kind = DiscoveryRuleKind.RESOURCE_GRAPH_QUERY  # type: ignore


class ResourceMetricSignalDefinitionProperties(SignalDefinitionProperties, discriminator="AzureResourceMetric"):
    """Azure Resource Metric Signal Definition properties.

    :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded",
     "Failed", "Canceled", "Creating", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.cloudhealth.models.HealthModelProvisioningState
    :ivar display_name: Display name.
    :vartype display_name: str
    :ivar refresh_interval: Interval in which the signal is being evaluated. Defaults to PT1M (1
     minute). Known values are: "PT1M", "PT5M", "PT10M", "PT30M", "PT1H", and "PT2H".
    :vartype refresh_interval: str or ~azure.mgmt.cloudhealth.models.RefreshInterval
    :ivar tags: Optional set of tags (key-value pairs).
    :vartype tags: dict[str, str]
    :ivar data_unit: Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
    :vartype data_unit: str
    :ivar evaluation_rules: Evaluation rules for the signal definition. Required.
    :vartype evaluation_rules: ~azure.mgmt.cloudhealth.models.EvaluationRule
    :ivar signal_kind: Kind of the signal definition. Required. AZURE_RESOURCE_METRIC.
    :vartype signal_kind: str or ~azure.mgmt.cloudhealth.models.AZURE_RESOURCE_METRIC
    :ivar metric_namespace: Metric namespace. Required.
    :vartype metric_namespace: str
    :ivar metric_name: Name of the metric. Required.
    :vartype metric_name: str
    :ivar time_grain: Time range of signal. ISO duration format like PT10M. Required.
    :vartype time_grain: str
    :ivar aggregation_type: Type of aggregation to apply to the metric. Required. Known values are:
     "None", "Average", "Count", "Minimum", "Maximum", and "Total".
    :vartype aggregation_type: str or ~azure.mgmt.cloudhealth.models.MetricAggregationType
    :ivar dimension: Optional: Dimension to split by.
    :vartype dimension: str
    :ivar dimension_filter: Optional: Dimension filter to apply to the dimension. Must only be set
     if also Dimension is set.
    :vartype dimension_filter: str
    """

    signal_kind: Literal[SignalKind.AZURE_RESOURCE_METRIC] = rest_discriminator(name="signalKind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Kind of the signal definition. Required. AZURE_RESOURCE_METRIC."""
    metric_namespace: str = rest_field(
        name="metricNamespace", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metric namespace. Required."""
    metric_name: str = rest_field(name="metricName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the metric. Required."""
    time_grain: str = rest_field(name="timeGrain", visibility=["read", "create", "update", "delete", "query"])
    """Time range of signal. ISO duration format like PT10M. Required."""
    aggregation_type: Union[str, "_models.MetricAggregationType"] = rest_field(
        name="aggregationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of aggregation to apply to the metric. Required. Known values are: \"None\", \"Average\",
     \"Count\", \"Minimum\", \"Maximum\", and \"Total\"."""
    dimension: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Optional: Dimension to split by."""
    dimension_filter: Optional[str] = rest_field(
        name="dimensionFilter", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional: Dimension filter to apply to the dimension. Must only be set if also Dimension is
     set."""

    @overload
    def __init__(
        self,
        *,
        evaluation_rules: "_models.EvaluationRule",
        metric_namespace: str,
        metric_name: str,
        time_grain: str,
        aggregation_type: Union[str, "_models.MetricAggregationType"],
        display_name: Optional[str] = None,
        refresh_interval: Optional[Union[str, "_models.RefreshInterval"]] = None,
        tags: Optional[dict[str, str]] = None,
        data_unit: Optional[str] = None,
        dimension: Optional[str] = None,
        dimension_filter: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.signal_kind = SignalKind.AZURE_RESOURCE_METRIC  # type: ignore


class SignalDefinition(ProxyResource):
    """A signal definition in a health model.

    :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.cloudhealth.models.SystemData
    :ivar properties: The resource-specific properties for this resource.
    :vartype properties: ~azure.mgmt.cloudhealth.models.SignalDefinitionProperties
    """

    properties: Optional["_models.SignalDefinitionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource-specific properties for this resource."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.SignalDefinitionProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SignalGroups(_Model):
    """Contains various signal groups that can be assigned to an entity.

    :ivar azure_resource: Azure Resource Signal Group.
    :vartype azure_resource: ~azure.mgmt.cloudhealth.models.AzureResourceSignals
    :ivar azure_log_analytics: Log Analytics Signal Group.
    :vartype azure_log_analytics: ~azure.mgmt.cloudhealth.models.LogAnalyticsSignals
    :ivar azure_monitor_workspace: Azure Monitor Workspace Signal Group.
    :vartype azure_monitor_workspace: ~azure.mgmt.cloudhealth.models.AzureMonitorWorkspaceSignals
    :ivar dependencies: Settings for dependency signals to control how the health state of child
     entities influences the health state of the parent entity.
    :vartype dependencies: ~azure.mgmt.cloudhealth.models.DependenciesSignalGroupV2
    :ivar external: List of signals which have been externally submitted for this entity.
    :vartype external: ~azure.mgmt.cloudhealth.models.ExternalSignalGroup
    """

    azure_resource: Optional["_models.AzureResourceSignals"] = rest_field(
        name="azureResource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Resource Signal Group."""
    azure_log_analytics: Optional["_models.LogAnalyticsSignals"] = rest_field(
        name="azureLogAnalytics", visibility=["read", "create", "update", "delete", "query"]
    )
    """Log Analytics Signal Group."""
    azure_monitor_workspace: Optional["_models.AzureMonitorWorkspaceSignals"] = rest_field(
        name="azureMonitorWorkspace", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Monitor Workspace Signal Group."""
    dependencies: Optional["_models.DependenciesSignalGroupV2"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Settings for dependency signals to control how the health state of child entities influences
     the health state of the parent entity."""
    external: Optional["_models.ExternalSignalGroup"] = rest_field(visibility=["read"])
    """List of signals which have been externally submitted for this entity."""

    @overload
    def __init__(
        self,
        *,
        azure_resource: Optional["_models.AzureResourceSignals"] = None,
        azure_log_analytics: Optional["_models.LogAnalyticsSignals"] = None,
        azure_monitor_workspace: Optional["_models.AzureMonitorWorkspaceSignals"] = None,
        dependencies: Optional["_models.DependenciesSignalGroupV2"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SignalHistoryDataPoint(_Model):
    """A data point in the signal time series.

    :ivar occurred_at: Timestamp of the data point. Required.
    :vartype occurred_at: ~datetime.datetime
    :ivar value: Signal value at this point in time.
    :vartype value: float
    :ivar health_state: Health state at this point in time. Required. Known values are: "Healthy",
     "Degraded", "Unhealthy", "Unknown", and "Deleted".
    :vartype health_state: str or ~azure.mgmt.cloudhealth.models.HealthState
    :ivar additional_context: Additional context as provided by the submitter.
    :vartype additional_context: str
    """

    occurred_at: datetime.datetime = rest_field(
        name="occurredAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Timestamp of the data point. Required."""
    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Signal value at this point in time."""
    health_state: Union[str, "_models.HealthState"] = rest_field(
        name="healthState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Health state at this point in time. Required. Known values are: \"Healthy\", \"Degraded\",
     \"Unhealthy\", \"Unknown\", and \"Deleted\"."""
    additional_context: Optional[str] = rest_field(
        name="additionalContext", visibility=["read", "create", "update", "delete", "query"]
    )
    """Additional context as provided by the submitter."""

    @overload
    def __init__(
        self,
        *,
        occurred_at: datetime.datetime,
        health_state: Union[str, "_models.HealthState"],
        value: Optional[float] = None,
        additional_context: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SignalHistoryRequest(_Model):
    """Request body for getting signal history.

    :ivar signal_name: Name of the signal to get history for. Required.
    :vartype signal_name: str
    :ivar start_at: Start time for the history query. Defaults to 24 hours ago if not specified.
    :vartype start_at: ~datetime.datetime
    :ivar end_at: End time for the history query. Defaults to now if not specified.
    :vartype end_at: ~datetime.datetime
    """

    signal_name: str = rest_field(name="signalName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the signal to get history for. Required."""
    start_at: Optional[datetime.datetime] = rest_field(
        name="startAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Start time for the history query. Defaults to 24 hours ago if not specified."""
    end_at: Optional[datetime.datetime] = rest_field(
        name="endAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """End time for the history query. Defaults to now if not specified."""

    @overload
    def __init__(
        self,
        *,
        signal_name: str,
        start_at: Optional[datetime.datetime] = None,
        end_at: Optional[datetime.datetime] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SignalHistoryResponse(_Model):
    """Response containing signal history.

    :ivar entity_name: Name of the entity. Required.
    :vartype entity_name: str
    :ivar signal_name: Name of the signal. Required.
    :vartype signal_name: str
    :ivar history: Signal history data points. Required.
    :vartype history: list[~azure.mgmt.cloudhealth.models.SignalHistoryDataPoint]
    """

    entity_name: str = rest_field(name="entityName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the entity. Required."""
    signal_name: str = rest_field(name="signalName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the signal. Required."""
    history: list["_models.SignalHistoryDataPoint"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Signal history data points. Required."""

    @overload
    def __init__(
        self,
        *,
        entity_name: str,
        signal_name: str,
        history: list["_models.SignalHistoryDataPoint"],
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SignalStatus(_Model):
    """Status of a signal.

    :ivar health_state: Health state of this signal. Known values are: "Healthy", "Degraded",
     "Unhealthy", "Unknown", and "Deleted".
    :vartype health_state: str or ~azure.mgmt.cloudhealth.models.HealthState
    :ivar value: Reported value of the signal.
    :vartype value: float
    :ivar reported_at: Timestamp when the value was reported.
    :vartype reported_at: ~datetime.datetime
    :ivar error: Error message if the signal status cannot be retrieved.
    :vartype error: str
    """

    health_state: Optional[Union[str, "_models.HealthState"]] = rest_field(name="healthState", visibility=["read"])
    """Health state of this signal. Known values are: \"Healthy\", \"Degraded\", \"Unhealthy\",
     \"Unknown\", and \"Deleted\"."""
    value: Optional[float] = rest_field(visibility=["read"])
    """Reported value of the signal."""
    reported_at: Optional[datetime.datetime] = rest_field(name="reportedAt", visibility=["read"], format="rfc3339")
    """Timestamp when the value was reported."""
    error: Optional[str] = rest_field(visibility=["read"])
    """Error message if the signal status cannot be retrieved."""


class SystemData(_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.cloudhealth.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.cloudhealth.models.CreatedByType
    :ivar last_modified_at: The timestamp of resource last modification (UTC).
    :vartype last_modified_at: ~datetime.datetime
    """

    created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"])
    """The identity that created the resource."""
    created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(
        name="createdByType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of identity that created the resource. Known values are: \"User\", \"Application\",
     \"ManagedIdentity\", and \"Key\"."""
    created_at: Optional[datetime.datetime] = rest_field(
        name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp of resource creation (UTC)."""
    last_modified_by: Optional[str] = rest_field(
        name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity that last modified the resource."""
    last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(
        name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of identity that last modified the resource. Known values are: \"User\",
     \"Application\", \"ManagedIdentity\", and \"Key\"."""
    last_modified_at: Optional[datetime.datetime] = rest_field(
        name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp of resource last modification (UTC)."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ThresholdRuleV2(_Model):
    """Threshold-based evaluation rule for a signal definition.

    :ivar operator: Operator how to compare the signal value with the threshold. Required. Known
     values are: "GreaterThan", "LessThan", "LessThanOrEqual", "GreaterThanOrEqual", "Equal", and
     "NotEqual".
    :vartype operator: str or ~azure.mgmt.cloudhealth.models.SignalOperator
    :ivar threshold: Threshold value. Required.
    :vartype threshold: float
    """

    operator: Union[str, "_models.SignalOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Operator how to compare the signal value with the threshold. Required. Known values are:
     \"GreaterThan\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThanOrEqual\", \"Equal\", and
     \"NotEqual\"."""
    threshold: float = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Threshold value. Required."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.SignalOperator"],
        threshold: float,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class UserAssignedIdentity(_Model):
    """User assigned identity properties.

    :ivar principal_id: The principal ID of the assigned identity.
    :vartype principal_id: str
    :ivar client_id: The client ID of the assigned identity.
    :vartype client_id: str
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """The principal ID of the assigned identity."""
    client_id: Optional[str] = rest_field(name="clientId", visibility=["read"])
    """The client ID of the assigned identity."""
