# 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 .additional_data import AdditionalData
from .address_addtl_nullable import AddressAddtlNullable
from .address_nullable import AddressNullable
from .billing_data_response import BillingDataResponse
from .city_nullable import CityNullable
from .contacts_response import ContactsResponse
from .created_at import CreatedAt
from .dbaname import Dbaname
from .ein import Ein
from .email import Email
from .enrollment_status import EnrollmentStatus
from .entrypointfield import Entrypointfield
from .external_paypoint_id import ExternalPaypointId
from .internal_reference_id import InternalReferenceId
from .last_modified import LastModified
from .legalname import Legalname
from .mcc import Mcc
from .org_parent_id import OrgParentId
from .org_parent_name import OrgParentName
from .payee_name import PayeeName
from .remit_email import RemitEmail
from .remitaddress_1 import Remitaddress1
from .remitaddress_2 import Remitaddress2
from .remitcity import Remitcity
from .remitcountry import Remitcountry
from .remitstate import Remitstate
from .remitzip import Remitzip
from .state_nullable import StateNullable
from .vendor_number import VendorNumber
from .vendor_payment_method_string import VendorPaymentMethodString
from .vendor_response_stored_method import VendorResponseStoredMethod
from .vendor_summary import VendorSummary
from .vendorid import Vendorid
from .vendorstatus import Vendorstatus
from .zip import Zip


class VendorQueryRecord(UniversalBaseModel):
    """
    Examples
    --------
    import datetime

    from payabli import (
        BillingDataResponse,
        ContactsResponse,
        VendorQueryRecord,
        VendorSummary,
    )

    VendorQueryRecord(
        vendor_number="1234",
        name_1="Herman's Coatings",
        name_2="Herman's Coating Supply Company, LLC",
        ein="123456789",
        phone="212-555-1234",
        email="example@email.com",
        address_1="123 Ocean Drive",
        address_2="Suite 400",
        city="Bristol",
        state="GA",
        zip="31113",
        country="US",
        mcc="7777",
        location_code="LOC123",
        contacts=ContactsResponse(
            contact_email="eric@martinezcoatings.com",
            contact_name="Eric Martinez",
            contact_phone="5555555555",
            contact_title="Owner",
        ),
        billing_data=BillingDataResponse(
            id=123456,
            account_id="bank-account-001",
            nickname="Main Checking Account",
            bank_name="Example Bank",
            routing_account="123456789",
            account_number="9876543210",
            type_account="Checking",
            bank_account_holder_name="John Doe",
            bank_account_holder_type="Business",
            bank_account_function=2,
            verified=True,
            status=1,
            services=[],
            default=True,
        ),
        vendor_status=1,
        vendor_id=1,
        summary=VendorSummary(
            active_bills=2,
            pending_bills=4,
            in_transit_bills=3,
            paid_bills=18,
            overdue_bills=1,
            approved_bills=5,
            disapproved_bills=1,
            total_bills=34,
            active_bills_amount=1250.75,
            pending_bills_amount=2890.5,
            in_transit_bills_amount=1675.25,
            paid_bills_amount=15420.8,
            overdue_bills_amount=425.0,
            approved_bills_amount=3240.9,
            disapproved_bills_amount=180.0,
            total_bills_amount=25083.2,
        ),
        paypoint_legalname="Sunshine Services, LLC",
        paypoint_dbaname="Sunshine Gutters",
        paypoint_entryname="d193cf9a46",
        parent_org_name="PropertyManager Pro",
        parent_org_id=1000,
        created_date=datetime.datetime.fromisoformat(
            "2022-07-01 15:00:01+00:00",
        ),
        last_updated=datetime.datetime.fromisoformat(
            "2022-07-01 15:00:01+00:00",
        ),
        remit_address_1="123 Walnut Street",
        remit_address_2="Suite 900",
        remit_city="Miami",
        remit_state="FL",
        remit_zip="31113",
        remit_country="US",
        payee_name_1="payeeName1",
        payee_name_2="payeeName2",
        custom_field_1="",
        custom_field_2="",
        customer_vendor_account="123-456",
        internal_reference_id=1000000,
        external_paypoint_id="Paypoint-100",
        stored_methods=[],
    )
    """

    additional_data: typing_extensions.Annotated[
        typing.Optional[AdditionalData], FieldMetadata(alias="additionalData")
    ] = None
    address_1: typing_extensions.Annotated[typing.Optional[AddressNullable], FieldMetadata(alias="Address1")] = None
    address_2: typing_extensions.Annotated[typing.Optional[AddressAddtlNullable], FieldMetadata(alias="Address2")] = (
        None
    )
    billing_data: typing_extensions.Annotated[
        typing.Optional[BillingDataResponse], FieldMetadata(alias="BillingData")
    ] = None
    city: typing_extensions.Annotated[typing.Optional[CityNullable], FieldMetadata(alias="City")] = None
    contacts: typing_extensions.Annotated[typing.Optional[ContactsResponse], FieldMetadata(alias="Contacts")] = None
    country: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="Country")] = None
    created_date: typing_extensions.Annotated[typing.Optional[CreatedAt], FieldMetadata(alias="CreatedDate")] = None
    customer_vendor_account: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="customerVendorAccount")
    ] = None
    custom_field_1: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customField1")] = None
    custom_field_2: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customField2")] = None
    ein: typing_extensions.Annotated[typing.Optional[Ein], FieldMetadata(alias="EIN")] = None
    email: typing_extensions.Annotated[typing.Optional[Email], FieldMetadata(alias="Email")] = None
    enrollment_status: typing_extensions.Annotated[
        typing.Optional[EnrollmentStatus], FieldMetadata(alias="EnrollmentStatus")
    ] = None
    external_paypoint_id: typing_extensions.Annotated[
        typing.Optional[ExternalPaypointId], FieldMetadata(alias="externalPaypointID")
    ] = None
    internal_reference_id: typing_extensions.Annotated[
        typing.Optional[InternalReferenceId], FieldMetadata(alias="InternalReferenceId")
    ] = None
    last_updated: typing_extensions.Annotated[typing.Optional[LastModified], FieldMetadata(alias="LastUpdated")] = None
    location_code: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="LocationCode")] = None
    mcc: typing_extensions.Annotated[typing.Optional[Mcc], FieldMetadata(alias="Mcc")] = None
    name_1: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="Name1")] = None
    name_2: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="Name2")] = None
    parent_org_name: typing_extensions.Annotated[
        typing.Optional[OrgParentName], FieldMetadata(alias="ParentOrgName")
    ] = None
    parent_org_id: typing_extensions.Annotated[typing.Optional[OrgParentId], FieldMetadata(alias="ParentOrgId")] = None
    payee_name_1: typing_extensions.Annotated[typing.Optional[PayeeName], FieldMetadata(alias="payeeName1")] = None
    payee_name_2: typing_extensions.Annotated[typing.Optional[PayeeName], FieldMetadata(alias="payeeName2")] = None
    payment_method: typing_extensions.Annotated[
        typing.Optional[VendorPaymentMethodString], FieldMetadata(alias="PaymentMethod")
    ] = None
    paypoint_dbaname: typing_extensions.Annotated[typing.Optional[Dbaname], FieldMetadata(alias="PaypointDbaname")] = (
        None
    )
    paypoint_entryname: typing_extensions.Annotated[
        typing.Optional[Entrypointfield], FieldMetadata(alias="PaypointEntryname")
    ] = None
    paypoint_legalname: typing_extensions.Annotated[
        typing.Optional[Legalname], FieldMetadata(alias="PaypointLegalname")
    ] = None
    phone: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="Phone")] = None
    remit_address_1: typing_extensions.Annotated[
        typing.Optional[Remitaddress1], FieldMetadata(alias="remitAddress1")
    ] = None
    remit_address_2: typing_extensions.Annotated[
        typing.Optional[Remitaddress2], FieldMetadata(alias="remitAddress2")
    ] = None
    remit_city: typing_extensions.Annotated[typing.Optional[Remitcity], FieldMetadata(alias="remitCity")] = None
    remit_country: typing_extensions.Annotated[typing.Optional[Remitcountry], FieldMetadata(alias="remitCountry")] = (
        None
    )
    remit_email: typing_extensions.Annotated[typing.Optional[RemitEmail], FieldMetadata(alias="RemitEmail")] = None
    remit_state: typing_extensions.Annotated[typing.Optional[Remitstate], FieldMetadata(alias="remitState")] = None
    remit_zip: typing_extensions.Annotated[typing.Optional[Remitzip], FieldMetadata(alias="remitZip")] = None
    state: typing_extensions.Annotated[typing.Optional[StateNullable], FieldMetadata(alias="State")] = None
    stored_methods: typing_extensions.Annotated[
        typing.Optional[typing.List[VendorResponseStoredMethod]], FieldMetadata(alias="StoredMethods")
    ] = None
    summary: typing_extensions.Annotated[typing.Optional[VendorSummary], FieldMetadata(alias="Summary")] = None
    vendor_id: typing_extensions.Annotated[typing.Optional[Vendorid], FieldMetadata(alias="VendorId")] = None
    vendor_number: typing_extensions.Annotated[typing.Optional[VendorNumber], FieldMetadata(alias="VendorNumber")] = (
        None
    )
    vendor_status: typing_extensions.Annotated[typing.Optional[Vendorstatus], FieldMetadata(alias="VendorStatus")] = (
        None
    )
    zip: typing_extensions.Annotated[typing.Optional[Zip], FieldMetadata(alias="Zip")] = 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
