"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
# @generated-id: b4746c0f2c1c

from __future__ import annotations
from datetime import datetime
from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL
from pydantic import model_serializer
from typing import Dict
from typing_extensions import TypedDict


class IngestionPipelineConfigurationTypedDict(TypedDict):
    id: str
    author_id: str
    name: str
    created_at: datetime
    modified_at: datetime
    last_run_time: Nullable[datetime]
    last_run_chunks_count: int
    total_chunks_count: int
    pipeline_composition: Nullable[Dict[str, str]]


class IngestionPipelineConfiguration(BaseModel):
    id: str

    author_id: str

    name: str

    created_at: datetime

    modified_at: datetime

    last_run_time: Nullable[datetime]

    last_run_chunks_count: int

    total_chunks_count: int

    pipeline_composition: Nullable[Dict[str, str]]

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m
