# 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 copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = ['SentryMetricAlertArgs', 'SentryMetricAlert']

@pulumi.input_type
class SentryMetricAlertArgs:
    def __init__(__self__, *,
                 aggregate: pulumi.Input[str],
                 organization: pulumi.Input[str],
                 project: pulumi.Input[str],
                 query: pulumi.Input[str],
                 threshold_type: pulumi.Input[int],
                 time_window: pulumi.Input[float],
                 triggers: pulumi.Input[Sequence[pulumi.Input['SentryMetricAlertTriggerArgs']]],
                 dataset: Optional[pulumi.Input[str]] = None,
                 environment: Optional[pulumi.Input[str]] = None,
                 event_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 owner: Optional[pulumi.Input[str]] = None,
                 resolve_threshold: Optional[pulumi.Input[float]] = None):
        """
        The set of arguments for constructing a SentryMetricAlert resource.
        :param pulumi.Input[str] aggregate: The aggregation criteria to apply
        :param pulumi.Input[str] organization: The slug of the organization the metric alert belongs to.
        :param pulumi.Input[str] project: The slug of the project to create the metric alert for.
        :param pulumi.Input[str] query: The query filter to apply
        :param pulumi.Input[int] threshold_type: The type of threshold
        :param pulumi.Input[float] time_window: The period to evaluate the Alert rule in minutes
        :param pulumi.Input[str] dataset: The Sentry Alert category
        :param pulumi.Input[str] environment: Perform Alert rule in a specific environment
        :param pulumi.Input[Sequence[pulumi.Input[str]]] event_types: The events type of dataset.
        :param pulumi.Input[str] name: The metric alert name.
        :param pulumi.Input[str] owner: Specifies the owner id of this Alert rule
        :param pulumi.Input[float] resolve_threshold: The value at which the Alert rule resolves
        """
        pulumi.set(__self__, "aggregate", aggregate)
        pulumi.set(__self__, "organization", organization)
        pulumi.set(__self__, "project", project)
        pulumi.set(__self__, "query", query)
        pulumi.set(__self__, "threshold_type", threshold_type)
        pulumi.set(__self__, "time_window", time_window)
        pulumi.set(__self__, "triggers", triggers)
        if dataset is not None:
            pulumi.set(__self__, "dataset", dataset)
        if environment is not None:
            pulumi.set(__self__, "environment", environment)
        if event_types is not None:
            pulumi.set(__self__, "event_types", event_types)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if owner is not None:
            pulumi.set(__self__, "owner", owner)
        if resolve_threshold is not None:
            pulumi.set(__self__, "resolve_threshold", resolve_threshold)

    @property
    @pulumi.getter
    def aggregate(self) -> pulumi.Input[str]:
        """
        The aggregation criteria to apply
        """
        return pulumi.get(self, "aggregate")

    @aggregate.setter
    def aggregate(self, value: pulumi.Input[str]):
        pulumi.set(self, "aggregate", value)

    @property
    @pulumi.getter
    def organization(self) -> pulumi.Input[str]:
        """
        The slug of the organization the metric alert belongs to.
        """
        return pulumi.get(self, "organization")

    @organization.setter
    def organization(self, value: pulumi.Input[str]):
        pulumi.set(self, "organization", value)

    @property
    @pulumi.getter
    def project(self) -> pulumi.Input[str]:
        """
        The slug of the project to create the metric alert for.
        """
        return pulumi.get(self, "project")

    @project.setter
    def project(self, value: pulumi.Input[str]):
        pulumi.set(self, "project", value)

    @property
    @pulumi.getter
    def query(self) -> pulumi.Input[str]:
        """
        The query filter to apply
        """
        return pulumi.get(self, "query")

    @query.setter
    def query(self, value: pulumi.Input[str]):
        pulumi.set(self, "query", value)

    @property
    @pulumi.getter(name="thresholdType")
    def threshold_type(self) -> pulumi.Input[int]:
        """
        The type of threshold
        """
        return pulumi.get(self, "threshold_type")

    @threshold_type.setter
    def threshold_type(self, value: pulumi.Input[int]):
        pulumi.set(self, "threshold_type", value)

    @property
    @pulumi.getter(name="timeWindow")
    def time_window(self) -> pulumi.Input[float]:
        """
        The period to evaluate the Alert rule in minutes
        """
        return pulumi.get(self, "time_window")

    @time_window.setter
    def time_window(self, value: pulumi.Input[float]):
        pulumi.set(self, "time_window", value)

    @property
    @pulumi.getter
    def triggers(self) -> pulumi.Input[Sequence[pulumi.Input['SentryMetricAlertTriggerArgs']]]:
        return pulumi.get(self, "triggers")

    @triggers.setter
    def triggers(self, value: pulumi.Input[Sequence[pulumi.Input['SentryMetricAlertTriggerArgs']]]):
        pulumi.set(self, "triggers", value)

    @property
    @pulumi.getter
    def dataset(self) -> Optional[pulumi.Input[str]]:
        """
        The Sentry Alert category
        """
        return pulumi.get(self, "dataset")

    @dataset.setter
    def dataset(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "dataset", value)

    @property
    @pulumi.getter
    def environment(self) -> Optional[pulumi.Input[str]]:
        """
        Perform Alert rule in a specific environment
        """
        return pulumi.get(self, "environment")

    @environment.setter
    def environment(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "environment", value)

    @property
    @pulumi.getter(name="eventTypes")
    def event_types(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        The events type of dataset.
        """
        return pulumi.get(self, "event_types")

    @event_types.setter
    def event_types(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "event_types", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The metric alert name.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter
    def owner(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the owner id of this Alert rule
        """
        return pulumi.get(self, "owner")

    @owner.setter
    def owner(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "owner", value)

    @property
    @pulumi.getter(name="resolveThreshold")
    def resolve_threshold(self) -> Optional[pulumi.Input[float]]:
        """
        The value at which the Alert rule resolves
        """
        return pulumi.get(self, "resolve_threshold")

    @resolve_threshold.setter
    def resolve_threshold(self, value: Optional[pulumi.Input[float]]):
        pulumi.set(self, "resolve_threshold", value)


@pulumi.input_type
class _SentryMetricAlertState:
    def __init__(__self__, *,
                 aggregate: Optional[pulumi.Input[str]] = None,
                 dataset: Optional[pulumi.Input[str]] = None,
                 environment: Optional[pulumi.Input[str]] = None,
                 event_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 internal_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 organization: Optional[pulumi.Input[str]] = None,
                 owner: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 query: Optional[pulumi.Input[str]] = None,
                 resolve_threshold: Optional[pulumi.Input[float]] = None,
                 threshold_type: Optional[pulumi.Input[int]] = None,
                 time_window: Optional[pulumi.Input[float]] = None,
                 triggers: Optional[pulumi.Input[Sequence[pulumi.Input['SentryMetricAlertTriggerArgs']]]] = None):
        """
        Input properties used for looking up and filtering SentryMetricAlert resources.
        :param pulumi.Input[str] aggregate: The aggregation criteria to apply
        :param pulumi.Input[str] dataset: The Sentry Alert category
        :param pulumi.Input[str] environment: Perform Alert rule in a specific environment
        :param pulumi.Input[Sequence[pulumi.Input[str]]] event_types: The events type of dataset.
        :param pulumi.Input[str] internal_id: The internal ID for this metric alert.
        :param pulumi.Input[str] name: The metric alert name.
        :param pulumi.Input[str] organization: The slug of the organization the metric alert belongs to.
        :param pulumi.Input[str] owner: Specifies the owner id of this Alert rule
        :param pulumi.Input[str] project: The slug of the project to create the metric alert for.
        :param pulumi.Input[str] query: The query filter to apply
        :param pulumi.Input[float] resolve_threshold: The value at which the Alert rule resolves
        :param pulumi.Input[int] threshold_type: The type of threshold
        :param pulumi.Input[float] time_window: The period to evaluate the Alert rule in minutes
        """
        if aggregate is not None:
            pulumi.set(__self__, "aggregate", aggregate)
        if dataset is not None:
            pulumi.set(__self__, "dataset", dataset)
        if environment is not None:
            pulumi.set(__self__, "environment", environment)
        if event_types is not None:
            pulumi.set(__self__, "event_types", event_types)
        if internal_id is not None:
            pulumi.set(__self__, "internal_id", internal_id)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if organization is not None:
            pulumi.set(__self__, "organization", organization)
        if owner is not None:
            pulumi.set(__self__, "owner", owner)
        if project is not None:
            pulumi.set(__self__, "project", project)
        if query is not None:
            pulumi.set(__self__, "query", query)
        if resolve_threshold is not None:
            pulumi.set(__self__, "resolve_threshold", resolve_threshold)
        if threshold_type is not None:
            pulumi.set(__self__, "threshold_type", threshold_type)
        if time_window is not None:
            pulumi.set(__self__, "time_window", time_window)
        if triggers is not None:
            pulumi.set(__self__, "triggers", triggers)

    @property
    @pulumi.getter
    def aggregate(self) -> Optional[pulumi.Input[str]]:
        """
        The aggregation criteria to apply
        """
        return pulumi.get(self, "aggregate")

    @aggregate.setter
    def aggregate(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "aggregate", value)

    @property
    @pulumi.getter
    def dataset(self) -> Optional[pulumi.Input[str]]:
        """
        The Sentry Alert category
        """
        return pulumi.get(self, "dataset")

    @dataset.setter
    def dataset(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "dataset", value)

    @property
    @pulumi.getter
    def environment(self) -> Optional[pulumi.Input[str]]:
        """
        Perform Alert rule in a specific environment
        """
        return pulumi.get(self, "environment")

    @environment.setter
    def environment(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "environment", value)

    @property
    @pulumi.getter(name="eventTypes")
    def event_types(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        The events type of dataset.
        """
        return pulumi.get(self, "event_types")

    @event_types.setter
    def event_types(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "event_types", value)

    @property
    @pulumi.getter(name="internalId")
    def internal_id(self) -> Optional[pulumi.Input[str]]:
        """
        The internal ID for this metric alert.
        """
        return pulumi.get(self, "internal_id")

    @internal_id.setter
    def internal_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "internal_id", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The metric alert name.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter
    def organization(self) -> Optional[pulumi.Input[str]]:
        """
        The slug of the organization the metric alert belongs to.
        """
        return pulumi.get(self, "organization")

    @organization.setter
    def organization(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "organization", value)

    @property
    @pulumi.getter
    def owner(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the owner id of this Alert rule
        """
        return pulumi.get(self, "owner")

    @owner.setter
    def owner(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "owner", value)

    @property
    @pulumi.getter
    def project(self) -> Optional[pulumi.Input[str]]:
        """
        The slug of the project to create the metric alert for.
        """
        return pulumi.get(self, "project")

    @project.setter
    def project(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "project", value)

    @property
    @pulumi.getter
    def query(self) -> Optional[pulumi.Input[str]]:
        """
        The query filter to apply
        """
        return pulumi.get(self, "query")

    @query.setter
    def query(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "query", value)

    @property
    @pulumi.getter(name="resolveThreshold")
    def resolve_threshold(self) -> Optional[pulumi.Input[float]]:
        """
        The value at which the Alert rule resolves
        """
        return pulumi.get(self, "resolve_threshold")

    @resolve_threshold.setter
    def resolve_threshold(self, value: Optional[pulumi.Input[float]]):
        pulumi.set(self, "resolve_threshold", value)

    @property
    @pulumi.getter(name="thresholdType")
    def threshold_type(self) -> Optional[pulumi.Input[int]]:
        """
        The type of threshold
        """
        return pulumi.get(self, "threshold_type")

    @threshold_type.setter
    def threshold_type(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "threshold_type", value)

    @property
    @pulumi.getter(name="timeWindow")
    def time_window(self) -> Optional[pulumi.Input[float]]:
        """
        The period to evaluate the Alert rule in minutes
        """
        return pulumi.get(self, "time_window")

    @time_window.setter
    def time_window(self, value: Optional[pulumi.Input[float]]):
        pulumi.set(self, "time_window", value)

    @property
    @pulumi.getter
    def triggers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['SentryMetricAlertTriggerArgs']]]]:
        return pulumi.get(self, "triggers")

    @triggers.setter
    def triggers(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['SentryMetricAlertTriggerArgs']]]]):
        pulumi.set(self, "triggers", value)


class SentryMetricAlert(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 aggregate: Optional[pulumi.Input[str]] = None,
                 dataset: Optional[pulumi.Input[str]] = None,
                 environment: Optional[pulumi.Input[str]] = None,
                 event_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 organization: Optional[pulumi.Input[str]] = None,
                 owner: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 query: Optional[pulumi.Input[str]] = None,
                 resolve_threshold: Optional[pulumi.Input[float]] = None,
                 threshold_type: Optional[pulumi.Input[int]] = None,
                 time_window: Optional[pulumi.Input[float]] = None,
                 triggers: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SentryMetricAlertTriggerArgs', 'SentryMetricAlertTriggerArgsDict']]]]] = None,
                 __props__=None):
        """
        Sentry Metric Alert resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_sentry as sentry
        import pulumiverse_sentry as sentry

        slack = sentry.get_sentry_organization_integration(organization=main_sentry_project["organization"],
            provider_key="slack",
            name="Slack Workspace")
        main = sentry.SentryMetricAlert("main",
            organization=main_sentry_project["organization"],
            project=main_sentry_project["id"],
            name="My metric alert",
            dataset="events",
            query="",
            aggregate="count()",
            time_window=60,
            threshold_type=0,
            resolve_threshold=0,
            triggers=[
                {
                    "actions": [{
                        "type": "email",
                        "target_type": "team",
                        "target_identifier": main_sentry_team["teamId"],
                    }],
                    "alert_threshold": 300,
                    "label": "critical",
                    "threshold_type": 0,
                },
                {
                    "actions": [{
                        "type": "slack",
                        "target_type": "specific",
                        "target_identifier": "#slack-channel",
                        "integration_id": slack.id,
                    }],
                    "alert_threshold": 300,
                    "label": "critical",
                    "threshold_type": 0,
                },
                {
                    "alert_threshold": 100,
                    "label": "warning",
                    "threshold_type": 0,
                },
            ])
        ```

        ## Import

        import using the organization, project slugs and rule id from the URL:

        https://sentry.io/organizations/[org-slug]/projects/[project-slug]/

        https://sentry.io/organizations/[org-slug]/alerts/rules/details/[rule-id]/

        or

        https://sentry.io/organizations/[org-slug]/alerts/metric-rules/[project-slug]/[rule-id]/

        ```sh
        $ pulumi import sentry:index/sentryMetricAlert:SentryMetricAlert default org-slug/project-slug/rule-id
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] aggregate: The aggregation criteria to apply
        :param pulumi.Input[str] dataset: The Sentry Alert category
        :param pulumi.Input[str] environment: Perform Alert rule in a specific environment
        :param pulumi.Input[Sequence[pulumi.Input[str]]] event_types: The events type of dataset.
        :param pulumi.Input[str] name: The metric alert name.
        :param pulumi.Input[str] organization: The slug of the organization the metric alert belongs to.
        :param pulumi.Input[str] owner: Specifies the owner id of this Alert rule
        :param pulumi.Input[str] project: The slug of the project to create the metric alert for.
        :param pulumi.Input[str] query: The query filter to apply
        :param pulumi.Input[float] resolve_threshold: The value at which the Alert rule resolves
        :param pulumi.Input[int] threshold_type: The type of threshold
        :param pulumi.Input[float] time_window: The period to evaluate the Alert rule in minutes
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: SentryMetricAlertArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Sentry Metric Alert resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_sentry as sentry
        import pulumiverse_sentry as sentry

        slack = sentry.get_sentry_organization_integration(organization=main_sentry_project["organization"],
            provider_key="slack",
            name="Slack Workspace")
        main = sentry.SentryMetricAlert("main",
            organization=main_sentry_project["organization"],
            project=main_sentry_project["id"],
            name="My metric alert",
            dataset="events",
            query="",
            aggregate="count()",
            time_window=60,
            threshold_type=0,
            resolve_threshold=0,
            triggers=[
                {
                    "actions": [{
                        "type": "email",
                        "target_type": "team",
                        "target_identifier": main_sentry_team["teamId"],
                    }],
                    "alert_threshold": 300,
                    "label": "critical",
                    "threshold_type": 0,
                },
                {
                    "actions": [{
                        "type": "slack",
                        "target_type": "specific",
                        "target_identifier": "#slack-channel",
                        "integration_id": slack.id,
                    }],
                    "alert_threshold": 300,
                    "label": "critical",
                    "threshold_type": 0,
                },
                {
                    "alert_threshold": 100,
                    "label": "warning",
                    "threshold_type": 0,
                },
            ])
        ```

        ## Import

        import using the organization, project slugs and rule id from the URL:

        https://sentry.io/organizations/[org-slug]/projects/[project-slug]/

        https://sentry.io/organizations/[org-slug]/alerts/rules/details/[rule-id]/

        or

        https://sentry.io/organizations/[org-slug]/alerts/metric-rules/[project-slug]/[rule-id]/

        ```sh
        $ pulumi import sentry:index/sentryMetricAlert:SentryMetricAlert default org-slug/project-slug/rule-id
        ```

        :param str resource_name: The name of the resource.
        :param SentryMetricAlertArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(SentryMetricAlertArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 aggregate: Optional[pulumi.Input[str]] = None,
                 dataset: Optional[pulumi.Input[str]] = None,
                 environment: Optional[pulumi.Input[str]] = None,
                 event_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 organization: Optional[pulumi.Input[str]] = None,
                 owner: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 query: Optional[pulumi.Input[str]] = None,
                 resolve_threshold: Optional[pulumi.Input[float]] = None,
                 threshold_type: Optional[pulumi.Input[int]] = None,
                 time_window: Optional[pulumi.Input[float]] = None,
                 triggers: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SentryMetricAlertTriggerArgs', 'SentryMetricAlertTriggerArgsDict']]]]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        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__ = SentryMetricAlertArgs.__new__(SentryMetricAlertArgs)

            if aggregate is None and not opts.urn:
                raise TypeError("Missing required property 'aggregate'")
            __props__.__dict__["aggregate"] = aggregate
            __props__.__dict__["dataset"] = dataset
            __props__.__dict__["environment"] = environment
            __props__.__dict__["event_types"] = event_types
            __props__.__dict__["name"] = name
            if organization is None and not opts.urn:
                raise TypeError("Missing required property 'organization'")
            __props__.__dict__["organization"] = organization
            __props__.__dict__["owner"] = owner
            if project is None and not opts.urn:
                raise TypeError("Missing required property 'project'")
            __props__.__dict__["project"] = project
            if query is None and not opts.urn:
                raise TypeError("Missing required property 'query'")
            __props__.__dict__["query"] = query
            __props__.__dict__["resolve_threshold"] = resolve_threshold
            if threshold_type is None and not opts.urn:
                raise TypeError("Missing required property 'threshold_type'")
            __props__.__dict__["threshold_type"] = threshold_type
            if time_window is None and not opts.urn:
                raise TypeError("Missing required property 'time_window'")
            __props__.__dict__["time_window"] = time_window
            if triggers is None and not opts.urn:
                raise TypeError("Missing required property 'triggers'")
            __props__.__dict__["triggers"] = triggers
            __props__.__dict__["internal_id"] = None
        super(SentryMetricAlert, __self__).__init__(
            'sentry:index/sentryMetricAlert:SentryMetricAlert',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            aggregate: Optional[pulumi.Input[str]] = None,
            dataset: Optional[pulumi.Input[str]] = None,
            environment: Optional[pulumi.Input[str]] = None,
            event_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            internal_id: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            organization: Optional[pulumi.Input[str]] = None,
            owner: Optional[pulumi.Input[str]] = None,
            project: Optional[pulumi.Input[str]] = None,
            query: Optional[pulumi.Input[str]] = None,
            resolve_threshold: Optional[pulumi.Input[float]] = None,
            threshold_type: Optional[pulumi.Input[int]] = None,
            time_window: Optional[pulumi.Input[float]] = None,
            triggers: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SentryMetricAlertTriggerArgs', 'SentryMetricAlertTriggerArgsDict']]]]] = None) -> 'SentryMetricAlert':
        """
        Get an existing SentryMetricAlert 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] aggregate: The aggregation criteria to apply
        :param pulumi.Input[str] dataset: The Sentry Alert category
        :param pulumi.Input[str] environment: Perform Alert rule in a specific environment
        :param pulumi.Input[Sequence[pulumi.Input[str]]] event_types: The events type of dataset.
        :param pulumi.Input[str] internal_id: The internal ID for this metric alert.
        :param pulumi.Input[str] name: The metric alert name.
        :param pulumi.Input[str] organization: The slug of the organization the metric alert belongs to.
        :param pulumi.Input[str] owner: Specifies the owner id of this Alert rule
        :param pulumi.Input[str] project: The slug of the project to create the metric alert for.
        :param pulumi.Input[str] query: The query filter to apply
        :param pulumi.Input[float] resolve_threshold: The value at which the Alert rule resolves
        :param pulumi.Input[int] threshold_type: The type of threshold
        :param pulumi.Input[float] time_window: The period to evaluate the Alert rule in minutes
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _SentryMetricAlertState.__new__(_SentryMetricAlertState)

        __props__.__dict__["aggregate"] = aggregate
        __props__.__dict__["dataset"] = dataset
        __props__.__dict__["environment"] = environment
        __props__.__dict__["event_types"] = event_types
        __props__.__dict__["internal_id"] = internal_id
        __props__.__dict__["name"] = name
        __props__.__dict__["organization"] = organization
        __props__.__dict__["owner"] = owner
        __props__.__dict__["project"] = project
        __props__.__dict__["query"] = query
        __props__.__dict__["resolve_threshold"] = resolve_threshold
        __props__.__dict__["threshold_type"] = threshold_type
        __props__.__dict__["time_window"] = time_window
        __props__.__dict__["triggers"] = triggers
        return SentryMetricAlert(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def aggregate(self) -> pulumi.Output[str]:
        """
        The aggregation criteria to apply
        """
        return pulumi.get(self, "aggregate")

    @property
    @pulumi.getter
    def dataset(self) -> pulumi.Output[Optional[str]]:
        """
        The Sentry Alert category
        """
        return pulumi.get(self, "dataset")

    @property
    @pulumi.getter
    def environment(self) -> pulumi.Output[str]:
        """
        Perform Alert rule in a specific environment
        """
        return pulumi.get(self, "environment")

    @property
    @pulumi.getter(name="eventTypes")
    def event_types(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        The events type of dataset.
        """
        return pulumi.get(self, "event_types")

    @property
    @pulumi.getter(name="internalId")
    def internal_id(self) -> pulumi.Output[str]:
        """
        The internal ID for this metric alert.
        """
        return pulumi.get(self, "internal_id")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        The metric alert name.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def organization(self) -> pulumi.Output[str]:
        """
        The slug of the organization the metric alert belongs to.
        """
        return pulumi.get(self, "organization")

    @property
    @pulumi.getter
    def owner(self) -> pulumi.Output[str]:
        """
        Specifies the owner id of this Alert rule
        """
        return pulumi.get(self, "owner")

    @property
    @pulumi.getter
    def project(self) -> pulumi.Output[str]:
        """
        The slug of the project to create the metric alert for.
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter
    def query(self) -> pulumi.Output[str]:
        """
        The query filter to apply
        """
        return pulumi.get(self, "query")

    @property
    @pulumi.getter(name="resolveThreshold")
    def resolve_threshold(self) -> pulumi.Output[Optional[float]]:
        """
        The value at which the Alert rule resolves
        """
        return pulumi.get(self, "resolve_threshold")

    @property
    @pulumi.getter(name="thresholdType")
    def threshold_type(self) -> pulumi.Output[int]:
        """
        The type of threshold
        """
        return pulumi.get(self, "threshold_type")

    @property
    @pulumi.getter(name="timeWindow")
    def time_window(self) -> pulumi.Output[float]:
        """
        The period to evaluate the Alert rule in minutes
        """
        return pulumi.get(self, "time_window")

    @property
    @pulumi.getter
    def triggers(self) -> pulumi.Output[Sequence['outputs.SentryMetricAlertTrigger']]:
        return pulumi.get(self, "triggers")

