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

from __future__ import annotations
from amds.types import BaseModel
from amds.utils import FieldMetadata, PathParamMetadata, RequestMetadata
from typing import Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class RunCodeRequestBodyTypedDict(TypedDict):
    code: NotRequired[str]
    kernel_name: NotRequired[str]


class RunCodeRequestBody(BaseModel):
    code: Optional[str] = None

    kernel_name: Optional[str] = None


class RunCodeRequestTypedDict(TypedDict):
    server_name: str
    request_body: NotRequired[RunCodeRequestBodyTypedDict]


class RunCodeRequest(BaseModel):
    server_name: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]

    request_body: Annotated[
        Optional[RunCodeRequestBody],
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ] = None


class MetadataTypedDict(TypedDict):
    pass


class Metadata(BaseModel):
    pass


class OutputsTypedDict(TypedDict):
    name: NotRequired[str]
    output_type: NotRequired[str]
    text: NotRequired[str]


class Outputs(BaseModel):
    name: Optional[str] = None

    output_type: Optional[str] = None

    text: Optional[str] = None


class RunCodeContentTypedDict(TypedDict):
    cell_type: NotRequired[str]
    execution_count: NotRequired[float]
    metadata: NotRequired[MetadataTypedDict]
    outputs: NotRequired[List[OutputsTypedDict]]
    source: NotRequired[str]


class RunCodeContent(BaseModel):
    cell_type: Optional[str] = None

    execution_count: Optional[float] = None

    metadata: Optional[Metadata] = None

    outputs: Optional[List[Outputs]] = None

    source: Optional[str] = None


class RunCodeResponseBodyTypedDict(TypedDict):
    r"""Run Code"""

    content: NotRequired[RunCodeContentTypedDict]
    status: NotRequired[str]


class RunCodeResponseBody(BaseModel):
    r"""Run Code"""

    content: Optional[RunCodeContent] = None

    status: Optional[str] = None


class RunCodeResponseTypedDict(TypedDict):
    headers: Dict[str, List[str]]
    result: RunCodeResponseBodyTypedDict


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

    result: RunCodeResponseBody
