# 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 .methods_list_out import MethodsListOut


class MethodElementOut(UniversalBaseModel):
    """
    Configuration for payment method selection on Pay Out payment links.
    """

    all_methods_checked: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="allMethodsChecked"),
        pydantic.Field(
            alias="allMethodsChecked",
            description="Flag indicating if all allowed payment methods will be pre-selected.",
        ),
    ] = None
    allow_multiple_methods: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="allowMultipleMethods"),
        pydantic.Field(
            alias="allowMultipleMethods",
            description="When `true`, the vendor can select from multiple payment methods. When `false`, only the default method is shown.",
        ),
    ] = None
    default_method: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="defaultMethod"),
        pydantic.Field(
            alias="defaultMethod",
            description='The default payment method to highlight on the payment link page. For example, `"vcard"`, `"ach"`, or `"check"`.',
        ),
    ] = None
    enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    When `true`, the payment methods section is displayed on the payment link page.
    """

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

    methods: typing.Optional[MethodsListOut] = None
    order: typing.Optional[int] = pydantic.Field(default=None)
    """
    Display order of the payment methods section on the page.
    """

    show_preview_virtual_card: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="showPreviewVirtualCard"),
        pydantic.Field(
            alias="showPreviewVirtualCard",
            description="When `true`, a preview of the virtual card is shown on the payment link page.",
        ),
    ] = None

    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
