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

from __future__ import annotations
from enum import Enum
from honeyhive.models.components import (
    experimentresultresponse as components_experimentresultresponse,
)
from honeyhive.types import BaseModel
from honeyhive.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
import httpx
from typing import Optional, TypedDict
from typing_extensions import Annotated, NotRequired


class AggregateFunction(str, Enum):
    AVERAGE = "average"
    MIN = "min"
    MAX = "max"
    MEDIAN = "median"
    P95 = "p95"
    P99 = "p99"
    P90 = "p90"
    SUM = "sum"
    COUNT = "count"


class GetExperimentResultRequestTypedDict(TypedDict):
    run_id: str
    project_id: str
    aggregate_function: NotRequired[AggregateFunction]


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

    project_id: Annotated[
        str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
    ]

    aggregate_function: Annotated[
        Optional[AggregateFunction],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None


class GetExperimentResultResponseTypedDict(TypedDict):
    content_type: str
    r"""HTTP response content type for this operation"""
    status_code: int
    r"""HTTP response status code for this operation"""
    raw_response: httpx.Response
    r"""Raw HTTP response; suitable for custom response parsing"""
    experiment_result_response: NotRequired[
        components_experimentresultresponse.ExperimentResultResponseTypedDict
    ]
    r"""Experiment result retrieved successfully"""


class GetExperimentResultResponse(BaseModel):
    content_type: str
    r"""HTTP response content type for this operation"""

    status_code: int
    r"""HTTP response status code for this operation"""

    raw_response: httpx.Response
    r"""Raw HTTP response; suitable for custom response parsing"""

    experiment_result_response: Optional[
        components_experimentresultresponse.ExperimentResultResponse
    ] = None
    r"""Experiment result retrieved successfully"""
