# 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 ...money_out_types.types.authorize_payment_method import AuthorizePaymentMethod
from ...money_out_types.types.request_out_authorize_vendor_data import RequestOutAuthorizeVendorData
from ...types.account_id import AccountId
from ...types.bill_pay_out_data_request import BillPayOutDataRequest
from ...types.entrypointfield import Entrypointfield
from ...types.source import Source
from ...types.subdomain import Subdomain
from .payout_payment_detail import PayoutPaymentDetail
from .payout_schedule_detail import PayoutScheduleDetail
from .payout_set_pause import PayoutSetPause


class PayoutSubscriptionRequestBody(UniversalBaseModel):
    entry_point: typing_extensions.Annotated[
        Entrypointfield, FieldMetadata(alias="entryPoint"), pydantic.Field(alias="entryPoint")
    ]
    subdomain: typing.Optional[Subdomain] = None
    account_id: typing_extensions.Annotated[
        typing.Optional[AccountId], FieldMetadata(alias="accountId"), pydantic.Field(alias="accountId")
    ] = None
    source: typing.Optional[Source] = None
    set_pause: typing_extensions.Annotated[
        typing.Optional[PayoutSetPause], FieldMetadata(alias="setPause"), pydantic.Field(alias="setPause")
    ] = None
    payment_method: typing_extensions.Annotated[
        AuthorizePaymentMethod,
        FieldMetadata(alias="paymentMethod"),
        pydantic.Field(
            alias="paymentMethod",
            description="Payment method for the payout subscription. Supports `ach`, `vcard`, and `check`. The `managed` method isn't supported for payout subscriptions.",
        ),
    ]
    payment_details: typing_extensions.Annotated[
        typing.Optional[PayoutPaymentDetail],
        FieldMetadata(alias="paymentDetails"),
        pydantic.Field(alias="paymentDetails", description="Object describing details of the payout."),
    ] = None
    vendor_data: typing_extensions.Annotated[
        RequestOutAuthorizeVendorData,
        FieldMetadata(alias="vendorData"),
        pydantic.Field(
            alias="vendorData",
            description="Object identifying the vendor for this subscription. Only a `vendorId` or `vendorNumber` is needed to link to an existing vendor.",
        ),
    ]
    bill_data: typing_extensions.Annotated[
        typing.Optional[typing.List[BillPayOutDataRequest]],
        FieldMetadata(alias="billData"),
        pydantic.Field(
            alias="billData",
            description="Array of bills associated with the payout subscription. If omitted and `doNotCreateBills` isn't set to `true`, the system creates a bill automatically.",
        ),
    ] = None
    schedule_details: typing_extensions.Annotated[
        typing.Optional[PayoutScheduleDetail],
        FieldMetadata(alias="scheduleDetails"),
        pydantic.Field(
            alias="scheduleDetails", description="Object describing the schedule for the payout subscription."
        ),
    ] = 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
