# Generated by ariadne-codegen
# Source: /usr/share/sourcehut/builds.sr.ht.graphqls

from typing import Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import TriggerCondition, TriggerType, WebhookEvent


class EmailTriggerInput(BaseModel):
    to: str
    cc: Optional[str] = None
    in_reply_to: Optional[str] = Field(alias="inReplyTo", default=None)


class WebhookTriggerInput(BaseModel):
    url: str


class TriggerInput(BaseModel):
    type_: TriggerType = Field(alias="type")
    condition: TriggerCondition
    email: Optional["EmailTriggerInput"] = None
    webhook: Optional["WebhookTriggerInput"] = None


class UserWebhookInput(BaseModel):
    url: str
    events: list[WebhookEvent]
    query: str


TriggerInput.model_rebuild()
