"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from documenso_sdk import utils
from documenso_sdk.types import BaseModel
import pydantic
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class TemplateCreateTemplateDirectLinkRequestBodyTypedDict(TypedDict):
    template_id: float
    direct_recipient_id: NotRequired[float]
    r"""The of the recipient in the current template to transform into the primary recipient when the template is used."""


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

    direct_recipient_id: Annotated[
        Optional[float], pydantic.Field(alias="directRecipientId")
    ] = None
    r"""The of the recipient in the current template to transform into the primary recipient when the template is used."""


class TemplateCreateTemplateDirectLinkTemplatesDirectLinkIssuesTypedDict(TypedDict):
    message: str


class TemplateCreateTemplateDirectLinkTemplatesDirectLinkIssues(BaseModel):
    message: str


class TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseResponseBodyData(
    BaseModel
):
    message: str

    code: str

    issues: Optional[
        List[TemplateCreateTemplateDirectLinkTemplatesDirectLinkIssues]
    ] = None


class TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseResponseBody(
    Exception
):
    r"""Internal server error"""

    data: TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseResponseBodyData

    def __init__(
        self,
        data: TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseResponseBodyData,
    ):
        self.data = data

    def __str__(self) -> str:
        return utils.marshal_json(
            self.data,
            TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseResponseBodyData,
        )


class TemplateCreateTemplateDirectLinkIssuesTypedDict(TypedDict):
    message: str


class TemplateCreateTemplateDirectLinkIssues(BaseModel):
    message: str


class TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseBodyData(BaseModel):
    message: str

    code: str

    issues: Optional[List[TemplateCreateTemplateDirectLinkIssues]] = None


class TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseBody(Exception):
    r"""Invalid input data"""

    data: TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseBodyData

    def __init__(
        self, data: TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseBodyData
    ):
        self.data = data

    def __str__(self) -> str:
        return utils.marshal_json(
            self.data,
            TemplateCreateTemplateDirectLinkTemplatesDirectLinkResponseBodyData,
        )


class TemplateCreateTemplateDirectLinkResponseBodyTypedDict(TypedDict):
    r"""Successful response"""

    id: str
    template_id: int
    token: str
    created_at: str
    enabled: bool
    direct_template_recipient_id: int


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

    id: str

    template_id: Annotated[int, pydantic.Field(alias="templateId")]

    token: str

    created_at: Annotated[str, pydantic.Field(alias="createdAt")]

    enabled: bool

    direct_template_recipient_id: Annotated[
        int, pydantic.Field(alias="directTemplateRecipientId")
    ]
