# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from . import _utilities, _tables
from . import outputs
from ._inputs import *

__all__ = ['AlertMutingRule']


class AlertMutingRule(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 detectors: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
                 filters: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['AlertMutingRuleFilterArgs']]]]] = None,
                 start_time: Optional[pulumi.Input[float]] = None,
                 stop_time: Optional[pulumi.Input[float]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Provides a SignalFx resource for managing alert muting rules. See [Mute Notifications](https://docs.signalfx.com/en/latest/detect-alert/mute-notifications.html) for more information.

        > **WARNING** SignalFx does not allow the start time of a **currently active** muting rule to be modified. As such, attempting to modify a currently active rule will destroy the existing rule and create a new rule. This may result in the emission of notifications.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_signalfx as signalfx

        rool_mooter_one = signalfx.AlertMutingRule("roolMooterOne",
            description="mooted it NEW",
            start_time=1573063243,
            stop_time=0,
            detectors=[signalfx_detector["some_detector_id"]],
            filters=[signalfx.AlertMutingRuleFilterArgs(
                property="foo",
                property_value="bar",
            )])
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] description: The description for this muting rule
        :param pulumi.Input[List[pulumi.Input[str]]] detectors: A convenience attribute that associated this muting rule with specific detector ids.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['AlertMutingRuleFilterArgs']]]] filters: Filters for this rule. See [Creating muting rules from scratch](https://docs.signalfx.com/en/latest/detect-alert/mute-notifications.html#rule-from-scratch) for more information.
        :param pulumi.Input[float] start_time: Starting time of an alert muting rule as a Unit time stamp in seconds.
        :param pulumi.Input[float] stop_time: Starting time of an alert muting rule as a Unix time stamp in seconds.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            if description is None:
                raise TypeError("Missing required property 'description'")
            __props__['description'] = description
            __props__['detectors'] = detectors
            if filters is None:
                raise TypeError("Missing required property 'filters'")
            __props__['filters'] = filters
            if start_time is None:
                raise TypeError("Missing required property 'start_time'")
            __props__['start_time'] = start_time
            __props__['stop_time'] = stop_time
            __props__['effective_start_time'] = None
        super(AlertMutingRule, __self__).__init__(
            'signalfx:index/alertMutingRule:AlertMutingRule',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            description: Optional[pulumi.Input[str]] = None,
            detectors: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
            effective_start_time: Optional[pulumi.Input[float]] = None,
            filters: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['AlertMutingRuleFilterArgs']]]]] = None,
            start_time: Optional[pulumi.Input[float]] = None,
            stop_time: Optional[pulumi.Input[float]] = None) -> 'AlertMutingRule':
        """
        Get an existing AlertMutingRule resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] description: The description for this muting rule
        :param pulumi.Input[List[pulumi.Input[str]]] detectors: A convenience attribute that associated this muting rule with specific detector ids.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['AlertMutingRuleFilterArgs']]]] filters: Filters for this rule. See [Creating muting rules from scratch](https://docs.signalfx.com/en/latest/detect-alert/mute-notifications.html#rule-from-scratch) for more information.
        :param pulumi.Input[float] start_time: Starting time of an alert muting rule as a Unit time stamp in seconds.
        :param pulumi.Input[float] stop_time: Starting time of an alert muting rule as a Unix time stamp in seconds.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["description"] = description
        __props__["detectors"] = detectors
        __props__["effective_start_time"] = effective_start_time
        __props__["filters"] = filters
        __props__["start_time"] = start_time
        __props__["stop_time"] = stop_time
        return AlertMutingRule(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[str]:
        """
        The description for this muting rule
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def detectors(self) -> pulumi.Output[Optional[List[str]]]:
        """
        A convenience attribute that associated this muting rule with specific detector ids.
        """
        return pulumi.get(self, "detectors")

    @property
    @pulumi.getter(name="effectiveStartTime")
    def effective_start_time(self) -> pulumi.Output[float]:
        return pulumi.get(self, "effective_start_time")

    @property
    @pulumi.getter
    def filters(self) -> pulumi.Output[List['outputs.AlertMutingRuleFilter']]:
        """
        Filters for this rule. See [Creating muting rules from scratch](https://docs.signalfx.com/en/latest/detect-alert/mute-notifications.html#rule-from-scratch) for more information.
        """
        return pulumi.get(self, "filters")

    @property
    @pulumi.getter(name="startTime")
    def start_time(self) -> pulumi.Output[float]:
        """
        Starting time of an alert muting rule as a Unit time stamp in seconds.
        """
        return pulumi.get(self, "start_time")

    @property
    @pulumi.getter(name="stopTime")
    def stop_time(self) -> pulumi.Output[Optional[float]]:
        """
        Starting time of an alert muting rule as a Unix time stamp in seconds.
        """
        return pulumi.get(self, "stop_time")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

