# 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 .button_element import ButtonElement
from .file_content import FileContent


class PageSetting(UniversalBaseModel):
    color: typing.Optional[str] = pydantic.Field(default=None)
    """
    An HTML color code in format #RRGGBB
    """

    custom_css_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customCssUrl")] = (
        pydantic.Field(default=None)
    )
    """
    Complete URL to a custom CSS file to be loaded with the page
    """

    language: typing.Optional[str] = pydantic.Field(default=None)
    """
    Two-letter code following ISO 639-1
    """

    page_logo: typing_extensions.Annotated[typing.Optional[FileContent], FieldMetadata(alias="pageLogo")] = (
        pydantic.Field(default=None)
    )
    """
    Object containing logo file to upload/ use in page
    """

    payment_button: typing_extensions.Annotated[
        typing.Optional[ButtonElement], FieldMetadata(alias="paymentButton")
    ] = None
    redirect_after_approve: typing_extensions.Annotated[
        typing.Optional[bool], FieldMetadata(alias="redirectAfterApprove")
    ] = pydantic.Field(default=None)
    """
    Flag indicating if the capability for redirection in the page will be activated
    """

    redirect_after_approve_url: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="redirectAfterApproveUrl")
    ] = pydantic.Field(default=None)
    """
    Complete URL where the page will be redirected after completion
    """

    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
