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


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


class EnvelopeDuplicateInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class EnvelopeDuplicateInternalServerErrorIssue(BaseModel):
    message: str


class EnvelopeDuplicateInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeDuplicateInternalServerErrorIssue]] = None


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

    data: EnvelopeDuplicateInternalServerErrorData = field(hash=False)

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


class EnvelopeDuplicateForbiddenIssue(BaseModel):
    message: str


class EnvelopeDuplicateForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeDuplicateForbiddenIssue]] = None


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

    data: EnvelopeDuplicateForbiddenErrorData = field(hash=False)

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


class EnvelopeDuplicateUnauthorizedIssue(BaseModel):
    message: str


class EnvelopeDuplicateUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeDuplicateUnauthorizedIssue]] = None


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

    data: EnvelopeDuplicateUnauthorizedErrorData = field(hash=False)

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


class EnvelopeDuplicateBadRequestIssue(BaseModel):
    message: str


class EnvelopeDuplicateBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[EnvelopeDuplicateBadRequestIssue]] = None


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

    data: EnvelopeDuplicateBadRequestErrorData = field(hash=False)

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

    id: str


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

    id: str
