"""Response schemas for wireless_controller 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 GetOrganizationWirelessControllerAvailabilitiesChangeHistoryResponseItemsItem(_BaseSchema):
    """Schema for GetOrganizationWirelessControllerAvailabilitiesChangeHistoryResponseItemsItem."""

    serial: str | None = None
    changes: list[WirelessControllerChangesItem] = Field(default_factory=list)


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

    serial: str | None = None
    network: WirelessControllerNetwork | None = None
    readings: list[WirelessControllerReadingsItem] = Field(default_factory=list)


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

    serial: str | None = None
    controller: WirelessControllerController | None = None
    network: WirelessControllerNetwork2 | None = None


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

    serial: str | None = None
    interfaces: list[WirelessControllerInterfacesItem] = Field(default_factory=list)


class GetOrganizationWirelessControllerDevicesInterfacesL2StatusesChangeHistoryByDeviceResponseItemsItem(
    _BaseSchema
):
    """Schema for GetOrganizationWirelessControllerDevicesInterfacesL2StatusesChangeHistoryByDevice
    ResponseItemsItem.
    """

    serial: str | None = None
    interfaces: list[WirelessControllerInterfacesItem2] = Field(default_factory=list)


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

    serial: str | None = None
    readings: list[WirelessControllerReadingsItem2] = Field(default_factory=list)


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

    serial: str | None = None
    interfaces: list[WirelessControllerInterfacesItem3] = Field(default_factory=list)


class GetOrganizationWirelessControllerDevicesInterfacesL3StatusesChangeHistoryByDeviceResponseItemsItem(
    _BaseSchema
):
    """Schema for GetOrganizationWirelessControllerDevicesInterfacesL3StatusesChangeHistoryByDevice
    ResponseItemsItem.
    """

    serial: str | None = None
    interfaces: list[WirelessControllerInterfacesItem2] = Field(default_factory=list)


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

    serial: str | None = None
    readings: list[WirelessControllerReadingsItem2] = Field(default_factory=list)


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

    serial: str | None = None
    interfaces: list[WirelessControllerInterfacesItem4] = Field(default_factory=list)


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

    serial: str | None = None
    intervals: list[WirelessControllerIntervalsItem] = Field(default_factory=list)


class GetOrganizationWirelessControllerDevicesRedundancyFailoverHistoryResponse(
    RootModel[list["GetOrganizationWirelessControllerDevicesRedundancyFailoverHistoryResponseItem"]]
):
    """Wireless LAN controller HA failover events."""


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

    serial: str | None = None
    ts: datetime | None = None
    reason: str | None = None
    failed: WirelessControllerFailed | None = None
    active: WirelessControllerFailed | None = None


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

    serial: str | None = None
    mode: str | None = None
    enabled: bool | None = None
    failover: WirelessControllerFailover | None = None
    mobility_mac: str | None = Field(
        default=None, validation_alias="mobilityMac", serialization_alias="mobilityMac"
    )


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

    serial: str | None = None
    intervals: list[WirelessControllerIntervalsItem2] = Field(default_factory=list)


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

    serial: str | None = None
    network: WirelessControllerNetwork | None = None
    counts: WirelessControllerCounts3 | None = None
    redundancy: WirelessControllerRedundancy | None = None
    firmware: WirelessControllerFirmware | None = None


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

    protocol: str | None = None
    address: str | None = None
    subnet: str | None = None


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

    address: str | None = None


class WirelessControllerAverage(_BaseSchema):
    """The average CPU usage of the wireless LAN controller."""

    percentage: float | None = None


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

    name: str | None = None
    usage: WirelessControllerUsage | None = None


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

    name: str | None = None
    usage: WirelessControllerRate | None = None


class WirelessControllerByStatus(_BaseSchema):
    """Client counts by its status."""

    online: int | None = None


class WirelessControllerByStatus2(_BaseSchema):
    """Access point counts by their status."""

    online: int | None = None
    offline: int | None = None


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

    start_ts: datetime | None = Field(
        default=None, validation_alias="startTs", serialization_alias="startTs"
    )
    end_ts: str | None = Field(default=None, validation_alias="endTs", serialization_alias="endTs")
    status: str | None = None


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

    ts: datetime | None = None
    status: str | None = None
    warnings: list[str] = Field(default_factory=list)
    errors: list[str] = Field(default_factory=list)


class WirelessControllerChannelGroup(_BaseSchema):
    """The channel group of this wireless LAN controller interface."""

    number: int | None = None


class WirelessControllerConnections(_BaseSchema):
    """Wireless LAN controller associated access point counts."""

    total: int | None = None
    by_status: WirelessControllerByStatus2 | None = Field(
        default=None, validation_alias="byStatus", serialization_alias="byStatus"
    )


class WirelessControllerController(_BaseSchema):
    """Associated wireless LAN controller."""

    serial: str | None = None


class WirelessControllerCounts(_BaseSchema):
    """Client counts."""

    by_status: WirelessControllerByStatus | None = Field(
        default=None, validation_alias="byStatus", serialization_alias="byStatus"
    )


class WirelessControllerCounts2(_BaseSchema):
    """Wireless LAN controller switchover counts."""

    total: int | None = None


class WirelessControllerCounts3(_BaseSchema):
    """Wireless LAN controller client and access point counts."""

    clients: WirelessControllerCounts | None = None
    connections: WirelessControllerConnections | None = None


class WirelessControllerFailed(_BaseSchema):
    """Details about the failed unit."""

    chassis: WirelessControllerVrf | None = None


class WirelessControllerFailover(_BaseSchema):
    """Wireless LAN controller failover information."""

    last: WirelessControllerLast | None = None
    counts: WirelessControllerCounts2 | None = None


class WirelessControllerFirmware(_BaseSchema):
    """Wireless LAN controller device firmware information."""

    version: WirelessControllerVersion | None = None


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

    name: str | None = None
    description: str | None = None
    enabled: bool | None = None
    mac: str | None = None
    status: str | None = None
    speed: str | None = None
    is_uplink: bool | None = Field(
        default=None, validation_alias="isUplink", serialization_alias="isUplink"
    )
    vlan: int | None = None
    is_redundancy_port: bool | None = Field(
        default=None, validation_alias="isRedundancyPort", serialization_alias="isRedundancyPort"
    )
    link_negotiation: str | None = Field(
        default=None, validation_alias="linkNegotiation", serialization_alias="linkNegotiation"
    )
    channel_group: WirelessControllerChannelGroup | None = Field(
        default=None, validation_alias="channelGroup", serialization_alias="channelGroup"
    )
    module: WirelessControllerModule | None = None


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

    name: str | None = None
    mac: str | None = None
    changes: list[WirelessControllerChangesItem2] = Field(default_factory=list)


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

    name: str | None = None
    description: str | None = None
    mac: str | None = None
    status: str | None = None
    speed: str | None = None
    addresses: list[WirelessControllerAddressesItem] = Field(default_factory=list)
    vrf: WirelessControllerVrf | None = None
    is_uplink: bool | None = Field(
        default=None, validation_alias="isUplink", serialization_alias="isUplink"
    )
    vlan: int | None = None
    link_negotiation: str | None = Field(
        default=None, validation_alias="linkNegotiation", serialization_alias="linkNegotiation"
    )
    channel_group: WirelessControllerChannelGroup | None = Field(
        default=None, validation_alias="channelGroup", serialization_alias="channelGroup"
    )
    module: WirelessControllerModule | None = None


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

    name: str | None = None
    readings: list[WirelessControllerReadingsItem3] = Field(default_factory=list)


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

    start_ts: str | None = Field(
        default=None, validation_alias="startTs", serialization_alias="startTs"
    )
    end_ts: str | None = Field(default=None, validation_alias="endTs", serialization_alias="endTs")
    overall: WirelessControllerRate | None = None
    by_interface: list[WirelessControllerByInterfaceItem] = Field(
        default_factory=list, validation_alias="byInterface", serialization_alias="byInterface"
    )


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

    start_ts: str | None = Field(
        default=None, validation_alias="startTs", serialization_alias="startTs"
    )
    end_ts: str | None = Field(default=None, validation_alias="endTs", serialization_alias="endTs")
    overall: WirelessControllerOverall | None = None
    by_core: list[WirelessControllerByCoreItem] = Field(
        default_factory=list, validation_alias="byCore", serialization_alias="byCore"
    )


class WirelessControllerLast(_BaseSchema):
    """Wireless LAN controller last failover information."""

    ts: datetime | None = None
    reason: str | None = None


class WirelessControllerManagement(_BaseSchema):
    """Wireless LAN controller redundancy management interface information."""

    addresses: list[WirelessControllerAddressesItem2] = Field(default_factory=list)


class WirelessControllerModule(_BaseSchema):
    """The module of this wireless LAN controller interface."""

    model: str | None = None


class WirelessControllerNetwork(_BaseSchema):
    """Wireless LAN controller network."""

    id: str | None = None


class WirelessControllerNetwork2(_BaseSchema):
    """Access points network."""

    id: str | None = None
    url: str | None = None
    name: str | None = None


class WirelessControllerOverall(_BaseSchema):
    """The overall CPU usage of the wireless LAN controller."""

    usage: WirelessControllerUsage | None = None


class WirelessControllerRate(_BaseSchema):
    """The interface packet rates measured in packets per second."""

    total: int | None = None
    recv: int | None = None
    send: int | None = None


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

    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"
    )
    counts: WirelessControllerCounts | None = None


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

    name: str | None = None
    mac: str | None = None
    recv: int | None = None
    send: int | None = None


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

    name: str | None = None
    total: int | None = None
    recv: int | None = None
    send: int | None = None
    rate: WirelessControllerRate | None = None


class WirelessControllerRedundancy(_BaseSchema):
    """Wireless LAN controller redundancy information."""

    role: str | None = None
    id: str | None = None
    chassis_name: str | None = Field(
        default=None, validation_alias="chassisName", serialization_alias="chassisName"
    )
    redundant_serial: str | None = Field(
        default=None, validation_alias="redundantSerial", serialization_alias="redundantSerial"
    )
    management: WirelessControllerManagement | None = None


class WirelessControllerUsage(_BaseSchema):
    """The CPU usage of the wireless LAN controller."""

    average: WirelessControllerAverage | None = None


class WirelessControllerVersion(_BaseSchema):
    """Wireless LAN controller firmware version."""

    short_name: str | None = Field(
        default=None, validation_alias="shortName", serialization_alias="shortName"
    )


class WirelessControllerVrf(_BaseSchema):
    """The virtual routing and forwarding (VRF) for the wireless LAN controller interface."""

    name: str | None = None
