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

from __future__ import annotations
from .transfer_scheme_type_response import TransferSchemeTypeResponse
from mollie import models
from mollie.types import BaseModel
from pydantic import field_serializer
from typing_extensions import TypedDict


class TransferSchemeResponseTypedDict(TypedDict):
    r"""The scheme, as requested by the client."""

    type: TransferSchemeTypeResponse
    r"""The transfer scheme to be used for the transfer. The transfer scheme determines the processing time and method of the transfer."""


class TransferSchemeResponse(BaseModel):
    r"""The scheme, as requested by the client."""

    type: TransferSchemeTypeResponse
    r"""The transfer scheme to be used for the transfer. The transfer scheme determines the processing time and method of the transfer."""

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