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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .enabled import Enabled
from .method_element_settings import MethodElementSettings
from .methods_list import MethodsList
from .order import Order


class MethodElement(UniversalBaseModel):
    all_methods_checked: typing_extensions.Annotated[
        typing.Optional[bool], FieldMetadata(alias="allMethodsChecked")
    ] = pydantic.Field(default=None)
    """
    Flag indicating if all allowed payment methods will be pre-selected.
    """

    enabled: typing.Optional[Enabled] = None
    header: typing.Optional[str] = pydantic.Field(default=None)
    """
    Header text for section
    """

    methods: typing.Optional[MethodsList] = None
    order: typing.Optional[Order] = None
    settings: typing.Optional[MethodElementSettings] = pydantic.Field(default=None)
    """
    Settings for wallet payment methods.
    """

    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
