# 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

__all__ = [
    'GetSentryIssueAlertResult',
    'AwaitableGetSentryIssueAlertResult',
    'get_sentry_issue_alert',
    'get_sentry_issue_alert_output',
]

@pulumi.output_type
class GetSentryIssueAlertResult:
    """
    A collection of values returned by getSentryIssueAlert.
    """
    def __init__(__self__, action_match=None, actions=None, conditions=None, environment=None, filter_match=None, filters=None, frequency=None, id=None, internal_id=None, name=None, organization=None, project=None):
        if action_match and not isinstance(action_match, str):
            raise TypeError("Expected argument 'action_match' to be a str")
        pulumi.set(__self__, "action_match", action_match)
        if actions and not isinstance(actions, list):
            raise TypeError("Expected argument 'actions' to be a list")
        pulumi.set(__self__, "actions", actions)
        if conditions and not isinstance(conditions, list):
            raise TypeError("Expected argument 'conditions' to be a list")
        pulumi.set(__self__, "conditions", conditions)
        if environment and not isinstance(environment, str):
            raise TypeError("Expected argument 'environment' to be a str")
        pulumi.set(__self__, "environment", environment)
        if filter_match and not isinstance(filter_match, str):
            raise TypeError("Expected argument 'filter_match' to be a str")
        pulumi.set(__self__, "filter_match", filter_match)
        if filters and not isinstance(filters, list):
            raise TypeError("Expected argument 'filters' to be a list")
        pulumi.set(__self__, "filters", filters)
        if frequency and not isinstance(frequency, int):
            raise TypeError("Expected argument 'frequency' to be a int")
        pulumi.set(__self__, "frequency", frequency)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if internal_id and not isinstance(internal_id, str):
            raise TypeError("Expected argument 'internal_id' to be a str")
        pulumi.set(__self__, "internal_id", internal_id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if organization and not isinstance(organization, str):
            raise TypeError("Expected argument 'organization' to be a str")
        pulumi.set(__self__, "organization", organization)
        if project and not isinstance(project, str):
            raise TypeError("Expected argument 'project' to be a str")
        pulumi.set(__self__, "project", project)

    @property
    @pulumi.getter(name="actionMatch")
    def action_match(self) -> str:
        """
        Trigger actions when an event is captured by Sentry and `any` or `all` of the specified conditions happen.
        """
        return pulumi.get(self, "action_match")

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

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

    @property
    @pulumi.getter
    def environment(self) -> str:
        """
        Perform issue alert in a specific environment.
        """
        return pulumi.get(self, "environment")

    @property
    @pulumi.getter(name="filterMatch")
    def filter_match(self) -> str:
        """
        Trigger actions if `all`, `any`, or `none` of the specified filters match.
        """
        return pulumi.get(self, "filter_match")

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

    @property
    @pulumi.getter
    def frequency(self) -> int:
        """
        Perform actions at most once every `X` minutes for this issue. Defaults to `30`.
        """
        return pulumi.get(self, "frequency")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

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

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

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

    @property
    @pulumi.getter
    def project(self) -> str:
        """
        The slug of the project the issue alert belongs to.
        """
        return pulumi.get(self, "project")


class AwaitableGetSentryIssueAlertResult(GetSentryIssueAlertResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSentryIssueAlertResult(
            action_match=self.action_match,
            actions=self.actions,
            conditions=self.conditions,
            environment=self.environment,
            filter_match=self.filter_match,
            filters=self.filters,
            frequency=self.frequency,
            id=self.id,
            internal_id=self.internal_id,
            name=self.name,
            organization=self.organization,
            project=self.project)


def get_sentry_issue_alert(internal_id: Optional[str] = None,
                           organization: Optional[str] = None,
                           project: Optional[str] = None,
                           opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSentryIssueAlertResult:
    """
    Sentry Issue Alert data source. As the object structure of `conditions`, `filters`, and `actions` are undocumented, a tip is to set up an Issue Alert via the Web UI, and use this data source to copy its object structure to your resources.

    ## Example Usage

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

    # Retrieve an Issue Alert
    # URL format: https://sentry.io/organizations/[organization]/alerts/rules/[project]/[internal_id]/details/
    original = sentry.get_sentry_issue_alert(organization="my-organization",
        project="my-project",
        internal_id="42")
    # Create a copy of an Issue Alert
    copy = sentry.SentryIssueAlert("copy",
        organization=original.organization,
        project=original.project,
        name=f"{original.name}-copy",
        action_match=original.action_match,
        filter_match=original.filter_match,
        frequency=original.frequency,
        conditions=original.conditions,
        filters=original.filters,
        actions=original.actions)
    ```


    :param str internal_id: The internal ID for this issue alert.
    :param str organization: The slug of the organization the issue alert belongs to.
    :param str project: The slug of the project the issue alert belongs to.
    """
    __args__ = dict()
    __args__['internalId'] = internal_id
    __args__['organization'] = organization
    __args__['project'] = project
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('sentry:index/getSentryIssueAlert:getSentryIssueAlert', __args__, opts=opts, typ=GetSentryIssueAlertResult).value

    return AwaitableGetSentryIssueAlertResult(
        action_match=pulumi.get(__ret__, 'action_match'),
        actions=pulumi.get(__ret__, 'actions'),
        conditions=pulumi.get(__ret__, 'conditions'),
        environment=pulumi.get(__ret__, 'environment'),
        filter_match=pulumi.get(__ret__, 'filter_match'),
        filters=pulumi.get(__ret__, 'filters'),
        frequency=pulumi.get(__ret__, 'frequency'),
        id=pulumi.get(__ret__, 'id'),
        internal_id=pulumi.get(__ret__, 'internal_id'),
        name=pulumi.get(__ret__, 'name'),
        organization=pulumi.get(__ret__, 'organization'),
        project=pulumi.get(__ret__, 'project'))
def get_sentry_issue_alert_output(internal_id: Optional[pulumi.Input[str]] = None,
                                  organization: Optional[pulumi.Input[str]] = None,
                                  project: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetSentryIssueAlertResult]:
    """
    Sentry Issue Alert data source. As the object structure of `conditions`, `filters`, and `actions` are undocumented, a tip is to set up an Issue Alert via the Web UI, and use this data source to copy its object structure to your resources.

    ## Example Usage

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

    # Retrieve an Issue Alert
    # URL format: https://sentry.io/organizations/[organization]/alerts/rules/[project]/[internal_id]/details/
    original = sentry.get_sentry_issue_alert(organization="my-organization",
        project="my-project",
        internal_id="42")
    # Create a copy of an Issue Alert
    copy = sentry.SentryIssueAlert("copy",
        organization=original.organization,
        project=original.project,
        name=f"{original.name}-copy",
        action_match=original.action_match,
        filter_match=original.filter_match,
        frequency=original.frequency,
        conditions=original.conditions,
        filters=original.filters,
        actions=original.actions)
    ```


    :param str internal_id: The internal ID for this issue alert.
    :param str organization: The slug of the organization the issue alert belongs to.
    :param str project: The slug of the project the issue alert belongs to.
    """
    __args__ = dict()
    __args__['internalId'] = internal_id
    __args__['organization'] = organization
    __args__['project'] = project
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('sentry:index/getSentryIssueAlert:getSentryIssueAlert', __args__, opts=opts, typ=GetSentryIssueAlertResult)
    return __ret__.apply(lambda __response__: GetSentryIssueAlertResult(
        action_match=pulumi.get(__response__, 'action_match'),
        actions=pulumi.get(__response__, 'actions'),
        conditions=pulumi.get(__response__, 'conditions'),
        environment=pulumi.get(__response__, 'environment'),
        filter_match=pulumi.get(__response__, 'filter_match'),
        filters=pulumi.get(__response__, 'filters'),
        frequency=pulumi.get(__response__, 'frequency'),
        id=pulumi.get(__response__, 'id'),
        internal_id=pulumi.get(__response__, 'internal_id'),
        name=pulumi.get(__response__, 'name'),
        organization=pulumi.get(__response__, 'organization'),
        project=pulumi.get(__response__, 'project')))
