# 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 .ach_absorb_section import AchAbsorbSection
from .ach_acceptance_element import AchAcceptanceElement
from .ach_fee_section import AchFeeSection
from .ach_pass_through_section import AchPassThroughSection
from .template_element import TemplateElement
from .visible import Visible


class AchService(UniversalBaseModel):
    ach_absorb: typing_extensions.Annotated[typing.Optional[AchAbsorbSection], FieldMetadata(alias="achAbsorb")] = None
    ach_absorb_high_pay_range: typing_extensions.Annotated[
        typing.Optional[TemplateElement], FieldMetadata(alias="achAbsorb_highPayRange")
    ] = None
    ach_absorb_low_pay_range: typing_extensions.Annotated[
        typing.Optional[TemplateElement], FieldMetadata(alias="achAbsorb_lowPayRange")
    ] = None
    ach_acceptance: typing_extensions.Annotated[
        typing.Optional[AchAcceptanceElement], FieldMetadata(alias="achAcceptance")
    ] = None
    ach_fees: typing_extensions.Annotated[typing.Optional[AchFeeSection], FieldMetadata(alias="achFees")] = None
    ach_pass_high_pay_range: typing_extensions.Annotated[
        typing.Optional[TemplateElement], FieldMetadata(alias="achPass_highPayRange")
    ] = None
    ach_pass_low_pay_range: typing_extensions.Annotated[
        typing.Optional[TemplateElement], FieldMetadata(alias="achPass_lowPayRange")
    ] = None
    ach_pass_through: typing_extensions.Annotated[
        typing.Optional[AchPassThroughSection], FieldMetadata(alias="achPassThrough")
    ] = None
    batch_cutoff_time: typing_extensions.Annotated[
        typing.Optional[TemplateElement], FieldMetadata(alias="batchCutoffTime")
    ] = pydantic.Field(default=None)
    """
    Controls how to present the `batchCutoffTime` field on the application. If this field isn't sent, batch cut off time defaults to 5 ET.
    """

    discount_frequency: typing_extensions.Annotated[
        typing.Optional[TemplateElement], FieldMetadata(alias="discountFrequency")
    ] = None
    funding_rollup: typing_extensions.Annotated[
        typing.Optional[TemplateElement], FieldMetadata(alias="fundingRollup")
    ] = None
    gateway: typing.Optional[TemplateElement] = None
    pdf_template_id: typing_extensions.Annotated[
        typing.Optional[TemplateElement], FieldMetadata(alias="pdfTemplateId")
    ] = None
    pricing_plan: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="pricingPlan")] = None
    pricing_type: typing_extensions.Annotated[typing.Optional[TemplateElement], FieldMetadata(alias="pricingType")] = (
        None
    )
    processor: typing.Optional[TemplateElement] = None
    provider: typing.Optional[TemplateElement] = None
    tier_name: typing_extensions.Annotated[typing.Optional[TemplateElement], FieldMetadata(alias="tierName")] = None
    visible: typing.Optional[Visible] = 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
