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

from __future__ import annotations
from dataclasses import dataclass, field
import httpx
from moovio_sdk.models.errors import MoovError
from moovio_sdk.types import BaseModel
from typing import Optional


class CreateResolutionLinkErrorData(BaseModel):
    email: Optional[str] = None
    r"""An error with the recipient email address."""
    phone: Optional[str] = None
    r"""An error with the recipient phone number."""


@dataclass(unsafe_hash=True)
class CreateResolutionLinkError(MoovError):
    r"""Describes validation errors for the create resolution link request."""

    data: CreateResolutionLinkErrorData = field(hash=False)

    def __init__(
        self,
        data: CreateResolutionLinkErrorData,
        raw_response: httpx.Response,
        body: Optional[str] = None,
    ):
        message = body or raw_response.text
        super().__init__(message, raw_response, body)
        object.__setattr__(self, "data", data)
