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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .counterpart_individual_response import CounterpartIndividualResponse
from .counterpart_organization_response import CounterpartOrganizationResponse
from .language_code_enum import LanguageCodeEnum


class DeliveryNoteCounterpartResource(UniversalBaseModel):
    id: str = pydantic.Field()
    """
    ID of the counterpart
    """

    individual: typing.Optional[CounterpartIndividualResponse] = pydantic.Field(default=None)
    """
    Individual counterpart
    """

    language: typing.Optional[LanguageCodeEnum] = pydantic.Field(default=None)
    """
    The language used to generate PDF documents for this counterpart.
    """

    organization: typing.Optional[CounterpartOrganizationResponse] = pydantic.Field(default=None)
    """
    Organization counterpart
    """

    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
