# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .workflow_target_config import WorkflowTargetConfig


class WorkflowHookInput(UncheckedBaseModel):
    """
    Input schema for workflow hooks.
    """

    name: str
    description: typing.Optional[str] = None
    target_id: str
    response_mode: typing.Optional[str] = None
    allowed_methods: typing.Optional[typing.List[str]] = None
    max_payload_size: typing.Optional[int] = None
    enable_auth: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether to generate a secret for HMAC authentication
    """

    target_type: typing.Optional[typing.Literal["workflow"]] = None
    target_config: typing.Optional[WorkflowTargetConfig] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
