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

from __future__ import annotations
from .deploymentresponse import DeploymentResponse, DeploymentResponseTypedDict
from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL
from pydantic import model_serializer
from typing import List
from typing_extensions import TypedDict


class DeploymentListResponseTypedDict(TypedDict):
    deployments: List[DeploymentResponseTypedDict]
    r"""List of deployments"""
    next_cursor: Nullable[str]
    r"""Cursor for the next page of results"""
    workspace_id: str
    r"""Workspace ID the results are scoped to"""


class DeploymentListResponse(BaseModel):
    deployments: List[DeploymentResponse]
    r"""List of deployments"""

    next_cursor: Nullable[str]
    r"""Cursor for the next page of results"""

    workspace_id: str
    r"""Workspace ID the results are scoped to"""

    @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
