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

from __future__ import annotations
from datetime import datetime
from honeyhive.types import BaseModel
import pydantic
from typing import List, Optional, TypedDict, Union
from typing_extensions import Annotated, NotRequired


OldValuesTypedDict = Union[float, bool]


OldValues = Union[float, bool]


NewValuesTypedDict = Union[float, bool]


NewValues = Union[float, bool]


class ExperimentComparisonResponseMetricsTypedDict(TypedDict):
    metric_name: NotRequired[str]
    event_name: NotRequired[str]
    metric_type: NotRequired[str]
    event_type: NotRequired[str]
    old_aggregate: NotRequired[float]
    new_aggregate: NotRequired[float]
    found_count: NotRequired[int]
    improved_count: NotRequired[int]
    degraded_count: NotRequired[int]
    same_count: NotRequired[int]
    improved: NotRequired[List[str]]
    degraded: NotRequired[List[str]]
    same: NotRequired[List[str]]
    old_values: NotRequired[List[OldValuesTypedDict]]
    new_values: NotRequired[List[NewValuesTypedDict]]


class ExperimentComparisonResponseMetrics(BaseModel):
    metric_name: Optional[str] = None

    event_name: Optional[str] = None

    metric_type: Optional[str] = None

    event_type: Optional[str] = None

    old_aggregate: Optional[float] = None

    new_aggregate: Optional[float] = None

    found_count: Optional[int] = None

    improved_count: Optional[int] = None

    degraded_count: Optional[int] = None

    same_count: Optional[int] = None

    improved: Optional[List[str]] = None

    degraded: Optional[List[str]] = None

    same: Optional[List[str]] = None

    old_values: Optional[List[OldValues]] = None

    new_values: Optional[List[NewValues]] = None


class EventDetailsTypedDict(TypedDict):
    event_name: NotRequired[str]
    event_type: NotRequired[str]
    presence: NotRequired[str]


class EventDetails(BaseModel):
    event_name: Optional[str] = None

    event_type: Optional[str] = None

    presence: Optional[str] = None


class EvaluatorsTypedDict(TypedDict):
    pass


class Evaluators(BaseModel):
    pass


class ExperimentComparisonResponseResultsTypedDict(TypedDict):
    pass


class ExperimentComparisonResponseResults(BaseModel):
    pass


class ExperimentComparisonResponseSchemasConfigurationTypedDict(TypedDict):
    pass


class ExperimentComparisonResponseSchemasConfiguration(BaseModel):
    pass


class MetadataTypedDict(TypedDict):
    pass


class Metadata(BaseModel):
    pass


class PassingRangesTypedDict(TypedDict):
    pass


class PassingRanges(BaseModel):
    pass


class OldRunTypedDict(TypedDict):
    id: NotRequired[str]
    run_id: NotRequired[str]
    project: NotRequired[str]
    tenant: NotRequired[str]
    created_at: NotRequired[datetime]
    event_ids: NotRequired[List[str]]
    session_ids: NotRequired[List[str]]
    dataset_id: NotRequired[str]
    datapoint_ids: NotRequired[List[str]]
    evaluators: NotRequired[List[EvaluatorsTypedDict]]
    results: NotRequired[ExperimentComparisonResponseResultsTypedDict]
    configuration: NotRequired[
        ExperimentComparisonResponseSchemasConfigurationTypedDict
    ]
    metadata: NotRequired[MetadataTypedDict]
    passing_ranges: NotRequired[PassingRangesTypedDict]
    status: NotRequired[str]
    name: NotRequired[str]


class OldRun(BaseModel):
    id: Annotated[Optional[str], pydantic.Field(alias="_id")] = None

    run_id: Optional[str] = None

    project: Optional[str] = None

    tenant: Optional[str] = None

    created_at: Optional[datetime] = None

    event_ids: Optional[List[str]] = None

    session_ids: Optional[List[str]] = None

    dataset_id: Optional[str] = None

    datapoint_ids: Optional[List[str]] = None

    evaluators: Optional[List[Evaluators]] = None

    results: Optional[ExperimentComparisonResponseResults] = None

    configuration: Optional[ExperimentComparisonResponseSchemasConfiguration] = None

    metadata: Optional[Metadata] = None

    passing_ranges: Optional[PassingRanges] = None

    status: Optional[str] = None

    name: Optional[str] = None


class ExperimentComparisonResponseEvaluatorsTypedDict(TypedDict):
    pass


class ExperimentComparisonResponseEvaluators(BaseModel):
    pass


class ExperimentComparisonResponseSchemasResultsTypedDict(TypedDict):
    pass


class ExperimentComparisonResponseSchemasResults(BaseModel):
    pass


class ExperimentComparisonResponseConfigurationTypedDict(TypedDict):
    pass


class ExperimentComparisonResponseConfiguration(BaseModel):
    pass


class ExperimentComparisonResponseMetadataTypedDict(TypedDict):
    pass


class ExperimentComparisonResponseMetadata(BaseModel):
    pass


class ExperimentComparisonResponsePassingRangesTypedDict(TypedDict):
    pass


class ExperimentComparisonResponsePassingRanges(BaseModel):
    pass


class NewRunTypedDict(TypedDict):
    id: NotRequired[str]
    run_id: NotRequired[str]
    project: NotRequired[str]
    tenant: NotRequired[str]
    created_at: NotRequired[datetime]
    event_ids: NotRequired[List[str]]
    session_ids: NotRequired[List[str]]
    dataset_id: NotRequired[str]
    datapoint_ids: NotRequired[List[str]]
    evaluators: NotRequired[List[ExperimentComparisonResponseEvaluatorsTypedDict]]
    results: NotRequired[ExperimentComparisonResponseSchemasResultsTypedDict]
    configuration: NotRequired[ExperimentComparisonResponseConfigurationTypedDict]
    metadata: NotRequired[ExperimentComparisonResponseMetadataTypedDict]
    passing_ranges: NotRequired[ExperimentComparisonResponsePassingRangesTypedDict]
    status: NotRequired[str]
    name: NotRequired[str]


class NewRun(BaseModel):
    id: Annotated[Optional[str], pydantic.Field(alias="_id")] = None

    run_id: Optional[str] = None

    project: Optional[str] = None

    tenant: Optional[str] = None

    created_at: Optional[datetime] = None

    event_ids: Optional[List[str]] = None

    session_ids: Optional[List[str]] = None

    dataset_id: Optional[str] = None

    datapoint_ids: Optional[List[str]] = None

    evaluators: Optional[List[ExperimentComparisonResponseEvaluators]] = None

    results: Optional[ExperimentComparisonResponseSchemasResults] = None

    configuration: Optional[ExperimentComparisonResponseConfiguration] = None

    metadata: Optional[ExperimentComparisonResponseMetadata] = None

    passing_ranges: Optional[ExperimentComparisonResponsePassingRanges] = None

    status: Optional[str] = None

    name: Optional[str] = None


class ExperimentComparisonResponseTypedDict(TypedDict):
    metrics: NotRequired[List[ExperimentComparisonResponseMetricsTypedDict]]
    common_datapoints: NotRequired[List[str]]
    event_details: NotRequired[List[EventDetailsTypedDict]]
    old_run: NotRequired[OldRunTypedDict]
    new_run: NotRequired[NewRunTypedDict]


class ExperimentComparisonResponse(BaseModel):
    metrics: Optional[List[ExperimentComparisonResponseMetrics]] = None

    common_datapoints: Annotated[
        Optional[List[str]], pydantic.Field(alias="commonDatapoints")
    ] = None

    event_details: Optional[List[EventDetails]] = None

    old_run: Optional[OldRun] = None

    new_run: Optional[NewRun] = None
