"""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 DocumentRedistributeRequestTypedDict(TypedDict):
    document_id: float
    recipients: List[float]


class DocumentRedistributeRequest(BaseModel):
    document_id: Annotated[float, pydantic.Field(alias="documentId")]

    recipients: List[float]


class DocumentRedistributeInternalServerErrorIssueTypedDict(TypedDict):
    message: str


class DocumentRedistributeInternalServerErrorIssue(BaseModel):
    message: str


class DocumentRedistributeInternalServerErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentRedistributeInternalServerErrorIssue]] = None


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

    data: DocumentRedistributeInternalServerErrorData = field(hash=False)

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


class DocumentRedistributeForbiddenIssue(BaseModel):
    message: str


class DocumentRedistributeForbiddenErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentRedistributeForbiddenIssue]] = None


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

    data: DocumentRedistributeForbiddenErrorData = field(hash=False)

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


class DocumentRedistributeUnauthorizedIssue(BaseModel):
    message: str


class DocumentRedistributeUnauthorizedErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentRedistributeUnauthorizedIssue]] = None


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

    data: DocumentRedistributeUnauthorizedErrorData = field(hash=False)

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


class DocumentRedistributeBadRequestIssue(BaseModel):
    message: str


class DocumentRedistributeBadRequestErrorData(BaseModel):
    message: str

    code: str

    issues: Optional[List[DocumentRedistributeBadRequestIssue]] = None


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

    data: DocumentRedistributeBadRequestErrorData = field(hash=False)

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

    success: bool


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

    success: bool
