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

from __future__ import annotations
from novu_py.types import BaseModel, UNSET_SENTINEL
from pydantic import model_serializer
from typing import List, Optional
from typing_extensions import NotRequired, TypedDict


class ImportMasterJSONResponseDtoTypedDict(TypedDict):
    success: bool
    r"""Overall success status of the import operation"""
    message: str
    r"""Human-readable message describing the import result"""
    successful: NotRequired[List[str]]
    r"""List of resource IDs that were successfully imported"""
    failed: NotRequired[List[str]]
    r"""List of resource IDs that failed to import"""


class ImportMasterJSONResponseDto(BaseModel):
    success: bool
    r"""Overall success status of the import operation"""

    message: str
    r"""Human-readable message describing the import result"""

    successful: Optional[List[str]] = None
    r"""List of resource IDs that were successfully imported"""

    failed: Optional[List[str]] = None
    r"""List of resource IDs that failed to import"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["successful", "failed"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k)

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m
