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

from __future__ import annotations
from .documentresponse import DocumentResponse, DocumentResponseTypedDict
from .errorresponse import ErrorResponse, ErrorResponseTypedDict
from postivo_client.types import BaseModel
from postivo_client.utils import FieldMetadata, PathParamMetadata
from typing import Dict, List, Literal, Union
from typing_extensions import Annotated, TypeAliasType, TypedDict


DocumentType = Literal[
    # Dispatch confirmation certificate
    "dispatch_cert",
    # Envelope template preview
    "envelope",
    # EPO certificate in PDF format (Elektroniczne Potwierdzenie Odbioru)
    "epo_pdf",
    # EPO certificate in XML format (Elektroniczne Potwierdzenie Odbioru)
    "epo_xml",
]
r"""Type of document/certificate to generate."""


class GetDocumentsRequestTypedDict(TypedDict):
    id: str
    r"""Single shipment ID assigned by the system when the shipment was created."""
    type: DocumentType
    r"""Type of document/certificate to generate."""


class GetDocumentsRequest(BaseModel):
    id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""Single shipment ID assigned by the system when the shipment was created."""

    type: Annotated[
        DocumentType,
        FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
    ]
    r"""Type of document/certificate to generate."""


GetDocumentsResponseResultTypedDict = TypeAliasType(
    "GetDocumentsResponseResultTypedDict",
    Union[DocumentResponseTypedDict, ErrorResponseTypedDict],
)


GetDocumentsResponseResult = TypeAliasType(
    "GetDocumentsResponseResult", Union[DocumentResponse, ErrorResponse]
)


class GetDocumentsResponseTypedDict(TypedDict):
    headers: Dict[str, List[str]]
    result: GetDocumentsResponseResultTypedDict


class GetDocumentsResponse(BaseModel):
    headers: Dict[str, List[str]]

    result: GetDocumentsResponseResult
