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


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


class RecipientDeleteTemplateRecipientInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class RecipientDeleteTemplateRecipientInternalServerErrorIssue(BaseModel):
    message: str


class RecipientDeleteTemplateRecipientInternalServerErrorData(BaseModel):
    message: str

    code: str

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


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

    data: RecipientDeleteTemplateRecipientInternalServerErrorData = field(hash=False)

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


class RecipientDeleteTemplateRecipientForbiddenIssue(BaseModel):
    message: str


class RecipientDeleteTemplateRecipientForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[RecipientDeleteTemplateRecipientForbiddenIssue]] = None


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

    data: RecipientDeleteTemplateRecipientForbiddenErrorData = field(hash=False)

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


class RecipientDeleteTemplateRecipientUnauthorizedIssue(BaseModel):
    message: str


class RecipientDeleteTemplateRecipientUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[RecipientDeleteTemplateRecipientUnauthorizedIssue]] = None


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

    data: RecipientDeleteTemplateRecipientUnauthorizedErrorData = field(hash=False)

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


class RecipientDeleteTemplateRecipientBadRequestIssue(BaseModel):
    message: str


class RecipientDeleteTemplateRecipientBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[RecipientDeleteTemplateRecipientBadRequestIssue]] = None


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

    data: RecipientDeleteTemplateRecipientBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
