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

import datetime as dt
import typing

from ....core.datetime_utils import serialize_datetime

try:
    import pydantic.v1 as pydantic  # type: ignore
except ImportError:
    import pydantic  # type: ignore


class BankAccountCheckOptions(pydantic.BaseModel):
    enabled: typing.Optional[bool] = pydantic.Field(
        description="If true, will allow the user to print checks from this bank account"
    )
    initial_check_number: typing.Optional[int] = pydantic.Field(
        alias="initialCheckNumber",
        description="If provided, will start the check number sequence at the provided number. If not provided, will start at 5000.",
    )
    routing_number_override: typing.Optional[str] = pydantic.Field(
        alias="routingNumberOverride",
        description="If provided, will print a check with the provided routing number instead of the one from the bank account",
    )
    account_number_override: typing.Optional[str] = pydantic.Field(
        alias="accountNumberOverride",
        description="If provided, will print a check with the provided account number instead of the one from the bank account",
    )
    signatory_name: typing.Optional[str] = pydantic.Field(
        alias="signatoryName",
        description="If provided, will print a check with a generated signature from the provided name",
    )
    signature_image: typing.Optional[str] = pydantic.Field(
        alias="signatureImage",
        description="Base64 encoded PNG of the signature. If provided, will print a check with the provided image as the signature. Will override signatoryName.",
    )

    def json(self, **kwargs: typing.Any) -> str:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().json(**kwargs_with_defaults)

    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().dict(**kwargs_with_defaults)

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True
        json_encoders = {dt.datetime: serialize_datetime}
