"""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 TemplateDeleteTemplateRequestTypedDict(TypedDict):
    template_id: float


class TemplateDeleteTemplateRequest(BaseModel):
    template_id: Annotated[float, pydantic.Field(alias="templateId")]


class TemplateDeleteTemplateInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class TemplateDeleteTemplateInternalServerErrorIssue(BaseModel):
    message: str


class TemplateDeleteTemplateInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[TemplateDeleteTemplateInternalServerErrorIssue]] = None


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

    data: TemplateDeleteTemplateInternalServerErrorData = field(hash=False)

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


class TemplateDeleteTemplateForbiddenIssue(BaseModel):
    message: str


class TemplateDeleteTemplateForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[TemplateDeleteTemplateForbiddenIssue]] = None


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

    data: TemplateDeleteTemplateForbiddenErrorData = field(hash=False)

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


class TemplateDeleteTemplateUnauthorizedIssue(BaseModel):
    message: str


class TemplateDeleteTemplateUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[TemplateDeleteTemplateUnauthorizedIssue]] = None


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

    data: TemplateDeleteTemplateUnauthorizedErrorData = field(hash=False)

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


class TemplateDeleteTemplateBadRequestIssue(BaseModel):
    message: str


class TemplateDeleteTemplateBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[TemplateDeleteTemplateBadRequestIssue]] = None


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

    data: TemplateDeleteTemplateBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
