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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class CreateTriggerSubscriptionRequest(UniversalBaseModel):
    """
    Request body for creating a trigger subscription.
    """

    provider: str = pydantic.Field()
    """
    Provider name (e.g., 'connector', 'freshdesk')
    """

    event_type: str = pydantic.Field()
    """
    Event type (e.g., 'gmail_new_email', 'ticket_created')
    """

    connection_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Provider-specific account/connection ID. NULL matches all connections.
    """

    flow_id: str = pydantic.Field()
    """
    FlowPlate flow UUID to trigger
    """

    trigger_name: str = pydantic.Field()
    """
    Trigger node display name in the flow (e.g., 'Answer Tickets')
    """

    api_key: str = pydantic.Field()
    """
    FlowPlate API key for the flow owner (sk-...)
    """

    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
