"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from moovio_sdk import utils
from moovio_sdk.models.components import (
    amountvalidationerror as components_amountvalidationerror,
    displayoptionserror as components_displayoptionserror,
    paymentdetailserror as components_paymentdetailserror,
    payoutdetailserror as components_payoutdetailserror,
)
from moovio_sdk.types import BaseModel
import pydantic
from typing import Optional
from typing_extensions import Annotated


class CreatePaymentLinkErrorData(BaseModel):
    partner_account_id: Annotated[
        Optional[str], pydantic.Field(alias="partnerAccountID")
    ] = None

    merchant_payment_method_id: Annotated[
        Optional[str], pydantic.Field(alias="merchantPaymentMethodID")
    ] = None

    amount: Optional[components_amountvalidationerror.AmountValidationError] = None

    max_uses: Annotated[Optional[str], pydantic.Field(alias="maxUses")] = None

    expires_on: Annotated[Optional[str], pydantic.Field(alias="expiresOn")] = None

    display: Optional[components_displayoptionserror.DisplayOptionsError] = None

    payment: Optional[components_paymentdetailserror.PaymentDetailsError] = None

    payout: Optional[components_payoutdetailserror.PayoutDetailsError] = None


class CreatePaymentLinkError(Exception):
    data: CreatePaymentLinkErrorData

    def __init__(self, data: CreatePaymentLinkErrorData):
        self.data = data

    def __str__(self) -> str:
        return utils.marshal_json(self.data, CreatePaymentLinkErrorData)
