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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing_extensions
import datetime as dt
from ..core.serialization import FieldMetadata
from .captcha_event_message_status import CaptchaEventMessageStatus
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import typing


class CaptchaEventMessage(UniversalBaseModel):
    duration: int = pydantic.Field()
    """
    Time taken to solve the CAPTCHA (in milliseconds).
    """

    event: str = pydantic.Field()
    """
    Event name
    """

    event_time: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="eventTime")] = pydantic.Field()
    """
    Date and Time of the event
    """

    id: str = pydantic.Field()
    """
    CAPTCHA job ID
    """

    retry_count: typing_extensions.Annotated[int, FieldMetadata(alias="retryCount")] = pydantic.Field()
    """
    Retry count
    """

    status: CaptchaEventMessageStatus = pydantic.Field()
    """
    CAPTCHA solving status
    """

    type: str = pydantic.Field()
    """
    CAPTCHA type
    """

    url: str = pydantic.Field()
    """
    URL of the page containing the CAPTCHA challenge.
    """

    window_id: typing_extensions.Annotated[str, FieldMetadata(alias="windowId")] = pydantic.Field()
    """
    Window ID
    """

    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
