"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
# @generated-id: 67fc9bc4130d

from __future__ import annotations
from .balance_transfer_party_type_response import BalanceTransferPartyTypeResponse
from mollie import models
from mollie.types import BaseModel
from pydantic import field_serializer
from typing_extensions import TypedDict


class EntityBalanceTransferPartyResponseTypedDict(TypedDict):
    r"""A party involved in the balance transfer, either the sender or the receiver."""

    type: BalanceTransferPartyTypeResponse
    r"""Defines the type of the party. At the moment, only `organization` is supported."""
    id: str
    description: str
    r"""The transfer description for the transfer party. This is the description that will appear in the financial reports of the party."""


class EntityBalanceTransferPartyResponse(BaseModel):
    r"""A party involved in the balance transfer, either the sender or the receiver."""

    type: BalanceTransferPartyTypeResponse
    r"""Defines the type of the party. At the moment, only `organization` is supported."""

    id: str

    description: str
    r"""The transfer description for the transfer party. This is the description that will appear in the financial reports of the party."""

    @field_serializer("type")
    def serialize_type(self, value):
        if isinstance(value, str):
            try:
                return models.BalanceTransferPartyTypeResponse(value)
            except ValueError:
                return value
        return value
