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


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


class TemplateDeleteTemplateDirectLinkInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class TemplateDeleteTemplateDirectLinkInternalServerErrorIssue(BaseModel):
    message: str


class TemplateDeleteTemplateDirectLinkInternalServerErrorData(BaseModel):
    message: str

    code: str

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


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

    data: TemplateDeleteTemplateDirectLinkInternalServerErrorData = field(hash=False)

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


class TemplateDeleteTemplateDirectLinkForbiddenIssue(BaseModel):
    message: str


class TemplateDeleteTemplateDirectLinkForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[TemplateDeleteTemplateDirectLinkForbiddenIssue]] = None


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

    data: TemplateDeleteTemplateDirectLinkForbiddenErrorData = field(hash=False)

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


class TemplateDeleteTemplateDirectLinkUnauthorizedIssue(BaseModel):
    message: str


class TemplateDeleteTemplateDirectLinkUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[TemplateDeleteTemplateDirectLinkUnauthorizedIssue]] = None


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

    data: TemplateDeleteTemplateDirectLinkUnauthorizedErrorData = field(hash=False)

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


class TemplateDeleteTemplateDirectLinkBadRequestIssue(BaseModel):
    message: str


class TemplateDeleteTemplateDirectLinkBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[TemplateDeleteTemplateDirectLinkBadRequestIssue]] = None


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

    data: TemplateDeleteTemplateDirectLinkBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
