"""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 (
    cardexpirationerror as components_cardexpirationerror,
    createauthorizedusererror as components_createauthorizedusererror,
    issuingcontrolserror as components_issuingcontrolserror,
)
from moovio_sdk.types import BaseModel
import pydantic
from typing import Optional
from typing_extensions import Annotated


class RequestCardErrorData(BaseModel):
    funding_wallet_id: Annotated[
        Optional[str], pydantic.Field(alias="fundingWalletID")
    ] = None

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

    authorized_user: Annotated[
        Optional[components_createauthorizedusererror.CreateAuthorizedUserError],
        pydantic.Field(alias="authorizedUser"),
    ] = None

    memo: Optional[str] = None

    expiration: Optional[components_cardexpirationerror.CardExpirationError] = None

    controls: Optional[components_issuingcontrolserror.IssuingControlsError] = None


class RequestCardError(Exception):
    data: RequestCardErrorData

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

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