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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .google_forms_item_output_item_type import GoogleFormsItemOutputItemType
from .google_forms_question import GoogleFormsQuestion
from .google_forms_section_header import GoogleFormsSectionHeader


class GoogleFormsItem(UniversalBaseModel):
    """
    A single item in a form - can be a question or section header
    """

    item_type: GoogleFormsItemOutputItemType = pydantic.Field()
    """
    Type of form item
    """

    question: typing.Optional[GoogleFormsQuestion] = pydantic.Field(default=None)
    """
    Question details (when item_type is 'question')
    """

    section_header: typing.Optional[GoogleFormsSectionHeader] = pydantic.Field(default=None)
    """
    Section header details (when item_type is 'section_header')
    """

    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
