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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .checkout_merchant_settings_payment_methods_afterpay_clearpay_eligibility_range import (
    CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange,
)
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay(UncheckedBaseModel):
    """
    The settings allowed for AfterpayClearpay.
    """

    order_eligibility_range: typing.Optional[CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange] = (
        pydantic.Field(default=None)
    )
    """
    Afterpay is shown as an option for order totals falling within the configured range.
    """

    item_eligibility_range: typing.Optional[CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange] = (
        pydantic.Field(default=None)
    )
    """
    Afterpay is shown as an option for item totals falling within the configured range.
    """

    enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether the payment method is enabled for the account.
    """

    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
