# 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 ...types.accountid import Accountid
from ...types.entrypointfield import Entrypointfield
from ...types.order_id import OrderId
from ...types.orderdescription import Orderdescription
from ...types.source import Source
from ...types.subdomain import Subdomain
from ...types.subscriptionid import Subscriptionid
from .authorize_payment_method import AuthorizePaymentMethod
from .request_out_authorize_invoice_data import RequestOutAuthorizeInvoiceData
from .request_out_authorize_payment_details import RequestOutAuthorizePaymentDetails
from .request_out_authorize_vendor_data import RequestOutAuthorizeVendorData


class AuthorizePayoutBody(UniversalBaseModel):
    entry_point: typing_extensions.Annotated[Entrypointfield, FieldMetadata(alias="entryPoint")]
    source: typing.Optional[Source] = None
    order_id: typing_extensions.Annotated[typing.Optional[OrderId], FieldMetadata(alias="orderId")] = None
    order_description: typing_extensions.Annotated[
        typing.Optional[Orderdescription], FieldMetadata(alias="orderDescription")
    ] = None
    payment_method: typing_extensions.Annotated[AuthorizePaymentMethod, FieldMetadata(alias="paymentMethod")]
    payment_details: typing_extensions.Annotated[
        RequestOutAuthorizePaymentDetails, FieldMetadata(alias="paymentDetails")
    ] = pydantic.Field()
    """
    Object containing payment details.
    """

    vendor_data: typing_extensions.Annotated[RequestOutAuthorizeVendorData, FieldMetadata(alias="vendorData")] = (
        pydantic.Field()
    )
    """
    Object containing vendor data.
    """

    invoice_data: typing_extensions.Annotated[
        typing.List[RequestOutAuthorizeInvoiceData], FieldMetadata(alias="invoiceData")
    ] = pydantic.Field()
    """
    Array of bills associated to the transaction
    """

    account_id: typing_extensions.Annotated[typing.Optional[Accountid], FieldMetadata(alias="accountId")] = None
    subdomain: typing.Optional[Subdomain] = None
    subscription_id: typing_extensions.Annotated[
        typing.Optional[Subscriptionid], FieldMetadata(alias="subscriptionId")
    ] = 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
