"""Response schemas for insight endpoints.

This module is automatically @generated from the Meraki API specification.
Do not edit this file manually.
"""

from __future__ import annotations

from datetime import datetime

from pydantic import Field, RootModel

from meraki_client.schemas._base import _BaseSchema


class CreateOrganizationInsightMonitoredMediaServerResponse(_BaseSchema):
    """Response for createOrganizationInsightMonitoredMediaServer operation."""

    id: str | None = None
    name: str | None = None
    address: str | None = None
    best_effort_monitoring_enabled: bool | None = Field(
        default=None,
        validation_alias="bestEffortMonitoringEnabled",
        serialization_alias="bestEffortMonitoringEnabled",
    )


class GetNetworkInsightApplicationHealthByTimeResponse(
    RootModel[list["GetNetworkInsightApplicationHealthByTimeResponseItem"]]
):
    """Response for getNetworkInsightApplicationHealthByTime operation."""


class GetNetworkInsightApplicationHealthByTimeResponseItem(_BaseSchema):
    """Schema for GetNetworkInsightApplicationHealthByTimeResponseItem."""

    start_ts: datetime | None = Field(
        default=None, validation_alias="startTs", serialization_alias="startTs"
    )
    end_ts: datetime | None = Field(
        default=None, validation_alias="endTs", serialization_alias="endTs"
    )
    wan_goodput: int | None = Field(
        default=None, validation_alias="wanGoodput", serialization_alias="wanGoodput"
    )
    lan_goodput: int | None = Field(
        default=None, validation_alias="lanGoodput", serialization_alias="lanGoodput"
    )
    wan_latency_ms: float | None = Field(
        default=None, validation_alias="wanLatencyMs", serialization_alias="wanLatencyMs"
    )
    lan_latency_ms: float | None = Field(
        default=None, validation_alias="lanLatencyMs", serialization_alias="lanLatencyMs"
    )
    wan_loss_percent: float | None = Field(
        default=None, validation_alias="wanLossPercent", serialization_alias="wanLossPercent"
    )
    lan_loss_percent: float | None = Field(
        default=None, validation_alias="lanLossPercent", serialization_alias="lanLossPercent"
    )
    response_duration: int | None = Field(
        default=None, validation_alias="responseDuration", serialization_alias="responseDuration"
    )
    sent: int | None = None
    recv: int | None = None
    num_clients: int | None = Field(
        default=None, validation_alias="numClients", serialization_alias="numClients"
    )


class GetOrganizationInsightApplicationsResponse(
    RootModel[list["GetOrganizationInsightApplicationsResponseItem"]]
):
    """Response for getOrganizationInsightApplications operation."""


class GetOrganizationInsightApplicationsResponseItem(_BaseSchema):
    """Schema for GetOrganizationInsightApplicationsResponseItem."""

    application_id: str | None = Field(
        default=None, validation_alias="applicationId", serialization_alias="applicationId"
    )
    name: str | None = None
    thresholds: InsightThresholds | None = None


class GetOrganizationInsightMonitoredMediaServerResponse(_BaseSchema):
    """Response for getOrganizationInsightMonitoredMediaServer operation."""

    id: str | None = None
    name: str | None = None
    address: str | None = None
    best_effort_monitoring_enabled: bool | None = Field(
        default=None,
        validation_alias="bestEffortMonitoringEnabled",
        serialization_alias="bestEffortMonitoringEnabled",
    )


class GetOrganizationInsightMonitoredMediaServersResponse(
    RootModel[list["GetOrganizationInsightMonitoredMediaServersResponseItem"]]
):
    """Response for getOrganizationInsightMonitoredMediaServers operation."""


class GetOrganizationInsightMonitoredMediaServersResponseItem(_BaseSchema):
    """Schema for GetOrganizationInsightMonitoredMediaServersResponseItem."""

    id: str | None = None
    name: str | None = None
    address: str | None = None
    best_effort_monitoring_enabled: bool | None = Field(
        default=None,
        validation_alias="bestEffortMonitoringEnabled",
        serialization_alias="bestEffortMonitoringEnabled",
    )


class InsightByNetworkItem(_BaseSchema):
    """Schema for InsightByNetworkItem."""

    network_id: str | None = Field(
        default=None, validation_alias="networkId", serialization_alias="networkId"
    )
    goodput: int | None = None
    response_duration: int | None = Field(
        default=None, validation_alias="responseDuration", serialization_alias="responseDuration"
    )


class InsightThresholds(_BaseSchema):
    """Thresholds defined by a user or Meraki models for each application."""

    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    by_network: list[InsightByNetworkItem] = Field(
        default_factory=list, validation_alias="byNetwork", serialization_alias="byNetwork"
    )


class UpdateOrganizationInsightMonitoredMediaServerResponse(_BaseSchema):
    """Response for updateOrganizationInsightMonitoredMediaServer operation."""

    id: str | None = None
    name: str | None = None
    address: str | None = None
    best_effort_monitoring_enabled: bool | None = Field(
        default=None,
        validation_alias="bestEffortMonitoringEnabled",
        serialization_alias="bestEffortMonitoringEnabled",
    )
