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

import builtins
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 ._enums import *

__all__ = [
    'GetWebhookResult',
    'AwaitableGetWebhookResult',
    'get_webhook',
    'get_webhook_output',
]

@pulumi.output_type
class GetWebhookResult:
    def __init__(__self__, enabled=None, event_filter=None, id=None, name=None, secret=None, url=None):
        if enabled and not isinstance(enabled, bool):
            raise TypeError("Expected argument 'enabled' to be a bool")
        pulumi.set(__self__, "enabled", enabled)
        if event_filter and not isinstance(event_filter, list):
            raise TypeError("Expected argument 'event_filter' to be a list")
        pulumi.set(__self__, "event_filter", event_filter)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if secret and not isinstance(secret, str):
            raise TypeError("Expected argument 'secret' to be a str")
        pulumi.set(__self__, "secret", secret)
        if url and not isinstance(url, str):
            raise TypeError("Expected argument 'url' to be a str")
        pulumi.set(__self__, "url", url)

    @property
    @pulumi.getter
    def enabled(self) -> builtins.bool:
        return pulumi.get(self, "enabled")

    @property
    @pulumi.getter(name="eventFilter")
    def event_filter(self) -> Sequence['WebhookWithCursorpropertieswebhookEventFilterItem']:
        """
        The event types that will trigger the webhook. An empty list means all event types will trigger the webhook.
        """
        return pulumi.get(self, "event_filter")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        return pulumi.get(self, "id")

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

    @property
    @pulumi.getter
    def secret(self) -> builtins.str:
        return pulumi.get(self, "secret")

    @property
    @pulumi.getter
    def url(self) -> builtins.str:
        return pulumi.get(self, "url")


class AwaitableGetWebhookResult(GetWebhookResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetWebhookResult(
            enabled=self.enabled,
            event_filter=self.event_filter,
            id=self.id,
            name=self.name,
            secret=self.secret,
            url=self.url)


def get_webhook(webhook_id: Optional[builtins.str] = None,
                opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetWebhookResult:
    """
    Use this data source to access information about an existing resource.

    :param builtins.str webhook_id: Unique identifier for the webhook
    """
    __args__ = dict()
    __args__['webhookId'] = webhook_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('render:webhooks:getWebhook', __args__, opts=opts, typ=GetWebhookResult).value

    return AwaitableGetWebhookResult(
        enabled=pulumi.get(__ret__, 'enabled'),
        event_filter=pulumi.get(__ret__, 'event_filter'),
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        secret=pulumi.get(__ret__, 'secret'),
        url=pulumi.get(__ret__, 'url'))
def get_webhook_output(webhook_id: Optional[pulumi.Input[builtins.str]] = None,
                       opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetWebhookResult]:
    """
    Use this data source to access information about an existing resource.

    :param builtins.str webhook_id: Unique identifier for the webhook
    """
    __args__ = dict()
    __args__['webhookId'] = webhook_id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('render:webhooks:getWebhook', __args__, opts=opts, typ=GetWebhookResult)
    return __ret__.apply(lambda __response__: GetWebhookResult(
        enabled=pulumi.get(__response__, 'enabled'),
        event_filter=pulumi.get(__response__, 'event_filter'),
        id=pulumi.get(__response__, 'id'),
        name=pulumi.get(__response__, 'name'),
        secret=pulumi.get(__response__, 'secret'),
        url=pulumi.get(__response__, 'url')))
