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

from __future__ import annotations
from enum import Enum
import io
from novu_py.types import BaseModel
from novu_py.utils import (
    FieldMetadata,
    HeaderMetadata,
    MultipartFormMetadata,
    RequestMetadata,
)
import pydantic
from typing import IO, List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict


class TranslationControllerUploadTranslationFilesResourceType(str, Enum):
    r"""The resource type to associate localizations with"""

    WORKFLOW = "workflow"
    LAYOUT = "layout"


class FilesTypedDict(TypedDict):
    file_name: str
    content: Union[bytes, IO[bytes], io.BufferedReader]
    content_type: NotRequired[str]


class Files(BaseModel):
    file_name: Annotated[
        str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True)
    ]

    content: Annotated[
        Union[bytes, IO[bytes], io.BufferedReader],
        pydantic.Field(alias=""),
        FieldMetadata(multipart=MultipartFormMetadata(content=True)),
    ]

    content_type: Annotated[
        Optional[str],
        pydantic.Field(alias="Content-Type"),
        FieldMetadata(multipart=True),
    ] = None


class TranslationControllerUploadTranslationFilesRequestBodyTypedDict(TypedDict):
    resource_id: str
    r"""The resource ID to associate localizations with. Accepts identifier or slug format"""
    resource_type: TranslationControllerUploadTranslationFilesResourceType
    r"""The resource type to associate localizations with"""
    files: List[FilesTypedDict]
    r"""One or more JSON translation files. Filenames must match locale format (e.g., en_US.json, fr_FR.json). Field name can be \"files\" or \"files[]\"."""


class TranslationControllerUploadTranslationFilesRequestBody(BaseModel):
    resource_id: Annotated[
        str, pydantic.Field(alias="resourceId"), FieldMetadata(multipart=True)
    ]
    r"""The resource ID to associate localizations with. Accepts identifier or slug format"""

    resource_type: Annotated[
        TranslationControllerUploadTranslationFilesResourceType,
        pydantic.Field(alias="resourceType"),
        FieldMetadata(multipart=True),
    ]
    r"""The resource type to associate localizations with"""

    files: Annotated[
        List[Files], FieldMetadata(multipart=MultipartFormMetadata(file=True))
    ]
    r"""One or more JSON translation files. Filenames must match locale format (e.g., en_US.json, fr_FR.json). Field name can be \"files\" or \"files[]\"."""


class TranslationControllerUploadTranslationFilesRequestTypedDict(TypedDict):
    request_body: TranslationControllerUploadTranslationFilesRequestBodyTypedDict
    idempotency_key: NotRequired[str]
    r"""A header for idempotency purposes"""


class TranslationControllerUploadTranslationFilesRequest(BaseModel):
    request_body: Annotated[
        TranslationControllerUploadTranslationFilesRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")),
    ]

    idempotency_key: Annotated[
        Optional[str],
        pydantic.Field(alias="idempotency-key"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""A header for idempotency purposes"""
