"""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 EnvelopeDeleteRequestTypedDict(TypedDict):
    envelope_id: str


class EnvelopeDeleteRequest(BaseModel):
    envelope_id: Annotated[str, pydantic.Field(alias="envelopeId")]


class EnvelopeDeleteInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class EnvelopeDeleteInternalServerErrorIssue(BaseModel):
    message: str


class EnvelopeDeleteInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeDeleteInternalServerErrorIssue]] = None


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

    data: EnvelopeDeleteInternalServerErrorData = field(hash=False)

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


class EnvelopeDeleteForbiddenIssue(BaseModel):
    message: str


class EnvelopeDeleteForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeDeleteForbiddenIssue]] = None


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

    data: EnvelopeDeleteForbiddenErrorData = field(hash=False)

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


class EnvelopeDeleteUnauthorizedIssue(BaseModel):
    message: str


class EnvelopeDeleteUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeDeleteUnauthorizedIssue]] = None


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

    data: EnvelopeDeleteUnauthorizedErrorData = field(hash=False)

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


class EnvelopeDeleteBadRequestIssue(BaseModel):
    message: str


class EnvelopeDeleteBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeDeleteBadRequestIssue]] = None


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

    data: EnvelopeDeleteBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
