"""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 RecipientDeleteDocumentRecipientRequestTypedDict(TypedDict):
    recipient_id: float


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


class RecipientDeleteDocumentRecipientInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class RecipientDeleteDocumentRecipientInternalServerErrorIssue(BaseModel):
    message: str


class RecipientDeleteDocumentRecipientInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[RecipientDeleteDocumentRecipientInternalServerErrorIssue]] = (
        None
    )


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

    data: RecipientDeleteDocumentRecipientInternalServerErrorData = field(hash=False)

    def __init__(
        self,
        data: RecipientDeleteDocumentRecipientInternalServerErrorData,
        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 RecipientDeleteDocumentRecipientForbiddenIssueTypedDict(TypedDict):
    message: str


class RecipientDeleteDocumentRecipientForbiddenIssue(BaseModel):
    message: str


class RecipientDeleteDocumentRecipientForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[RecipientDeleteDocumentRecipientForbiddenIssue]] = None


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

    data: RecipientDeleteDocumentRecipientForbiddenErrorData = field(hash=False)

    def __init__(
        self,
        data: RecipientDeleteDocumentRecipientForbiddenErrorData,
        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 RecipientDeleteDocumentRecipientUnauthorizedIssueTypedDict(TypedDict):
    message: str


class RecipientDeleteDocumentRecipientUnauthorizedIssue(BaseModel):
    message: str


class RecipientDeleteDocumentRecipientUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[RecipientDeleteDocumentRecipientUnauthorizedIssue]] = None


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

    data: RecipientDeleteDocumentRecipientUnauthorizedErrorData = field(hash=False)

    def __init__(
        self,
        data: RecipientDeleteDocumentRecipientUnauthorizedErrorData,
        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 RecipientDeleteDocumentRecipientBadRequestIssueTypedDict(TypedDict):
    message: str


class RecipientDeleteDocumentRecipientBadRequestIssue(BaseModel):
    message: str


class RecipientDeleteDocumentRecipientBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[RecipientDeleteDocumentRecipientBadRequestIssue]] = None


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

    data: RecipientDeleteDocumentRecipientBadRequestErrorData = field(hash=False)

    def __init__(
        self,
        data: RecipientDeleteDocumentRecipientBadRequestErrorData,
        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 RecipientDeleteDocumentRecipientResponseTypedDict(TypedDict):
    r"""Successful response"""

    success: bool


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

    success: bool
