# This file was generated by liblab | https://liblab.com/

from enum import Enum
from typing import List
from .utils.json_map import JsonMap
from .base import BaseModel


class CreateWebhookRequestStatus(Enum):
    """An enumeration representing different categories.

    :cvar ENABLED: "enabled"
    :vartype ENABLED: str
    :cvar DISABLED: "disabled"
    :vartype DISABLED: str
    """

    ENABLED = "enabled"
    DISABLED = "disabled"

    def list():
        """Lists all category values.

        :return: A list of all category values.
        :rtype: list
        """
        return list(
            map(lambda x: x.value, CreateWebhookRequestStatus._member_map_.values())
        )


@JsonMap({})
class CreateWebhookRequest(BaseModel):
    """CreateWebhookRequest

    :param name: Webhook subscription name.
    :type name: str
    :param description: Webhook subscription description.
    :type description: str
    :param status: Status of webhook.
    :type status: CreateWebhookRequestStatus
    :param url: Endpoint to receive webhook.
    :type url: str
    :param signing_key: The webhook's signing key, used to generate webhook signatures.
    :type signing_key: str
    :param api_version: Deel API version. Currently Deel accepts v1 or v2 version.
    :type api_version: str
    :param events: The list of events to enable for this subscription.
    :type events: List[str]
    """

    def __init__(
        self,
        name: str,
        description: str,
        status: CreateWebhookRequestStatus,
        url: str,
        signing_key: str,
        api_version: str,
        events: List[str],
    ):
        self.name = name
        self.description = description
        self.status = self._enum_matching(
            status, CreateWebhookRequestStatus.list(), "status"
        )
        self.url = url
        self.signing_key = signing_key
        self.api_version = api_version
        self.events = events
