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

from __future__ import annotations
from dataclasses import dataclass, field
from documenso_sdk.models import DocumensoError
from documenso_sdk.types import BaseModel
import httpx
import pydantic
from typing import List, Optional
from typing_extensions import Annotated, TypedDict


class EnvelopeRecipientDeleteRequestTypedDict(TypedDict):
    recipient_id: float


class EnvelopeRecipientDeleteRequest(BaseModel):
    recipient_id: Annotated[float, pydantic.Field(alias="recipientId")]


class EnvelopeRecipientDeleteInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class EnvelopeRecipientDeleteInternalServerErrorIssue(BaseModel):
    message: str


class EnvelopeRecipientDeleteInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeRecipientDeleteInternalServerErrorIssue]] = None


@dataclass(unsafe_hash=True)
class EnvelopeRecipientDeleteInternalServerError(DocumensoError):
    r"""Internal server error"""

    data: EnvelopeRecipientDeleteInternalServerErrorData = field(hash=False)

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


class EnvelopeRecipientDeleteForbiddenIssueTypedDict(TypedDict):
    message: str


class EnvelopeRecipientDeleteForbiddenIssue(BaseModel):
    message: str


class EnvelopeRecipientDeleteForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeRecipientDeleteForbiddenIssue]] = None


@dataclass(unsafe_hash=True)
class EnvelopeRecipientDeleteForbiddenError(DocumensoError):
    r"""Insufficient access"""

    data: EnvelopeRecipientDeleteForbiddenErrorData = field(hash=False)

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


class EnvelopeRecipientDeleteUnauthorizedIssueTypedDict(TypedDict):
    message: str


class EnvelopeRecipientDeleteUnauthorizedIssue(BaseModel):
    message: str


class EnvelopeRecipientDeleteUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeRecipientDeleteUnauthorizedIssue]] = None


@dataclass(unsafe_hash=True)
class EnvelopeRecipientDeleteUnauthorizedError(DocumensoError):
    r"""Authorization not provided"""

    data: EnvelopeRecipientDeleteUnauthorizedErrorData = field(hash=False)

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


class EnvelopeRecipientDeleteBadRequestIssueTypedDict(TypedDict):
    message: str


class EnvelopeRecipientDeleteBadRequestIssue(BaseModel):
    message: str


class EnvelopeRecipientDeleteBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeRecipientDeleteBadRequestIssue]] = None


@dataclass(unsafe_hash=True)
class EnvelopeRecipientDeleteBadRequestError(DocumensoError):
    r"""Invalid input data"""

    data: EnvelopeRecipientDeleteBadRequestErrorData = field(hash=False)

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


class EnvelopeRecipientDeleteResponseTypedDict(TypedDict):
    r"""Successful response"""

    success: bool


class EnvelopeRecipientDeleteResponse(BaseModel):
    r"""Successful response"""

    success: bool
