# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *

__all__ = [
    'ActionResponse',
    'ConditionResponse',
    'ConditionResponseFailingPeriods',
    'DimensionResponse',
    'ScheduledQueryRuleCriteriaResponse',
]

@pulumi.output_type
class ActionResponse(dict):
    """
    Actions to invoke when the alert fires.
    """
    @staticmethod
    def __key_warning(key: str):
        suggest = None
        if key == "actionGroupId":
            suggest = "action_group_id"
        elif key == "webHookProperties":
            suggest = "web_hook_properties"

        if suggest:
            pulumi.log.warn(f"Key '{key}' not found in ActionResponse. Access the value via the '{suggest}' property getter instead.")

    def __getitem__(self, key: str) -> Any:
        ActionResponse.__key_warning(key)
        return super().__getitem__(key)

    def get(self, key: str, default = None) -> Any:
        ActionResponse.__key_warning(key)
        return super().get(key, default)

    def __init__(__self__, *,
                 action_group_id: Optional[str] = None,
                 web_hook_properties: Optional[Mapping[str, str]] = None):
        """
        Actions to invoke when the alert fires.
        :param str action_group_id: Action Group resource Id to invoke when the alert fires.
        :param Mapping[str, str] web_hook_properties: The properties of a webhook object.
        """
        if action_group_id is not None:
            pulumi.set(__self__, "action_group_id", action_group_id)
        if web_hook_properties is not None:
            pulumi.set(__self__, "web_hook_properties", web_hook_properties)

    @property
    @pulumi.getter(name="actionGroupId")
    def action_group_id(self) -> Optional[str]:
        """
        Action Group resource Id to invoke when the alert fires.
        """
        return pulumi.get(self, "action_group_id")

    @property
    @pulumi.getter(name="webHookProperties")
    def web_hook_properties(self) -> Optional[Mapping[str, str]]:
        """
        The properties of a webhook object.
        """
        return pulumi.get(self, "web_hook_properties")


@pulumi.output_type
class ConditionResponse(dict):
    """
    A condition of the scheduled query rule.
    """
    @staticmethod
    def __key_warning(key: str):
        suggest = None
        if key == "timeAggregation":
            suggest = "time_aggregation"
        elif key == "failingPeriods":
            suggest = "failing_periods"
        elif key == "metricMeasureColumn":
            suggest = "metric_measure_column"
        elif key == "resourceIdColumn":
            suggest = "resource_id_column"

        if suggest:
            pulumi.log.warn(f"Key '{key}' not found in ConditionResponse. Access the value via the '{suggest}' property getter instead.")

    def __getitem__(self, key: str) -> Any:
        ConditionResponse.__key_warning(key)
        return super().__getitem__(key)

    def get(self, key: str, default = None) -> Any:
        ConditionResponse.__key_warning(key)
        return super().get(key, default)

    def __init__(__self__, *,
                 operator: str,
                 threshold: float,
                 time_aggregation: str,
                 dimensions: Optional[Sequence['outputs.DimensionResponse']] = None,
                 failing_periods: Optional['outputs.ConditionResponseFailingPeriods'] = None,
                 metric_measure_column: Optional[str] = None,
                 query: Optional[str] = None,
                 resource_id_column: Optional[str] = None):
        """
        A condition of the scheduled query rule.
        :param str operator: The criteria operator.
        :param float threshold: the criteria threshold value that activates the alert.
        :param str time_aggregation: Aggregation type
        :param Sequence['DimensionResponse'] dimensions: List of Dimensions conditions
        :param 'ConditionResponseFailingPeriods' failing_periods: The minimum number of violations required within the selected lookback time window required to raise an alert.
        :param str metric_measure_column: The column containing the metric measure number.
        :param str query: Log query alert
        :param str resource_id_column: The column containing the resource id. The content of the column must be a uri formatted as resource id
        """
        pulumi.set(__self__, "operator", operator)
        pulumi.set(__self__, "threshold", threshold)
        pulumi.set(__self__, "time_aggregation", time_aggregation)
        if dimensions is not None:
            pulumi.set(__self__, "dimensions", dimensions)
        if failing_periods is not None:
            pulumi.set(__self__, "failing_periods", failing_periods)
        if metric_measure_column is not None:
            pulumi.set(__self__, "metric_measure_column", metric_measure_column)
        if query is not None:
            pulumi.set(__self__, "query", query)
        if resource_id_column is not None:
            pulumi.set(__self__, "resource_id_column", resource_id_column)

    @property
    @pulumi.getter
    def operator(self) -> str:
        """
        The criteria operator.
        """
        return pulumi.get(self, "operator")

    @property
    @pulumi.getter
    def threshold(self) -> float:
        """
        the criteria threshold value that activates the alert.
        """
        return pulumi.get(self, "threshold")

    @property
    @pulumi.getter(name="timeAggregation")
    def time_aggregation(self) -> str:
        """
        Aggregation type
        """
        return pulumi.get(self, "time_aggregation")

    @property
    @pulumi.getter
    def dimensions(self) -> Optional[Sequence['outputs.DimensionResponse']]:
        """
        List of Dimensions conditions
        """
        return pulumi.get(self, "dimensions")

    @property
    @pulumi.getter(name="failingPeriods")
    def failing_periods(self) -> Optional['outputs.ConditionResponseFailingPeriods']:
        """
        The minimum number of violations required within the selected lookback time window required to raise an alert.
        """
        return pulumi.get(self, "failing_periods")

    @property
    @pulumi.getter(name="metricMeasureColumn")
    def metric_measure_column(self) -> Optional[str]:
        """
        The column containing the metric measure number.
        """
        return pulumi.get(self, "metric_measure_column")

    @property
    @pulumi.getter
    def query(self) -> Optional[str]:
        """
        Log query alert
        """
        return pulumi.get(self, "query")

    @property
    @pulumi.getter(name="resourceIdColumn")
    def resource_id_column(self) -> Optional[str]:
        """
        The column containing the resource id. The content of the column must be a uri formatted as resource id
        """
        return pulumi.get(self, "resource_id_column")


@pulumi.output_type
class ConditionResponseFailingPeriods(dict):
    """
    The minimum number of violations required within the selected lookback time window required to raise an alert.
    """
    @staticmethod
    def __key_warning(key: str):
        suggest = None
        if key == "minFailingPeriodsToAlert":
            suggest = "min_failing_periods_to_alert"
        elif key == "numberOfEvaluationPeriods":
            suggest = "number_of_evaluation_periods"

        if suggest:
            pulumi.log.warn(f"Key '{key}' not found in ConditionResponseFailingPeriods. Access the value via the '{suggest}' property getter instead.")

    def __getitem__(self, key: str) -> Any:
        ConditionResponseFailingPeriods.__key_warning(key)
        return super().__getitem__(key)

    def get(self, key: str, default = None) -> Any:
        ConditionResponseFailingPeriods.__key_warning(key)
        return super().get(key, default)

    def __init__(__self__, *,
                 min_failing_periods_to_alert: Optional[float] = None,
                 number_of_evaluation_periods: Optional[float] = None):
        """
        The minimum number of violations required within the selected lookback time window required to raise an alert.
        :param float min_failing_periods_to_alert: The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1
        :param float number_of_evaluation_periods: The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1
        """
        if min_failing_periods_to_alert is None:
            min_failing_periods_to_alert = 1
        if min_failing_periods_to_alert is not None:
            pulumi.set(__self__, "min_failing_periods_to_alert", min_failing_periods_to_alert)
        if number_of_evaluation_periods is None:
            number_of_evaluation_periods = 1
        if number_of_evaluation_periods is not None:
            pulumi.set(__self__, "number_of_evaluation_periods", number_of_evaluation_periods)

    @property
    @pulumi.getter(name="minFailingPeriodsToAlert")
    def min_failing_periods_to_alert(self) -> Optional[float]:
        """
        The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1
        """
        return pulumi.get(self, "min_failing_periods_to_alert")

    @property
    @pulumi.getter(name="numberOfEvaluationPeriods")
    def number_of_evaluation_periods(self) -> Optional[float]:
        """
        The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1
        """
        return pulumi.get(self, "number_of_evaluation_periods")


@pulumi.output_type
class DimensionResponse(dict):
    """
    Dimension splitting and filtering definition
    """
    def __init__(__self__, *,
                 name: str,
                 operator: str,
                 values: Sequence[str]):
        """
        Dimension splitting and filtering definition
        :param str name: Name of the dimension
        :param str operator: Operator for dimension values
        :param Sequence[str] values: List of dimension values
        """
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "operator", operator)
        pulumi.set(__self__, "values", values)

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Name of the dimension
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def operator(self) -> str:
        """
        Operator for dimension values
        """
        return pulumi.get(self, "operator")

    @property
    @pulumi.getter
    def values(self) -> Sequence[str]:
        """
        List of dimension values
        """
        return pulumi.get(self, "values")


@pulumi.output_type
class ScheduledQueryRuleCriteriaResponse(dict):
    """
    The rule criteria that defines the conditions of the scheduled query rule.
    """
    @staticmethod
    def __key_warning(key: str):
        suggest = None
        if key == "allOf":
            suggest = "all_of"

        if suggest:
            pulumi.log.warn(f"Key '{key}' not found in ScheduledQueryRuleCriteriaResponse. Access the value via the '{suggest}' property getter instead.")

    def __getitem__(self, key: str) -> Any:
        ScheduledQueryRuleCriteriaResponse.__key_warning(key)
        return super().__getitem__(key)

    def get(self, key: str, default = None) -> Any:
        ScheduledQueryRuleCriteriaResponse.__key_warning(key)
        return super().get(key, default)

    def __init__(__self__, *,
                 all_of: Optional[Sequence['outputs.ConditionResponse']] = None):
        """
        The rule criteria that defines the conditions of the scheduled query rule.
        :param Sequence['ConditionResponse'] all_of: A list of conditions to evaluate against the specified scopes
        """
        if all_of is not None:
            pulumi.set(__self__, "all_of", all_of)

    @property
    @pulumi.getter(name="allOf")
    def all_of(self) -> Optional[Sequence['outputs.ConditionResponse']]:
        """
        A list of conditions to evaluate against the specified scopes
        """
        return pulumi.get(self, "all_of")


