"""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, alias="bestEffortMonitoringEnabled"
    )


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


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

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


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


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

    application_id: str | None = Field(default=None, 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, 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, alias="bestEffortMonitoringEnabled"
    )


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

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


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

    type_: str | None = Field(default=None, alias="type")
    by_network: list[InsightByNetworkItem] | None = Field(default=None, 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, alias="bestEffortMonitoringEnabled"
    )
