# 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 .guided_step_action import GuidedStepAction


class GuidedStep(UncheckedBaseModel):
    """
    A single step in a guided crawl workflow.
    """

    action: GuidedStepAction = pydantic.Field()
    """
    The type of action to perform
    """

    selector: typing.Optional[str] = pydantic.Field(default=None)
    """
    CSS selector for the target element (not needed for navigate)
    """

    value: typing.Optional[str] = pydantic.Field(default=None)
    """
    Value for the action (URL for navigate, input text for fill)
    """

    wait_for: typing.Optional[str] = pydantic.Field(default=None)
    """
    CSS selector to wait for after this action completes
    """

    description: str = pydantic.Field()
    """
    Human-readable description of what this step does
    """

    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
