"""Response schemas for switch 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 typing import Any

from pydantic import Field, RootModel

from meraki_client.schemas._base import _BaseSchema


class CloneOrganizationSwitchDevicesResponse(_BaseSchema):
    """Response for cloneOrganizationSwitchDevices operation."""

    source_serial: str | None = Field(
        default=None, validation_alias="sourceSerial", serialization_alias="sourceSerial"
    )
    target_serials: list[str] = Field(
        default_factory=list, validation_alias="targetSerials", serialization_alias="targetSerials"
    )


class CreateDeviceSwitchRoutingInterfaceIpv6(_BaseSchema):
    """The IPv6 settings of the interface."""

    assignment_mode: str | None = Field(
        default=None, validation_alias="assignmentMode", serialization_alias="assignmentMode"
    )
    prefix: str | None = None
    address: str | None = None
    gateway: str | None = None


class CreateDeviceSwitchRoutingInterfaceOspfSettings(_BaseSchema):
    """The OSPF routing settings of the interface."""

    area: str | None = None
    cost: int | None = None
    is_passive_enabled: bool | None = Field(
        default=None, validation_alias="isPassiveEnabled", serialization_alias="isPassiveEnabled"
    )
    network_type: str | None = Field(
        default=None, validation_alias="networkType", serialization_alias="networkType"
    )


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

    interface_id: str | None = Field(
        default=None, validation_alias="interfaceId", serialization_alias="interfaceId"
    )
    name: str | None = None
    mode: str | None = None
    subnet: str | None = None
    interface_ip: str | None = Field(
        default=None, validation_alias="interfaceIp", serialization_alias="interfaceIp"
    )
    serial: str | None = None
    switch_port_id: str | None = Field(
        default=None, validation_alias="switchPortId", serialization_alias="switchPortId"
    )
    multicast_routing: str | None = Field(
        default=None, validation_alias="multicastRouting", serialization_alias="multicastRouting"
    )
    vlan_id: int | None = Field(
        default=None, validation_alias="vlanId", serialization_alias="vlanId"
    )
    uplink_v4: bool | None = Field(
        default=None, validation_alias="uplinkV4", serialization_alias="uplinkV4"
    )
    uplink_v6: bool | None = Field(
        default=None, validation_alias="uplinkV6", serialization_alias="uplinkV6"
    )
    ospf_settings: SwitchOspfSettings | None = Field(
        default=None, validation_alias="ospfSettings", serialization_alias="ospfSettings"
    )
    ospf_v3: SwitchOspfSettings | None = Field(
        default=None, validation_alias="ospfV3", serialization_alias="ospfV3"
    )
    ipv6: SwitchIpv6 | None = None
    vrf: SwitchVrf | None = None
    loopback: dict[str, Any] | None = None
    default_gateway: str | None = Field(
        default=None, validation_alias="defaultGateway", serialization_alias="defaultGateway"
    )


class CreateDeviceSwitchRoutingInterfaceVrf(_BaseSchema):
    """The VRF settings of the interface. Requires IOS XE 17.18 or higher."""

    name: str | None = None


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

    static_route_id: str = Field(
        validation_alias="staticRouteId", serialization_alias="staticRouteId"
    )
    name: str | None = None
    subnet: str
    next_hop_ip: str = Field(validation_alias="nextHopIp", serialization_alias="nextHopIp")
    management_next_hop: str | None = Field(
        default=None, validation_alias="managementNextHop", serialization_alias="managementNextHop"
    )
    vrf: SwitchVrf2 | None = None
    advertise_via_ospf_enabled: bool | None = Field(
        default=None,
        validation_alias="advertiseViaOspfEnabled",
        serialization_alias="advertiseViaOspfEnabled",
    )
    prefer_over_ospf_routes_enabled: bool | None = Field(
        default=None,
        validation_alias="preferOverOspfRoutesEnabled",
        serialization_alias="preferOverOspfRoutesEnabled",
    )


class CreateDeviceSwitchRoutingStaticRouteVrf(_BaseSchema):
    """The VRF settings of the interface. Requires IOS XE 17.18 or higher."""

    name: str | None = None
    leak_route_to_default_vrf: bool | None = Field(
        default=None,
        validation_alias="leakRouteToDefaultVrf",
        serialization_alias="leakRouteToDefaultVrf",
    )


class CreateNetworkSwitchAccessPolicyDot1x(_BaseSchema):
    """802.1x Settings."""

    control_direction: str | None = Field(
        default=None, validation_alias="controlDirection", serialization_alias="controlDirection"
    )


class CreateNetworkSwitchAccessPolicyRadius(_BaseSchema):
    """Object for RADIUS Settings."""

    critical_auth: SwitchCriticalAuth | None = Field(
        default=None, validation_alias="criticalAuth", serialization_alias="criticalAuth"
    )
    failed_auth_vlan_id: int | None = Field(
        default=None, validation_alias="failedAuthVlanId", serialization_alias="failedAuthVlanId"
    )
    failed_auth_group_policy_id: str | None = Field(
        default=None,
        validation_alias="failedAuthGroupPolicyId",
        serialization_alias="failedAuthGroupPolicyId",
    )
    failed_auth_sgt_id: int | None = Field(
        default=None, validation_alias="failedAuthSgtId", serialization_alias="failedAuthSgtId"
    )
    re_authentication_interval: int | None = Field(
        default=None,
        validation_alias="reAuthenticationInterval",
        serialization_alias="reAuthenticationInterval",
    )
    cache: SwitchCache | None = None
    authentication: CreateNetworkSwitchAccessPolicyRadiusAuthentication | None = None
    pre_authentication_group_policy_id: str | None = Field(
        default=None,
        validation_alias="preAuthenticationGroupPolicyId",
        serialization_alias="preAuthenticationGroupPolicyId",
    )


class CreateNetworkSwitchAccessPolicyRadiusAccountingServersItem(_BaseSchema):
    """Item schema for radiusAccountingServers."""

    organization_radius_server_id: str | None = Field(
        default=None,
        validation_alias="organizationRadiusServerId",
        serialization_alias="organizationRadiusServerId",
    )
    host: str | None = None
    port: int | None = None
    secret: str | None = None


class CreateNetworkSwitchAccessPolicyRadiusAuthentication(_BaseSchema):
    """Object for authentication mode settings."""

    mode: str | None = None


class CreateNetworkSwitchAccessPolicyRadiusServersItem(_BaseSchema):
    """Item schema for radiusServers."""

    organization_radius_server_id: str | None = Field(
        default=None,
        validation_alias="organizationRadiusServerId",
        serialization_alias="organizationRadiusServerId",
    )
    host: str | None = None
    port: int | None = None
    secret: str | None = None


class CreateNetworkSwitchDhcpServerPolicyArpInspectionTrustedServerIpv4(_BaseSchema):
    """The IPv4 attributes of the trusted server being added."""

    address: str | None = None


class CreateNetworkSwitchLinkAggregationSwitchPortsItem(_BaseSchema):
    """Item schema for switchPorts."""

    serial: str
    port_id: str = Field(validation_alias="portId", serialization_alias="portId")


class CreateNetworkSwitchLinkAggregationSwitchProfilePortsItem(_BaseSchema):
    """Item schema for switchProfilePorts."""

    profile: str
    port_id: str = Field(validation_alias="portId", serialization_alias="portId")


class CreateNetworkSwitchPortSchedulePortSchedule(_BaseSchema):
    """The schedule for switch port scheduling. Schedules are applied to days of the week. When
    it's empty, default schedule with all days of a week are configured. Any unspecified day in
    the schedule is added as a default schedule configuration of the day.
    """

    monday: SwitchMonday | None = None
    tuesday: SwitchMonday | None = None
    wednesday: SwitchMonday | None = None
    thursday: SwitchMonday | None = None
    friday: SwitchMonday | None = None
    saturday: SwitchMonday | None = None
    sunday: SwitchMonday | None = None


class CreateNetworkSwitchRoutingMulticastRendezvousPointVrf(_BaseSchema):
    """The VRF with PIM enabled L3 interface."""

    name: str | None = None


class CreateNetworkSwitchStackResponse(_BaseSchema):
    """Response for createNetworkSwitchStack operation."""

    id: str | None = None
    name: str | None = None
    serials: list[str] = Field(default_factory=list)
    workflow_id: str | None = Field(
        default=None, validation_alias="workflowId", serialization_alias="workflowId"
    )


class CreateNetworkSwitchStackRoutingInterfaceIpv6(_BaseSchema):
    """The IPv6 settings of the interface."""

    assignment_mode: str | None = Field(
        default=None, validation_alias="assignmentMode", serialization_alias="assignmentMode"
    )
    prefix: str | None = None
    address: str | None = None
    gateway: str | None = None


class CreateNetworkSwitchStackRoutingInterfaceOspfSettings(_BaseSchema):
    """The OSPF routing settings of the interface."""

    area: str | None = None
    cost: int | None = None
    is_passive_enabled: bool | None = Field(
        default=None, validation_alias="isPassiveEnabled", serialization_alias="isPassiveEnabled"
    )
    network_type: str | None = Field(
        default=None, validation_alias="networkType", serialization_alias="networkType"
    )


class CreateNetworkSwitchStackRoutingInterfaceVrf(_BaseSchema):
    """The VRF settings of the interface. Requires IOS XE 17.18 or higher."""

    name: str | None = None


class CreateNetworkSwitchStackRoutingStaticRouteVrf(_BaseSchema):
    """The VRF settings of the interface. Requires IOS XE 17.18 or higher."""

    name: str | None = None
    leak_route_to_default_vrf: bool | None = Field(
        default=None,
        validation_alias="leakRouteToDefaultVrf",
        serialization_alias="leakRouteToDefaultVrf",
    )


class CycleDeviceSwitchPortsResponse(_BaseSchema):
    """Response for cycleDeviceSwitchPorts operation."""

    ports: list[str] = Field(default_factory=list)


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

    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    name: str | None = None
    tags: list[str] = Field(default_factory=list)
    enabled: bool | None = None
    poe_enabled: bool | None = Field(
        default=None, validation_alias="poeEnabled", serialization_alias="poeEnabled"
    )
    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    vlan: int | None = None
    voice_vlan: int | None = Field(
        default=None, validation_alias="voiceVlan", serialization_alias="voiceVlan"
    )
    allowed_vlans: str | None = Field(
        default=None, validation_alias="allowedVlans", serialization_alias="allowedVlans"
    )
    isolation_enabled: bool | None = Field(
        default=None, validation_alias="isolationEnabled", serialization_alias="isolationEnabled"
    )
    rstp_enabled: bool | None = Field(
        default=None, validation_alias="rstpEnabled", serialization_alias="rstpEnabled"
    )
    stp_guard: str | None = Field(
        default=None, validation_alias="stpGuard", serialization_alias="stpGuard"
    )
    stp_port_fast_trunk: bool | None = Field(
        default=None, validation_alias="stpPortFastTrunk", serialization_alias="stpPortFastTrunk"
    )
    link_negotiation: str | None = Field(
        default=None, validation_alias="linkNegotiation", serialization_alias="linkNegotiation"
    )
    link_negotiation_capabilities: list[str] = Field(
        default_factory=list,
        validation_alias="linkNegotiationCapabilities",
        serialization_alias="linkNegotiationCapabilities",
    )
    port_schedule_id: str | None = Field(
        default=None, validation_alias="portScheduleId", serialization_alias="portScheduleId"
    )
    schedule: SwitchSchedule | None = None
    udld: str | None = None
    access_policy_type: str | None = Field(
        default=None, validation_alias="accessPolicyType", serialization_alias="accessPolicyType"
    )
    access_policy_number: int | None = Field(
        default=None,
        validation_alias="accessPolicyNumber",
        serialization_alias="accessPolicyNumber",
    )
    mac_allow_list: list[str] = Field(
        default_factory=list, validation_alias="macAllowList", serialization_alias="macAllowList"
    )
    mac_whitelist_limit: int | None = Field(
        default=None, validation_alias="macWhitelistLimit", serialization_alias="macWhitelistLimit"
    )
    sticky_mac_allow_list: list[str] = Field(
        default_factory=list,
        validation_alias="stickyMacAllowList",
        serialization_alias="stickyMacAllowList",
    )
    sticky_mac_allow_list_limit: int | None = Field(
        default=None,
        validation_alias="stickyMacAllowListLimit",
        serialization_alias="stickyMacAllowListLimit",
    )
    storm_control_enabled: bool | None = Field(
        default=None,
        validation_alias="stormControlEnabled",
        serialization_alias="stormControlEnabled",
    )
    adaptive_policy_group_id: str | None = Field(
        default=None,
        validation_alias="adaptivePolicyGroupId",
        serialization_alias="adaptivePolicyGroupId",
    )
    adaptive_policy_group: SwitchSchedule | None = Field(
        default=None,
        validation_alias="adaptivePolicyGroup",
        serialization_alias="adaptivePolicyGroup",
    )
    peer_sgt_capable: bool | None = Field(
        default=None, validation_alias="peerSgtCapable", serialization_alias="peerSgtCapable"
    )
    flexible_stacking_enabled: bool | None = Field(
        default=None,
        validation_alias="flexibleStackingEnabled",
        serialization_alias="flexibleStackingEnabled",
    )
    dai_trusted: bool | None = Field(
        default=None, validation_alias="daiTrusted", serialization_alias="daiTrusted"
    )
    profile: SwitchProfile | None = None
    module: SwitchModule | None = None
    mirror: SwitchMirror | None = None
    dot3az: SwitchDot3az | None = None
    high_speed: SwitchDot3az | None = Field(
        default=None, validation_alias="highSpeed", serialization_alias="highSpeed"
    )


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

    enabled: bool | None = None
    primary_serial: str | None = Field(
        default=None, validation_alias="primarySerial", serialization_alias="primarySerial"
    )
    spare_serial: str | None = Field(
        default=None, validation_alias="spareSerial", serialization_alias="spareSerial"
    )


class GetDeviceSwitchPortsResponse(RootModel[list["DeviceSwitchPortResponse"]]):
    """Response for getDeviceSwitchPorts operation."""


class GetDeviceSwitchPortsStatusesPacketsResponse(
    RootModel[list["GetDeviceSwitchPortsStatusesPacketsResponseItem"]]
):
    """Response for getDeviceSwitchPortsStatusesPackets operation."""


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

    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    packets: list[SwitchPacketsItem] = Field(default_factory=list)


class GetDeviceSwitchPortsStatusesResponse(
    RootModel[list["GetDeviceSwitchPortsStatusesResponseItem"]]
):
    """Response for getDeviceSwitchPortsStatuses operation."""


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

    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    enabled: bool | None = None
    status: str | None = None
    is_uplink: bool | None = Field(
        default=None, validation_alias="isUplink", serialization_alias="isUplink"
    )
    errors: list[str] = Field(default_factory=list)
    warnings: list[str] = Field(default_factory=list)
    speed: str | None = None
    duplex: str | None = None
    spanning_tree: SwitchSpanningTree | None = Field(
        default=None, validation_alias="spanningTree", serialization_alias="spanningTree"
    )
    poe: SwitchPoe | None = None
    usage_in_kb: SwitchUsageInKb | None = Field(
        default=None, validation_alias="usageInKb", serialization_alias="usageInKb"
    )
    cdp: SwitchCdp | None = None
    lldp: SwitchLldp | None = None
    client_count: int | None = Field(
        default=None, validation_alias="clientCount", serialization_alias="clientCount"
    )
    power_usage_in_wh: float | None = Field(
        default=None, validation_alias="powerUsageInWh", serialization_alias="powerUsageInWh"
    )
    traffic_in_kbps: SwitchTrafficInKbps | None = Field(
        default=None, validation_alias="trafficInKbps", serialization_alias="trafficInKbps"
    )
    secure_port: SwitchSecurePort | None = Field(
        default=None, validation_alias="securePort", serialization_alias="securePort"
    )


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

    dhcp_mode: str | None = Field(
        default=None, validation_alias="dhcpMode", serialization_alias="dhcpMode"
    )
    dhcp_relay_server_ips: list[str] = Field(
        default_factory=list,
        validation_alias="dhcpRelayServerIps",
        serialization_alias="dhcpRelayServerIps",
    )
    dhcp_lease_time: str | None = Field(
        default=None, validation_alias="dhcpLeaseTime", serialization_alias="dhcpLeaseTime"
    )
    dns_nameservers_option: str | None = Field(
        default=None,
        validation_alias="dnsNameserversOption",
        serialization_alias="dnsNameserversOption",
    )
    dns_custom_nameservers: list[str] = Field(
        default_factory=list,
        validation_alias="dnsCustomNameservers",
        serialization_alias="dnsCustomNameservers",
    )
    boot_options_enabled: bool | None = Field(
        default=None,
        validation_alias="bootOptionsEnabled",
        serialization_alias="bootOptionsEnabled",
    )
    boot_next_server: str | None = Field(
        default=None, validation_alias="bootNextServer", serialization_alias="bootNextServer"
    )
    boot_file_name: str | None = Field(
        default=None, validation_alias="bootFileName", serialization_alias="bootFileName"
    )
    dhcp_options: list[GetDeviceSwitchRoutingInterfaceDhcpResponseDhcpOptionsItem] = Field(
        default_factory=list, validation_alias="dhcpOptions", serialization_alias="dhcpOptions"
    )
    reserved_ip_ranges: list[GetDeviceSwitchRoutingInterfaceDhcpResponseReservedIpRangesItem] = (
        Field(
            default_factory=list,
            validation_alias="reservedIpRanges",
            serialization_alias="reservedIpRanges",
        )
    )
    fixed_ip_assignments: list[
        GetDeviceSwitchRoutingInterfaceDhcpResponseFixedIpAssignmentsItem
    ] = Field(
        default_factory=list,
        validation_alias="fixedIpAssignments",
        serialization_alias="fixedIpAssignments",
    )


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

    code: str | None = None
    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    value: str | None = None


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

    name: str | None = None
    mac: str | None = None
    ip: str | None = None


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

    start: str | None = None
    end: str | None = None
    comment: str | None = None


class GetDeviceSwitchRoutingInterfacesResponse(
    RootModel[list["CreateDeviceSwitchRoutingInterfaceResponse"]]
):
    """Schema for GetDeviceSwitchRoutingInterfacesResponse."""


class GetDeviceSwitchRoutingStaticRoutesResponse(
    RootModel[list["CreateDeviceSwitchRoutingStaticRouteResponse"]]
):
    """Schema for GetDeviceSwitchRoutingStaticRoutesResponse."""


class GetNetworkSwitchAccessPoliciesResponse(RootModel[list["NetworkSwitchAccessPolicyResponse"]]):
    """Response for getNetworkSwitchAccessPolicies operation."""


class GetNetworkSwitchDhcpServerPolicyArpInspectionTrustedServersResponse(
    RootModel[list["NetworkSwitchDhcpServerPolicyArpInspectionTrustedServerResponse"]]
):
    """Response for getNetworkSwitchDhcpServerPolicyArpInspectionTrustedServers operation."""


class GetNetworkSwitchDhcpServerPolicyArpInspectionWarningsByDeviceResponse(
    RootModel[list["GetNetworkSwitchDhcpServerPolicyArpInspectionWarningsByDeviceResponseItem"]]
):
    """Response for getNetworkSwitchDhcpServerPolicyArpInspectionWarningsByDevice operation."""


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

    serial: str | None = None
    name: str | None = None
    url: str | None = None
    supports_inspection: bool | None = Field(
        default=None,
        validation_alias="supportsInspection",
        serialization_alias="supportsInspection",
    )
    has_trusted_port: bool | None = Field(
        default=None, validation_alias="hasTrustedPort", serialization_alias="hasTrustedPort"
    )


class GetNetworkSwitchDhcpV4ServersSeenResponse(
    RootModel[list["GetNetworkSwitchDhcpV4ServersSeenResponseItem"]]
):
    """Response for getNetworkSwitchDhcpV4ServersSeen operation."""


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

    mac: str | None = None
    vlan: int | None = None
    client_id: str | None = Field(
        default=None, validation_alias="clientId", serialization_alias="clientId"
    )
    is_allowed: bool | None = Field(
        default=None, validation_alias="isAllowed", serialization_alias="isAllowed"
    )
    last_seen_at: datetime | None = Field(
        default=None, validation_alias="lastSeenAt", serialization_alias="lastSeenAt"
    )
    seen_by: list[SwitchSeenByItem] = Field(
        default_factory=list, validation_alias="seenBy", serialization_alias="seenBy"
    )
    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    device: SwitchDevice | None = None
    ipv4: SwitchIpv4 | None = None
    is_configured: bool | None = Field(
        default=None, validation_alias="isConfigured", serialization_alias="isConfigured"
    )
    last_ack: SwitchLastAck | None = Field(
        default=None, validation_alias="lastAck", serialization_alias="lastAck"
    )
    last_packet: SwitchLastPacket | None = Field(
        default=None, validation_alias="lastPacket", serialization_alias="lastPacket"
    )


class GetNetworkSwitchLinkAggregationsResponse(
    RootModel[list["NetworkSwitchLinkAggregationResponse"]]
):
    """Response for getNetworkSwitchLinkAggregations operation."""


class GetNetworkSwitchPortSchedulesResponse(RootModel[list["NetworkSwitchPortScheduleResponse"]]):
    """Response for getNetworkSwitchPortSchedules operation."""


class GetNetworkSwitchQosRulesResponse(RootModel[list["NetworkSwitchQosRuleResponse"]]):
    """Response for getNetworkSwitchQosRules operation."""


class GetNetworkSwitchRoutingMulticastRendezvousPointsResponse(
    RootModel[list["NetworkSwitchRoutingMulticastRendezvousPointResponse"]]
):
    """Response for getNetworkSwitchRoutingMulticastRendezvousPoints operation."""


class GetNetworkSwitchStacksResponse(RootModel[list["NetworkSwitchStackResponse"]]):
    """Response for getNetworkSwitchStacks operation."""


class GetOrganizationConfigTemplateSwitchProfilePortsResponse(
    RootModel[list["OrganizationConfigTemplateSwitchProfilePortResponse"]]
):
    """Response for getOrganizationConfigTemplateSwitchProfilePorts operation."""


class GetOrganizationConfigTemplateSwitchProfilesResponse(
    RootModel[list["GetOrganizationConfigTemplateSwitchProfilesResponseItem"]]
):
    """Response for getOrganizationConfigTemplateSwitchProfiles operation."""


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

    switch_profile_id: str | None = Field(
        default=None, validation_alias="switchProfileId", serialization_alias="switchProfileId"
    )
    name: str | None = None
    model: str | None = None


class GetOrganizationSummarySwitchPowerHistoryResponse(
    RootModel[list["GetOrganizationSummarySwitchPowerHistoryResponseItem"]]
):
    """Response for getOrganizationSummarySwitchPowerHistory operation."""


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

    ts: datetime | None = None
    draw: float | None = None


class GetOrganizationSwitchPortsBySwitchResponse(_BaseSchema):
    """Response for getOrganizationSwitchPortsBySwitch operation."""

    name: str | None = None
    serial: str | None = None
    mac: str | None = None
    network: SwitchSchedule | None = None
    model: str | None = None
    ports: list[GetOrganizationSwitchPortsBySwitchResponsePortsItem] = Field(default_factory=list)


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

    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    name: str | None = None
    tags: list[str] = Field(default_factory=list)
    enabled: bool | None = None
    poe_enabled: bool | None = Field(
        default=None, validation_alias="poeEnabled", serialization_alias="poeEnabled"
    )
    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    vlan: int | None = None
    voice_vlan: int | None = Field(
        default=None, validation_alias="voiceVlan", serialization_alias="voiceVlan"
    )
    allowed_vlans: str | None = Field(
        default=None, validation_alias="allowedVlans", serialization_alias="allowedVlans"
    )
    rstp_enabled: bool | None = Field(
        default=None, validation_alias="rstpEnabled", serialization_alias="rstpEnabled"
    )
    stp_guard: str | None = Field(
        default=None, validation_alias="stpGuard", serialization_alias="stpGuard"
    )
    link_negotiation: str | None = Field(
        default=None, validation_alias="linkNegotiation", serialization_alias="linkNegotiation"
    )
    access_policy_type: str | None = Field(
        default=None, validation_alias="accessPolicyType", serialization_alias="accessPolicyType"
    )
    sticky_mac_allow_list: list[str] = Field(
        default_factory=list,
        validation_alias="stickyMacAllowList",
        serialization_alias="stickyMacAllowList",
    )
    sticky_mac_allow_list_limit: int | None = Field(
        default=None,
        validation_alias="stickyMacAllowListLimit",
        serialization_alias="stickyMacAllowListLimit",
    )


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

    name: str | None = None
    serial: str | None = None
    mac: str | None = None
    network: SwitchSchedule | None = None
    model: str | None = None
    ports: list[SwitchPortsItem] = Field(default_factory=list)


class GetOrganizationSwitchPortsOverviewResponse(_BaseSchema):
    """Response for getOrganizationSwitchPortsOverview operation."""

    counts: GetOrganizationSwitchPortsOverviewResponseCounts | None = None


class GetOrganizationSwitchPortsOverviewResponseCounts(_BaseSchema):
    """The count data of all ports."""

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


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

    name: str | None = None
    serial: str | None = None
    mac: str | None = None
    network: SwitchSchedule | None = None
    model: str | None = None
    ports: list[SwitchPortsItem2] = Field(default_factory=list)


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

    name: str | None = None
    serial: str | None = None
    mac: str | None = None
    network: SwitchSchedule | None = None
    model: str | None = None
    ports: list[SwitchPortsItem3] = Field(default_factory=list)


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

    name: str | None = None
    serial: str | None = None
    mac: str | None = None
    network: SwitchSchedule | None = None
    model: str | None = None
    ports: list[SwitchPortsItem4] = Field(default_factory=list)


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

    rules: list[NetworkSwitchAccessControlListsResponseRulesItem] = Field(default_factory=list)


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

    comment: str | None = None
    policy: str | None = None
    ip_version: str | None = Field(
        default=None, validation_alias="ipVersion", serialization_alias="ipVersion"
    )
    protocol: str | None = None
    src_cidr: str | None = Field(
        default=None, validation_alias="srcCidr", serialization_alias="srcCidr"
    )
    src_port: str | None = Field(
        default=None, validation_alias="srcPort", serialization_alias="srcPort"
    )
    dst_cidr: str | None = Field(
        default=None, validation_alias="dstCidr", serialization_alias="dstCidr"
    )
    dst_port: str | None = Field(
        default=None, validation_alias="dstPort", serialization_alias="dstPort"
    )
    vlan: str | None = None


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

    access_policy_number: str | None = Field(
        default=None,
        validation_alias="accessPolicyNumber",
        serialization_alias="accessPolicyNumber",
    )
    name: str | None = None
    radius_servers: list[SwitchRadiusServersItem] = Field(
        default_factory=list, validation_alias="radiusServers", serialization_alias="radiusServers"
    )
    radius: SwitchRadius | None = None
    enforce_radius_monitoring: bool | None = Field(
        default=None,
        validation_alias="enforceRadiusMonitoring",
        serialization_alias="enforceRadiusMonitoring",
    )
    guest_port_bouncing: bool | None = Field(
        default=None, validation_alias="guestPortBouncing", serialization_alias="guestPortBouncing"
    )
    radius_testing_enabled: bool | None = Field(
        default=None,
        validation_alias="radiusTestingEnabled",
        serialization_alias="radiusTestingEnabled",
    )
    radius_coa_support_enabled: bool | None = Field(
        default=None,
        validation_alias="radiusCoaSupportEnabled",
        serialization_alias="radiusCoaSupportEnabled",
    )
    radius_accounting_enabled: bool | None = Field(
        default=None,
        validation_alias="radiusAccountingEnabled",
        serialization_alias="radiusAccountingEnabled",
    )
    radius_accounting_servers: list[SwitchRadiusServersItem] = Field(
        default_factory=list,
        validation_alias="radiusAccountingServers",
        serialization_alias="radiusAccountingServers",
    )
    radius_group_attribute: str | None = Field(
        default=None,
        validation_alias="radiusGroupAttribute",
        serialization_alias="radiusGroupAttribute",
    )
    host_mode: str | None = Field(
        default=None, validation_alias="hostMode", serialization_alias="hostMode"
    )
    access_policy_type: str | None = Field(
        default=None, validation_alias="accessPolicyType", serialization_alias="accessPolicyType"
    )
    increase_access_speed: bool | None = Field(
        default=None,
        validation_alias="increaseAccessSpeed",
        serialization_alias="increaseAccessSpeed",
    )
    guest_vlan_id: int | None = Field(
        default=None, validation_alias="guestVlanId", serialization_alias="guestVlanId"
    )
    dot1x: SwitchDot1x | None = None
    voice_vlan_clients: bool | None = Field(
        default=None, validation_alias="voiceVlanClients", serialization_alias="voiceVlanClients"
    )
    url_redirect_walled_garden_enabled: bool | None = Field(
        default=None,
        validation_alias="urlRedirectWalledGardenEnabled",
        serialization_alias="urlRedirectWalledGardenEnabled",
    )
    url_redirect_walled_garden_ranges: list[str] = Field(
        default_factory=list,
        validation_alias="urlRedirectWalledGardenRanges",
        serialization_alias="urlRedirectWalledGardenRanges",
    )
    counts: SwitchCounts | None = None
    guest_group_policy_id: str | None = Field(
        default=None,
        validation_alias="guestGroupPolicyId",
        serialization_alias="guestGroupPolicyId",
    )
    guest_sgt_id: int | None = Field(
        default=None, validation_alias="guestSgtId", serialization_alias="guestSgtId"
    )


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

    enabled: bool | None = None
    use_oob_mgmt: bool | None = Field(
        default=None, validation_alias="useOobMgmt", serialization_alias="useOobMgmt"
    )
    vlan_id: int | None = Field(
        default=None, validation_alias="vlanId", serialization_alias="vlanId"
    )
    protocols: list[str] = Field(default_factory=list)
    switches: list[NetworkSwitchAlternateManagementInterfaceResponseSwitchesItem] = Field(
        default_factory=list
    )


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

    serial: str | None = None
    alternate_management_ip: str | None = Field(
        default=None,
        validation_alias="alternateManagementIp",
        serialization_alias="alternateManagementIp",
    )
    subnet_mask: str | None = Field(
        default=None, validation_alias="subnetMask", serialization_alias="subnetMask"
    )
    gateway: str | None = None


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

    trusted_server_id: str | None = Field(
        default=None, validation_alias="trustedServerId", serialization_alias="trustedServerId"
    )
    mac: str | None = None
    vlan: int | None = None
    ipv4: SwitchIpv42 | None = None


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

    alerts: NetworkSwitchDhcpServerPolicyResponseAlerts | None = None
    default_policy: str | None = Field(
        default=None, validation_alias="defaultPolicy", serialization_alias="defaultPolicy"
    )
    blocked_servers: list[str] = Field(
        default_factory=list,
        validation_alias="blockedServers",
        serialization_alias="blockedServers",
    )
    allowed_servers: list[str] = Field(
        default_factory=list,
        validation_alias="allowedServers",
        serialization_alias="allowedServers",
    )
    always_allowed_servers: list[str] = Field(
        default_factory=list,
        validation_alias="alwaysAllowedServers",
        serialization_alias="alwaysAllowedServers",
    )
    arp_inspection: NetworkSwitchDhcpServerPolicyResponseArpInspection | None = Field(
        default=None, validation_alias="arpInspection", serialization_alias="arpInspection"
    )


class NetworkSwitchDhcpServerPolicyResponseAlerts(_BaseSchema):
    """Email alert settings for DHCP servers."""

    email: SwitchDot3az | None = None


class NetworkSwitchDhcpServerPolicyResponseArpInspection(_BaseSchema):
    """Dynamic ARP Inspection settings."""

    enabled: bool | None = None
    unsupported_models: list[str] = Field(
        default_factory=list,
        validation_alias="unsupportedModels",
        serialization_alias="unsupportedModels",
    )


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

    mappings: list[NetworkSwitchDscpToCosMappingsResponseMappingsItem] = Field(default_factory=list)


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

    dscp: int | None = None
    cos: int | None = None
    title: str | None = None


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

    id: str | None = None
    switch_ports: list[SwitchSwitchPortsItem] = Field(
        default_factory=list, validation_alias="switchPorts", serialization_alias="switchPorts"
    )


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

    default_mtu_size: int | None = Field(
        default=None, validation_alias="defaultMtuSize", serialization_alias="defaultMtuSize"
    )
    overrides: list[NetworkSwitchMtuResponseOverridesItem] = Field(default_factory=list)


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

    switches: list[str] = Field(default_factory=list)
    switch_profiles: list[str] = Field(
        default_factory=list,
        validation_alias="switchProfiles",
        serialization_alias="switchProfiles",
    )
    mtu_size: int = Field(validation_alias="mtuSize", serialization_alias="mtuSize")


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

    id: str | None = None
    network_id: str | None = Field(
        default=None, validation_alias="networkId", serialization_alias="networkId"
    )
    name: str | None = None
    port_schedule: SwitchPortSchedule | None = Field(
        default=None, validation_alias="portSchedule", serialization_alias="portSchedule"
    )


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

    id: str | None = None
    vlan: int | None = None
    protocol: str | None = None
    src_port: int | None = Field(
        default=None, validation_alias="srcPort", serialization_alias="srcPort"
    )
    src_port_range: str | None = Field(
        default=None, validation_alias="srcPortRange", serialization_alias="srcPortRange"
    )
    dst_port: int | None = Field(
        default=None, validation_alias="dstPort", serialization_alias="dstPort"
    )
    dst_port_range: str | None = Field(
        default=None, validation_alias="dstPortRange", serialization_alias="dstPortRange"
    )
    dscp: int | None = None


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

    rule_ids: list[str] = Field(
        default_factory=list, validation_alias="ruleIds", serialization_alias="ruleIds"
    )


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

    rendezvous_point_id: str | None = Field(
        default=None, validation_alias="rendezvousPointId", serialization_alias="rendezvousPointId"
    )
    serial: str | None = None
    interface_name: str | None = Field(
        default=None, validation_alias="interfaceName", serialization_alias="interfaceName"
    )
    interface_ip: str | None = Field(
        default=None, validation_alias="interfaceIp", serialization_alias="interfaceIp"
    )
    multicast_group: str | None = Field(
        default=None, validation_alias="multicastGroup", serialization_alias="multicastGroup"
    )


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

    default_settings: NetworkSwitchRoutingMulticastResponseDefaultSettings | None = Field(
        default=None, validation_alias="defaultSettings", serialization_alias="defaultSettings"
    )
    overrides: list[NetworkSwitchRoutingMulticastResponseOverridesItem] = Field(
        default_factory=list
    )


class NetworkSwitchRoutingMulticastResponseDefaultSettings(_BaseSchema):
    """Default multicast setting for entire network. IGMP snooping and Flood unknown multicast
    traffic settings are enabled by default.
    """

    igmp_snooping_enabled: bool | None = Field(
        default=None,
        validation_alias="igmpSnoopingEnabled",
        serialization_alias="igmpSnoopingEnabled",
    )
    flood_unknown_multicast_traffic_enabled: bool | None = Field(
        default=None,
        validation_alias="floodUnknownMulticastTrafficEnabled",
        serialization_alias="floodUnknownMulticastTrafficEnabled",
    )


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

    switches: list[str] = Field(default_factory=list)
    stacks: list[str] = Field(default_factory=list)
    switch_profiles: list[str] = Field(
        default_factory=list,
        validation_alias="switchProfiles",
        serialization_alias="switchProfiles",
    )
    igmp_snooping_enabled: bool | None = Field(
        default=None,
        validation_alias="igmpSnoopingEnabled",
        serialization_alias="igmpSnoopingEnabled",
    )
    flood_unknown_multicast_traffic_enabled: bool | None = Field(
        default=None,
        validation_alias="floodUnknownMulticastTrafficEnabled",
        serialization_alias="floodUnknownMulticastTrafficEnabled",
    )


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

    enabled: bool | None = None
    hello_timer_in_seconds: int | None = Field(
        default=None,
        validation_alias="helloTimerInSeconds",
        serialization_alias="helloTimerInSeconds",
    )
    dead_timer_in_seconds: int | None = Field(
        default=None,
        validation_alias="deadTimerInSeconds",
        serialization_alias="deadTimerInSeconds",
    )
    areas: list[NetworkSwitchRoutingOspfResponseAreasItem] = Field(default_factory=list)
    v3: NetworkSwitchRoutingOspfResponseV3 | None = None
    md5_authentication_enabled: bool | None = Field(
        default=None,
        validation_alias="md5AuthenticationEnabled",
        serialization_alias="md5AuthenticationEnabled",
    )
    md5_authentication_key: NetworkSwitchRoutingOspfResponseMd5AuthenticationKey | None = Field(
        default=None,
        validation_alias="md5AuthenticationKey",
        serialization_alias="md5AuthenticationKey",
    )
    vrf: SwitchVrf | None = None


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

    area_id: str | None = Field(
        default=None, validation_alias="areaId", serialization_alias="areaId"
    )
    area_name: str | None = Field(
        default=None, validation_alias="areaName", serialization_alias="areaName"
    )
    area_type: str | None = Field(
        default=None, validation_alias="areaType", serialization_alias="areaType"
    )


class NetworkSwitchRoutingOspfResponseMd5AuthenticationKey(_BaseSchema):
    """MD5 authentication credentials. This param is only relevant if md5AuthenticationEnabled is
    true.
    """

    id: int | None = None
    passphrase: str | None = None


class NetworkSwitchRoutingOspfResponseV3(_BaseSchema):
    """OSPF v3 configuration."""

    enabled: bool | None = None
    hello_timer_in_seconds: int | None = Field(
        default=None,
        validation_alias="helloTimerInSeconds",
        serialization_alias="helloTimerInSeconds",
    )
    dead_timer_in_seconds: int | None = Field(
        default=None,
        validation_alias="deadTimerInSeconds",
        serialization_alias="deadTimerInSeconds",
    )
    areas: list[NetworkSwitchRoutingOspfResponseAreasItem] = Field(default_factory=list)


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

    vlan: int | None = None
    use_combined_power: bool | None = Field(
        default=None, validation_alias="useCombinedPower", serialization_alias="useCombinedPower"
    )
    power_exceptions: list[NetworkSwitchSettingsResponsePowerExceptionsItem] = Field(
        default_factory=list,
        validation_alias="powerExceptions",
        serialization_alias="powerExceptions",
    )
    uplink_client_sampling: SwitchDot3az | None = Field(
        default=None,
        validation_alias="uplinkClientSampling",
        serialization_alias="uplinkClientSampling",
    )
    mac_blocklist: SwitchDot3az | None = Field(
        default=None, validation_alias="macBlocklist", serialization_alias="macBlocklist"
    )
    uplink_selection: NetworkSwitchSettingsResponseUplinkSelection | None = Field(
        default=None, validation_alias="uplinkSelection", serialization_alias="uplinkSelection"
    )


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

    serial: str | None = None
    power_type: str | None = Field(
        default=None, validation_alias="powerType", serialization_alias="powerType"
    )


class NetworkSwitchSettingsResponseUplinkSelection(_BaseSchema):
    """Settings related to uplink selection on IOS-XE switches."""

    failback: SwitchDot3az | None = None
    candidates: str | None = None


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

    id: str | None = None
    name: str | None = None
    serials: list[str] = Field(default_factory=list)
    is_monitor_only: bool | None = Field(
        default=None, validation_alias="isMonitorOnly", serialization_alias="isMonitorOnly"
    )
    virtual_mac: str | None = Field(
        default=None, validation_alias="virtualMac", serialization_alias="virtualMac"
    )
    members: list[SwitchMembersItem] = Field(default_factory=list)


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

    broadcast_threshold: int | None = Field(
        default=None,
        validation_alias="broadcastThreshold",
        serialization_alias="broadcastThreshold",
    )
    multicast_threshold: int | None = Field(
        default=None,
        validation_alias="multicastThreshold",
        serialization_alias="multicastThreshold",
    )
    unknown_unicast_threshold: int | None = Field(
        default=None,
        validation_alias="unknownUnicastThreshold",
        serialization_alias="unknownUnicastThreshold",
    )
    treat_these_traffic_types_as_one_threshold: list[str] = Field(
        default_factory=list,
        validation_alias="treatTheseTrafficTypesAsOneThreshold",
        serialization_alias="treatTheseTrafficTypesAsOneThreshold",
    )


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

    rstp_enabled: bool | None = Field(
        default=None, validation_alias="rstpEnabled", serialization_alias="rstpEnabled"
    )
    stp_bridge_priority: list[NetworkSwitchStpResponseStpBridgePriorityItem] = Field(
        default_factory=list,
        validation_alias="stpBridgePriority",
        serialization_alias="stpBridgePriority",
    )


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

    switches: list[str] = Field(default_factory=list)
    stacks: list[str] = Field(default_factory=list)
    switch_profiles: list[str] = Field(
        default_factory=list,
        validation_alias="switchProfiles",
        serialization_alias="switchProfiles",
    )
    stp_priority: int | None = Field(
        default=None, validation_alias="stpPriority", serialization_alias="stpPriority"
    )


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

    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    name: str | None = None
    tags: list[str] = Field(default_factory=list)
    enabled: bool | None = None
    poe_enabled: bool | None = Field(
        default=None, validation_alias="poeEnabled", serialization_alias="poeEnabled"
    )
    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    vlan: int | None = None
    voice_vlan: int | None = Field(
        default=None, validation_alias="voiceVlan", serialization_alias="voiceVlan"
    )
    allowed_vlans: str | None = Field(
        default=None, validation_alias="allowedVlans", serialization_alias="allowedVlans"
    )
    isolation_enabled: bool | None = Field(
        default=None, validation_alias="isolationEnabled", serialization_alias="isolationEnabled"
    )
    rstp_enabled: bool | None = Field(
        default=None, validation_alias="rstpEnabled", serialization_alias="rstpEnabled"
    )
    stp_guard: str | None = Field(
        default=None, validation_alias="stpGuard", serialization_alias="stpGuard"
    )
    stp_port_fast_trunk: bool | None = Field(
        default=None, validation_alias="stpPortFastTrunk", serialization_alias="stpPortFastTrunk"
    )
    link_negotiation: str | None = Field(
        default=None, validation_alias="linkNegotiation", serialization_alias="linkNegotiation"
    )
    link_negotiation_capabilities: list[str] = Field(
        default_factory=list,
        validation_alias="linkNegotiationCapabilities",
        serialization_alias="linkNegotiationCapabilities",
    )
    port_schedule_id: str | None = Field(
        default=None, validation_alias="portScheduleId", serialization_alias="portScheduleId"
    )
    schedule: SwitchSchedule | None = None
    udld: str | None = None
    access_policy_type: str | None = Field(
        default=None, validation_alias="accessPolicyType", serialization_alias="accessPolicyType"
    )
    access_policy_number: int | None = Field(
        default=None,
        validation_alias="accessPolicyNumber",
        serialization_alias="accessPolicyNumber",
    )
    mac_allow_list: list[str] = Field(
        default_factory=list, validation_alias="macAllowList", serialization_alias="macAllowList"
    )
    mac_whitelist_limit: int | None = Field(
        default=None, validation_alias="macWhitelistLimit", serialization_alias="macWhitelistLimit"
    )
    sticky_mac_allow_list: list[str] = Field(
        default_factory=list,
        validation_alias="stickyMacAllowList",
        serialization_alias="stickyMacAllowList",
    )
    sticky_mac_allow_list_limit: int | None = Field(
        default=None,
        validation_alias="stickyMacAllowListLimit",
        serialization_alias="stickyMacAllowListLimit",
    )
    storm_control_enabled: bool | None = Field(
        default=None,
        validation_alias="stormControlEnabled",
        serialization_alias="stormControlEnabled",
    )
    flexible_stacking_enabled: bool | None = Field(
        default=None,
        validation_alias="flexibleStackingEnabled",
        serialization_alias="flexibleStackingEnabled",
    )
    dai_trusted: bool | None = Field(
        default=None, validation_alias="daiTrusted", serialization_alias="daiTrusted"
    )
    profile: SwitchProfile | None = None
    module: SwitchModule | None = None
    mirror: SwitchMirror | None = None
    dot3az: SwitchDot3az | None = None
    high_speed: SwitchDot3az | None = Field(
        default=None, validation_alias="highSpeed", serialization_alias="highSpeed"
    )


class SwitchActive(_BaseSchema):
    """The count data for active ports."""

    total: int | None = None
    by_media_and_link_speed: SwitchByMediaAndLinkSpeed | None = Field(
        default=None,
        validation_alias="byMediaAndLinkSpeed",
        serialization_alias="byMediaAndLinkSpeed",
    )


class SwitchAuthentication(_BaseSchema):
    """Object for authentication mode settings."""

    mode: str | None = None


class SwitchBandwidth(_BaseSchema):
    """A breakdown of the average speed of data that has passed through this port during the
    interval.
    """

    usage: SwitchUsage2 | None = None


class SwitchByMedia(_BaseSchema):
    """The inactive count data, indexed by media type (RJ45 or SFP)."""

    rj45: SwitchRj452 | None = None
    sfp: SwitchRj452 | None = None


class SwitchByMediaAndLinkSpeed(_BaseSchema):
    """The active count data, indexed by media type (RJ45 or SFP)."""

    rj45: SwitchRj45 | None = None
    sfp: SwitchSfp | None = None


class SwitchByStatus(_BaseSchema):
    """Associated client count on access point by status."""

    online: int | None = None


class SwitchCache(_BaseSchema):
    """Object for RADIUS Cache Settings."""

    enabled: bool | None = None
    timeout: int | None = None


class SwitchCdp(_BaseSchema):
    """The Cisco Discovery Protocol (CDP) information of the connected device."""

    system_name: str | None = Field(
        default=None, validation_alias="systemName", serialization_alias="systemName"
    )
    platform: str | None = None
    device_id: str | None = Field(
        default=None, validation_alias="deviceId", serialization_alias="deviceId"
    )
    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    native_vlan: int | None = Field(
        default=None, validation_alias="nativeVlan", serialization_alias="nativeVlan"
    )
    address: str | None = None
    management_address: str | None = Field(
        default=None, validation_alias="managementAddress", serialization_alias="managementAddress"
    )
    version: str | None = None
    vtp_management_domain: str | None = Field(
        default=None,
        validation_alias="vtpManagementDomain",
        serialization_alias="vtpManagementDomain",
    )
    capabilities: str | None = None


class SwitchConfigOverrides(_BaseSchema):
    """The configuration overrides applied to this port when Secure Port is active."""

    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    vlan: int | None = None
    voice_vlan: int | None = Field(
        default=None, validation_alias="voiceVlan", serialization_alias="voiceVlan"
    )
    allowed_vlans: str | None = Field(
        default=None, validation_alias="allowedVlans", serialization_alias="allowedVlans"
    )


class SwitchCounts(_BaseSchema):
    """Counts associated with the access policy."""

    ports: SwitchPorts | None = None


class SwitchCounts2(_BaseSchema):
    """Number of clients on the port in a given time."""

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


class SwitchCountsByStatus(_BaseSchema):
    """The count data, indexed by active or inactive status."""

    active: SwitchActive | None = None
    inactive: SwitchInactive | None = None


class SwitchCriticalAuth(_BaseSchema):
    """Critical auth settings for when authentication is rejected by the RADIUS server."""

    data_vlan_id: int | None = Field(
        default=None, validation_alias="dataVlanId", serialization_alias="dataVlanId"
    )
    voice_vlan_id: int | None = Field(
        default=None, validation_alias="voiceVlanId", serialization_alias="voiceVlanId"
    )
    suspend_port_bounce: bool | None = Field(
        default=None, validation_alias="suspendPortBounce", serialization_alias="suspendPortBounce"
    )
    data_group_policy_id: str | None = Field(
        default=None, validation_alias="dataGroupPolicyId", serialization_alias="dataGroupPolicyId"
    )
    voice_group_policy_id: str | None = Field(
        default=None,
        validation_alias="voiceGroupPolicyId",
        serialization_alias="voiceGroupPolicyId",
    )
    data_sgt_id: int | None = Field(
        default=None, validation_alias="dataSgtId", serialization_alias="dataSgtId"
    )
    voice_sgt_id: int | None = Field(
        default=None, validation_alias="voiceSgtId", serialization_alias="voiceSgtId"
    )


class SwitchData(_BaseSchema):
    """A breakdown of how many kilobytes have passed through this port during the interval
    timespan.
    """

    usage: SwitchUsage | None = None


class SwitchDevice(_BaseSchema):
    """Attributes of the server when it's a device."""

    serial: str | None = None
    name: str | None = None
    url: str | None = None
    interface: SwitchInterface | None = None


class SwitchDot1x(_BaseSchema):
    """802.1x Settings."""

    control_direction: str | None = Field(
        default=None, validation_alias="controlDirection", serialization_alias="controlDirection"
    )


class SwitchDot3az(_BaseSchema):
    """dot3az settings for the port."""

    enabled: bool | None = None


class SwitchDscp(_BaseSchema):
    """DSCP attributes of the packet."""

    tag: int | None = None
    ecn: int | None = None


class SwitchEnergy(_BaseSchema):
    """How much energy (in watt-hours) has been delivered by this port during the interval."""

    usage: SwitchUsage3 | None = None


class SwitchEthernet(_BaseSchema):
    """Additional ethernet attributes of the packet."""

    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")


class SwitchFields(_BaseSchema):
    """DHCP-specific fields of the packet."""

    op: int | None = None
    htype: int | None = None
    hlen: int | None = None
    hops: int | None = None
    xid: str | None = None
    secs: int | None = None
    flags: str | None = None
    ciaddr: str | None = None
    yiaddr: str | None = None
    siaddr: str | None = None
    giaddr: str | None = None
    chaddr: str | None = None
    sname: str | None = None
    magic_cookie: str | None = Field(
        default=None, validation_alias="magicCookie", serialization_alias="magicCookie"
    )
    options: list[SwitchOptionsItem] = Field(default_factory=list)


class SwitchInactive(_BaseSchema):
    """The count data for inactive ports."""

    total: int | None = None
    by_media: SwitchByMedia | None = Field(
        default=None, validation_alias="byMedia", serialization_alias="byMedia"
    )


class SwitchInterface(_BaseSchema):
    """Interface attributes of the server. Only for configured servers."""

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


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

    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"
    )
    data: SwitchData | None = None
    bandwidth: SwitchBandwidth | None = None
    energy: SwitchEnergy | None = None


class SwitchIp(_BaseSchema):
    """Additional IP attributes of the packet."""

    id: str | None = None
    version: int | None = None
    length: int | None = None
    header_length: int | None = Field(
        default=None, validation_alias="headerLength", serialization_alias="headerLength"
    )
    protocol: int | None = None
    ttl: int | None = None
    dscp: SwitchDscp | None = None


class SwitchIpv4(_BaseSchema):
    """IPv4 attributes of the server."""

    address: str | None = None
    subnet: str | None = None
    gateway: str | None = None


class SwitchIpv42(_BaseSchema):
    """IPv4 attributes of the last ack."""

    address: str | None = None


class SwitchIpv6(_BaseSchema):
    """IPv6 addressing."""

    assignment_mode: str | None = Field(
        default=None, validation_alias="assignmentMode", serialization_alias="assignmentMode"
    )
    address: str | None = None
    prefix: str | None = None
    gateway: str | None = None


class SwitchLastAck(_BaseSchema):
    """Attributes of the server's last ack."""

    ts: datetime | None = None
    ipv4: SwitchIpv42 | None = None


class SwitchLastPacket(_BaseSchema):
    """Last packet the server received."""

    source: SwitchSource | None = None
    destination: SwitchSource | None = None
    type_: str | None = Field(default=None, validation_alias="type", serialization_alias="type")
    ethernet: SwitchEthernet | None = None
    ip: SwitchIp | None = None
    udp: SwitchUdp | None = None
    fields: SwitchFields | None = None


class SwitchLldp(_BaseSchema):
    """The Link Layer Discovery Protocol (LLDP) information of the connected device."""

    system_name: str | None = Field(
        default=None, validation_alias="systemName", serialization_alias="systemName"
    )
    system_description: str | None = Field(
        default=None, validation_alias="systemDescription", serialization_alias="systemDescription"
    )
    chassis_id: str | None = Field(
        default=None, validation_alias="chassisId", serialization_alias="chassisId"
    )
    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    management_vlan: int | None = Field(
        default=None, validation_alias="managementVlan", serialization_alias="managementVlan"
    )
    port_vlan: int | None = Field(
        default=None, validation_alias="portVlan", serialization_alias="portVlan"
    )
    management_address: str | None = Field(
        default=None, validation_alias="managementAddress", serialization_alias="managementAddress"
    )
    port_description: str | None = Field(
        default=None, validation_alias="portDescription", serialization_alias="portDescription"
    )
    system_capabilities: str | None = Field(
        default=None,
        validation_alias="systemCapabilities",
        serialization_alias="systemCapabilities",
    )


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

    serial: str | None = None
    name: str | None = None
    model: str | None = None
    mac: str | None = None
    role: str | None = None


class SwitchMirror(_BaseSchema):
    """Port mirror."""

    mode: str | None = None


class SwitchModule(_BaseSchema):
    """Expansion module."""

    model: str | None = None
    serial: str | None = None
    slot: int | None = None


class SwitchMonday(_BaseSchema):
    """Monday schedule."""

    active: bool | None = None
    from_: str | None = Field(default=None, validation_alias="from", serialization_alias="from")
    to: str | None = None


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

    name: str | None = None
    value: str | None = None


class SwitchOspfSettings(_BaseSchema):
    """IPv4 OSPF Settings."""

    area: str | None = None
    cost: int | None = None
    is_passive_enabled: bool | None = Field(
        default=None, validation_alias="isPassiveEnabled", serialization_alias="isPassiveEnabled"
    )
    network_type: str | None = Field(
        default=None, validation_alias="networkType", serialization_alias="networkType"
    )


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

    desc: str | None = None
    total: int | None = None
    sent: int | None = None
    recv: int | None = None
    rate_per_sec: SwitchUsageInKb | None = Field(
        default=None, validation_alias="ratePerSec", serialization_alias="ratePerSec"
    )


class SwitchPoe(_BaseSchema):
    """PoE status of the port."""

    is_allocated: bool | None = Field(
        default=None, validation_alias="isAllocated", serialization_alias="isAllocated"
    )


class SwitchPortSchedule(_BaseSchema):
    """Port schedule."""

    monday: SwitchMonday | None = None
    tuesday: SwitchMonday | None = None
    wednesday: SwitchMonday | None = None
    thursday: SwitchMonday | None = None
    friday: SwitchMonday | None = None
    saturday: SwitchMonday | None = None
    sunday: SwitchMonday | None = None


class SwitchPorts(_BaseSchema):
    """Counts associated with ports."""

    with_this_policy: int | None = Field(
        default=None, validation_alias="withThisPolicy", serialization_alias="withThisPolicy"
    )


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

    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    counts: SwitchCounts2 | None = None


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

    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    enabled: bool | None = None
    status: str | None = None
    is_uplink: bool | None = Field(
        default=None, validation_alias="isUplink", serialization_alias="isUplink"
    )
    errors: list[str] = Field(default_factory=list)
    warnings: list[str] = Field(default_factory=list)
    speed: str | None = None
    duplex: str | None = None
    spanning_tree: SwitchSpanningTree | None = Field(
        default=None, validation_alias="spanningTree", serialization_alias="spanningTree"
    )
    poe: SwitchPoe | None = None
    secure_port: SwitchSecurePort2 | None = Field(
        default=None, validation_alias="securePort", serialization_alias="securePort"
    )


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

    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    last_updated_at: str | None = Field(
        default=None, validation_alias="lastUpdatedAt", serialization_alias="lastUpdatedAt"
    )
    cdp: list[SwitchOptionsItem] = Field(default_factory=list)
    lldp: list[SwitchOptionsItem] = Field(default_factory=list)


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

    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )
    intervals: list[SwitchIntervalsItem] = Field(default_factory=list)


class SwitchProfile(_BaseSchema):
    """Profile attributes."""

    enabled: bool | None = None
    id: str | None = None
    iname: str | None = None


class SwitchRadius(_BaseSchema):
    """Object for RADIUS Settings."""

    critical_auth: SwitchCriticalAuth | None = Field(
        default=None, validation_alias="criticalAuth", serialization_alias="criticalAuth"
    )
    failed_auth_vlan_id: int | None = Field(
        default=None, validation_alias="failedAuthVlanId", serialization_alias="failedAuthVlanId"
    )
    failed_auth_group_policy_id: str | None = Field(
        default=None,
        validation_alias="failedAuthGroupPolicyId",
        serialization_alias="failedAuthGroupPolicyId",
    )
    failed_auth_sgt_id: int | None = Field(
        default=None, validation_alias="failedAuthSgtId", serialization_alias="failedAuthSgtId"
    )
    re_authentication_interval: int | None = Field(
        default=None,
        validation_alias="reAuthenticationInterval",
        serialization_alias="reAuthenticationInterval",
    )
    cache: SwitchCache | None = None
    authentication: SwitchAuthentication | None = None
    pre_authentication_group_policy_id: str | None = Field(
        default=None,
        validation_alias="preAuthenticationGroupPolicyId",
        serialization_alias="preAuthenticationGroupPolicyId",
    )


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

    server_id: str | None = Field(
        default=None, validation_alias="serverId", serialization_alias="serverId"
    )
    organization_radius_server_id: str | None = Field(
        default=None,
        validation_alias="organizationRadiusServerId",
        serialization_alias="organizationRadiusServerId",
    )
    host: str | None = None
    port: int | None = None


class SwitchRj45(_BaseSchema):
    """The count data for RJ45 ports, indexed by speed in Mb."""

    total: int | None = None
    n_10: int | None = Field(default=None, validation_alias="10", serialization_alias="10")
    n_100: int | None = Field(default=None, validation_alias="100", serialization_alias="100")
    n_1000: int | None = Field(default=None, validation_alias="1000", serialization_alias="1000")
    n_2500: int | None = Field(default=None, validation_alias="2500", serialization_alias="2500")
    n_5000: int | None = Field(default=None, validation_alias="5000", serialization_alias="5000")
    n_10000: int | None = Field(default=None, validation_alias="10000", serialization_alias="10000")


class SwitchRj452(_BaseSchema):
    """The count data for inactive RJ45 ports."""

    total: int | None = None


class SwitchSchedule(_BaseSchema):
    """The port schedule data."""

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


class SwitchSecurePort(_BaseSchema):
    """The Secure Port status of the port."""

    enabled: bool | None = None
    active: bool | None = None
    authentication_status: str | None = Field(
        default=None,
        validation_alias="authenticationStatus",
        serialization_alias="authenticationStatus",
    )
    config_overrides: SwitchConfigOverrides | None = Field(
        default=None, validation_alias="configOverrides", serialization_alias="configOverrides"
    )


class SwitchSecurePort2(_BaseSchema):
    """The Secure Port status of the port."""

    active: bool | None = None
    authentication_status: str | None = Field(
        default=None,
        validation_alias="authenticationStatus",
        serialization_alias="authenticationStatus",
    )


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

    serial: str | None = None
    name: str | None = None
    url: str | None = None


class SwitchSfp(_BaseSchema):
    """The count data for SFP ports, indexed by speed in Mb."""

    total: int | None = None
    n_100: int | None = Field(default=None, validation_alias="100", serialization_alias="100")
    n_1000: int | None = Field(default=None, validation_alias="1000", serialization_alias="1000")
    n_10000: int | None = Field(default=None, validation_alias="10000", serialization_alias="10000")
    n_20000: int | None = Field(default=None, validation_alias="20000", serialization_alias="20000")
    n_25000: int | None = Field(default=None, validation_alias="25000", serialization_alias="25000")
    n_40000: int | None = Field(default=None, validation_alias="40000", serialization_alias="40000")
    n_50000: int | None = Field(default=None, validation_alias="50000", serialization_alias="50000")
    n_100000: int | None = Field(
        default=None, validation_alias="100000", serialization_alias="100000"
    )


class SwitchSource(_BaseSchema):
    """Source of the packet."""

    mac: str | None = None
    ipv4: SwitchIpv42 | None = None
    port: int | None = None


class SwitchSpanningTree(_BaseSchema):
    """The Spanning Tree Protocol (STP) information of the connected device."""

    statuses: list[str] = Field(default_factory=list)


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

    serial: str | None = None
    port_id: str | None = Field(
        default=None, validation_alias="portId", serialization_alias="portId"
    )


class SwitchTrafficInKbps(_BaseSchema):
    """A breakdown of the average speed of data that has passed through this port during the
    timespan. Note that this data is collected periodically from the switch. Any data from the
    past five minutes may be incomplete.
    """

    total: float | None = None
    sent: float | None = None
    recv: float | None = None


class SwitchUdp(_BaseSchema):
    """UDP attributes of the packet."""

    length: int | None = None
    checksum: str | None = None


class SwitchUsage(_BaseSchema):
    """Usage data for the given interval."""

    total: int | None = None
    upstream: int | None = None
    downstream: int | None = None


class SwitchUsage2(_BaseSchema):
    """Bandwidth usage data for the given interval."""

    total: float | None = None
    upstream: float | None = None
    downstream: float | None = None


class SwitchUsage3(_BaseSchema):
    """Energy data for the given interval."""

    total: float | None = None


class SwitchUsageInKb(_BaseSchema):
    """A breakdown of how many kilobytes have passed through this port during the timespan. Note
    that this data is collected periodically from the switch. Any data from the past five
    minutes may be incomplete.
    """

    total: int | None = None
    sent: int | None = None
    recv: int | None = None


class SwitchVrf(_BaseSchema):
    """VRF settings. Included on networks with IOS XE 17.18 or higher."""

    name: str | None = None


class SwitchVrf2(_BaseSchema):
    """VRF settings. Included on networks with IOS XE 17.18 or higher."""

    name: str | None = None
    leak_route_to_default_vrf: bool | None = Field(
        default=None,
        validation_alias="leakRouteToDefaultVrf",
        serialization_alias="leakRouteToDefaultVrf",
    )


class UpdateDeviceSwitchPortDot3az(_BaseSchema):
    """dot3az settings for the port."""

    enabled: bool | None = None


class UpdateDeviceSwitchPortHighSpeed(_BaseSchema):
    """High speed port enablement settings for C9500-32QC."""

    enabled: bool | None = None


class UpdateDeviceSwitchPortProfile(_BaseSchema):
    """Profile attributes."""

    enabled: bool | None = None
    id: str | None = None
    iname: str | None = None


class UpdateDeviceSwitchRoutingInterfaceDhcpDhcpOptionsItem(_BaseSchema):
    """Item schema for dhcpOptions."""

    code: str
    type_: str = Field(validation_alias="type", serialization_alias="type")
    value: str


class UpdateDeviceSwitchRoutingInterfaceDhcpFixedIpAssignmentsItem(_BaseSchema):
    """Item schema for fixedIpAssignments."""

    name: str
    mac: str
    ip: str


class UpdateDeviceSwitchRoutingInterfaceDhcpReservedIpRangesItem(_BaseSchema):
    """Item schema for reservedIpRanges."""

    start: str
    end: str
    comment: str | None = None


class UpdateDeviceSwitchRoutingInterfaceIpv6(_BaseSchema):
    """The IPv6 settings of the interface."""

    assignment_mode: str | None = Field(
        default=None, validation_alias="assignmentMode", serialization_alias="assignmentMode"
    )
    prefix: str | None = None
    address: str | None = None
    gateway: str | None = None


class UpdateDeviceSwitchRoutingInterfaceOspfSettings(_BaseSchema):
    """The OSPF routing settings of the interface."""

    area: str | None = None
    cost: int | None = None
    is_passive_enabled: bool | None = Field(
        default=None, validation_alias="isPassiveEnabled", serialization_alias="isPassiveEnabled"
    )
    network_type: str | None = Field(
        default=None, validation_alias="networkType", serialization_alias="networkType"
    )


class UpdateDeviceSwitchRoutingInterfaceVrf(_BaseSchema):
    """The VRF settings of the interface. Requires IOS XE 17.18 or higher."""

    name: str | None = None


class UpdateDeviceSwitchRoutingStaticRouteVrf(_BaseSchema):
    """The VRF settings of the interface. Requires IOS XE 17.18 or higher."""

    name: str | None = None
    leak_route_to_default_vrf: bool | None = Field(
        default=None,
        validation_alias="leakRouteToDefaultVrf",
        serialization_alias="leakRouteToDefaultVrf",
    )


class UpdateNetworkSwitchAccessControlListsRulesItem(_BaseSchema):
    """Item schema for rules."""

    comment: str | None = None
    policy: str
    ip_version: str | None = Field(
        default=None, validation_alias="ipVersion", serialization_alias="ipVersion"
    )
    protocol: str
    src_cidr: str = Field(validation_alias="srcCidr", serialization_alias="srcCidr")
    src_port: str | None = Field(
        default=None, validation_alias="srcPort", serialization_alias="srcPort"
    )
    dst_cidr: str = Field(validation_alias="dstCidr", serialization_alias="dstCidr")
    dst_port: str | None = Field(
        default=None, validation_alias="dstPort", serialization_alias="dstPort"
    )
    vlan: str | None = None


class UpdateNetworkSwitchAccessPolicyDot1x(_BaseSchema):
    """802.1x Settings."""

    control_direction: str | None = Field(
        default=None, validation_alias="controlDirection", serialization_alias="controlDirection"
    )


class UpdateNetworkSwitchAccessPolicyRadius(_BaseSchema):
    """Object for RADIUS Settings."""

    critical_auth: SwitchCriticalAuth | None = Field(
        default=None, validation_alias="criticalAuth", serialization_alias="criticalAuth"
    )
    failed_auth_vlan_id: int | None = Field(
        default=None, validation_alias="failedAuthVlanId", serialization_alias="failedAuthVlanId"
    )
    failed_auth_group_policy_id: str | None = Field(
        default=None,
        validation_alias="failedAuthGroupPolicyId",
        serialization_alias="failedAuthGroupPolicyId",
    )
    failed_auth_sgt_id: int | None = Field(
        default=None, validation_alias="failedAuthSgtId", serialization_alias="failedAuthSgtId"
    )
    re_authentication_interval: int | None = Field(
        default=None,
        validation_alias="reAuthenticationInterval",
        serialization_alias="reAuthenticationInterval",
    )
    cache: SwitchCache | None = None
    authentication: CreateNetworkSwitchAccessPolicyRadiusAuthentication | None = None
    pre_authentication_group_policy_id: str | None = Field(
        default=None,
        validation_alias="preAuthenticationGroupPolicyId",
        serialization_alias="preAuthenticationGroupPolicyId",
    )


class UpdateNetworkSwitchAccessPolicyRadiusAccountingServersItem(_BaseSchema):
    """Item schema for radiusAccountingServers."""

    server_id: str | None = Field(
        default=None, validation_alias="serverId", serialization_alias="serverId"
    )
    organization_radius_server_id: str | None = Field(
        default=None,
        validation_alias="organizationRadiusServerId",
        serialization_alias="organizationRadiusServerId",
    )
    host: str | None = None
    port: int | None = None
    secret: str | None = None


class UpdateNetworkSwitchAccessPolicyRadiusServersItem(_BaseSchema):
    """Item schema for radiusServers."""

    server_id: str | None = Field(
        default=None, validation_alias="serverId", serialization_alias="serverId"
    )
    organization_radius_server_id: str | None = Field(
        default=None,
        validation_alias="organizationRadiusServerId",
        serialization_alias="organizationRadiusServerId",
    )
    host: str | None = None
    port: int | None = None
    secret: str | None = None


class UpdateNetworkSwitchAlternateManagementInterfaceSwitchesItem(_BaseSchema):
    """Item schema for switches."""

    serial: str
    alternate_management_ip: str = Field(
        validation_alias="alternateManagementIp", serialization_alias="alternateManagementIp"
    )
    subnet_mask: str | None = Field(
        default=None, validation_alias="subnetMask", serialization_alias="subnetMask"
    )
    gateway: str | None = None


class UpdateNetworkSwitchDhcpServerPolicyAlerts(_BaseSchema):
    """Alert settings for DHCP servers."""

    email: SwitchDot3az | None = None


class UpdateNetworkSwitchDhcpServerPolicyArpInspection(_BaseSchema):
    """Dynamic ARP Inspection settings."""

    enabled: bool | None = None


class UpdateNetworkSwitchDhcpServerPolicyArpInspectionTrustedServerIpv4(_BaseSchema):
    """The updated IPv4 attributes of the trusted server."""

    address: str | None = None


class UpdateNetworkSwitchDscpToCosMappingsMappingsItem(_BaseSchema):
    """Item schema for mappings."""

    dscp: int
    cos: int
    title: str | None = None


class UpdateNetworkSwitchLinkAggregationSwitchPortsItem(_BaseSchema):
    """Item schema for switchPorts."""

    serial: str
    port_id: str = Field(validation_alias="portId", serialization_alias="portId")


class UpdateNetworkSwitchLinkAggregationSwitchProfilePortsItem(_BaseSchema):
    """Item schema for switchProfilePorts."""

    profile: str
    port_id: str = Field(validation_alias="portId", serialization_alias="portId")


class UpdateNetworkSwitchMtuOverridesItem(_BaseSchema):
    """Item schema for overrides."""

    switches: list[str] = Field(default_factory=list)
    switch_profiles: list[str] = Field(
        default_factory=list,
        validation_alias="switchProfiles",
        serialization_alias="switchProfiles",
    )
    mtu_size: int = Field(validation_alias="mtuSize", serialization_alias="mtuSize")


class UpdateNetworkSwitchPortSchedulePortSchedule(_BaseSchema):
    """The schedule for switch port scheduling. Schedules are applied to days of the week. When
    it's empty, default schedule with all days of a week are configured. Any unspecified day in
    the schedule is added as a default schedule configuration of the day.
    """

    monday: SwitchMonday | None = None
    tuesday: SwitchMonday | None = None
    wednesday: SwitchMonday | None = None
    thursday: SwitchMonday | None = None
    friday: SwitchMonday | None = None
    saturday: SwitchMonday | None = None
    sunday: SwitchMonday | None = None


class UpdateNetworkSwitchRoutingMulticastDefaultSettings(_BaseSchema):
    """Default multicast setting for entire network. IGMP snooping and Flood unknown multicast
    traffic settings are enabled by default.
    """

    igmp_snooping_enabled: bool | None = Field(
        default=None,
        validation_alias="igmpSnoopingEnabled",
        serialization_alias="igmpSnoopingEnabled",
    )
    flood_unknown_multicast_traffic_enabled: bool | None = Field(
        default=None,
        validation_alias="floodUnknownMulticastTrafficEnabled",
        serialization_alias="floodUnknownMulticastTrafficEnabled",
    )


class UpdateNetworkSwitchRoutingMulticastOverridesItem(_BaseSchema):
    """Item schema for overrides."""

    switch_profiles: list[str] = Field(
        default_factory=list,
        validation_alias="switchProfiles",
        serialization_alias="switchProfiles",
    )
    switches: list[str] = Field(default_factory=list)
    stacks: list[str] = Field(default_factory=list)
    igmp_snooping_enabled: bool = Field(
        validation_alias="igmpSnoopingEnabled", serialization_alias="igmpSnoopingEnabled"
    )
    flood_unknown_multicast_traffic_enabled: bool = Field(
        validation_alias="floodUnknownMulticastTrafficEnabled",
        serialization_alias="floodUnknownMulticastTrafficEnabled",
    )


class UpdateNetworkSwitchRoutingMulticastRendezvousPointVrf(_BaseSchema):
    """The VRF with PIM enabled L3 interface."""

    name: str | None = None


class UpdateNetworkSwitchRoutingOspfAreasItem(_BaseSchema):
    """Item schema for areas."""

    area_id: str = Field(validation_alias="areaId", serialization_alias="areaId")
    area_name: str = Field(validation_alias="areaName", serialization_alias="areaName")
    area_type: str = Field(validation_alias="areaType", serialization_alias="areaType")


class UpdateNetworkSwitchRoutingOspfMd5AuthenticationKey(_BaseSchema):
    """MD5 authentication credentials. This param is only relevant if md5AuthenticationEnabled is
    true.
    """

    id: int | None = None
    passphrase: str | None = None


class UpdateNetworkSwitchRoutingOspfV3(_BaseSchema):
    """OSPF v3 configuration."""

    enabled: bool | None = None
    hello_timer_in_seconds: int | None = Field(
        default=None,
        validation_alias="helloTimerInSeconds",
        serialization_alias="helloTimerInSeconds",
    )
    dead_timer_in_seconds: int | None = Field(
        default=None,
        validation_alias="deadTimerInSeconds",
        serialization_alias="deadTimerInSeconds",
    )
    areas: list[UpdateNetworkSwitchRoutingOspfV3AreasItem] = Field(default_factory=list)


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

    area_id: str = Field(validation_alias="areaId", serialization_alias="areaId")
    area_name: str = Field(validation_alias="areaName", serialization_alias="areaName")
    area_type: str = Field(validation_alias="areaType", serialization_alias="areaType")


class UpdateNetworkSwitchSettingsMacBlocklist(_BaseSchema):
    """MAC blocklist."""

    enabled: bool | None = None


class UpdateNetworkSwitchSettingsPowerExceptionsItem(_BaseSchema):
    """Item schema for powerExceptions."""

    serial: str
    power_type: str = Field(validation_alias="powerType", serialization_alias="powerType")


class UpdateNetworkSwitchSettingsUplinkClientSampling(_BaseSchema):
    """Uplink client sampling."""

    enabled: bool | None = None


class UpdateNetworkSwitchSettingsUplinkSelection(_BaseSchema):
    """Settings related to uplink selection on IOS-XE switches."""

    failback: UpdateNetworkSwitchSettingsUplinkSelectionFailback | None = None
    candidates: str | None = None


class UpdateNetworkSwitchSettingsUplinkSelectionFailback(_BaseSchema):
    """If a preferred uplink ever goes offline, we will periodically reattempt it."""

    enabled: bool


class UpdateNetworkSwitchStackRoutingInterfaceDhcpDhcpOptionsItem(_BaseSchema):
    """Item schema for dhcpOptions."""

    code: str
    type_: str = Field(validation_alias="type", serialization_alias="type")
    value: str


class UpdateNetworkSwitchStackRoutingInterfaceDhcpFixedIpAssignmentsItem(_BaseSchema):
    """Item schema for fixedIpAssignments."""

    name: str
    mac: str
    ip: str


class UpdateNetworkSwitchStackRoutingInterfaceDhcpReservedIpRangesItem(_BaseSchema):
    """Item schema for reservedIpRanges."""

    start: str
    end: str
    comment: str | None = None


class UpdateNetworkSwitchStackRoutingInterfaceIpv6(_BaseSchema):
    """The IPv6 settings of the interface."""

    assignment_mode: str | None = Field(
        default=None, validation_alias="assignmentMode", serialization_alias="assignmentMode"
    )
    prefix: str | None = None
    address: str | None = None
    gateway: str | None = None


class UpdateNetworkSwitchStackRoutingInterfaceOspfSettings(_BaseSchema):
    """The OSPF routing settings of the interface."""

    area: str | None = None
    cost: int | None = None
    is_passive_enabled: bool | None = Field(
        default=None, validation_alias="isPassiveEnabled", serialization_alias="isPassiveEnabled"
    )
    network_type: str | None = Field(
        default=None, validation_alias="networkType", serialization_alias="networkType"
    )


class UpdateNetworkSwitchStackRoutingInterfaceResponse(_BaseSchema):
    """Response for updateNetworkSwitchStackRoutingInterface operation."""

    interface_id: str | None = Field(
        default=None, validation_alias="interfaceId", serialization_alias="interfaceId"
    )
    name: str | None = None
    mode: str | None = None
    subnet: str | None = None
    interface_ip: str | None = Field(
        default=None, validation_alias="interfaceIp", serialization_alias="interfaceIp"
    )
    serial: str | None = None
    switch_port_id: str | None = Field(
        default=None, validation_alias="switchPortId", serialization_alias="switchPortId"
    )
    multicast_routing: str | None = Field(
        default=None, validation_alias="multicastRouting", serialization_alias="multicastRouting"
    )
    vlan_id: int | None = Field(
        default=None, validation_alias="vlanId", serialization_alias="vlanId"
    )
    uplink_v4: bool | None = Field(
        default=None, validation_alias="uplinkV4", serialization_alias="uplinkV4"
    )
    uplink_v6: bool | None = Field(
        default=None, validation_alias="uplinkV6", serialization_alias="uplinkV6"
    )
    ospf_settings: SwitchOspfSettings | None = Field(
        default=None, validation_alias="ospfSettings", serialization_alias="ospfSettings"
    )
    ospf_v3: SwitchOspfSettings | None = Field(
        default=None, validation_alias="ospfV3", serialization_alias="ospfV3"
    )
    ipv6: SwitchIpv6 | None = None
    vrf: SwitchVrf | None = None
    loopback: dict[str, Any] | None = None


class UpdateNetworkSwitchStackRoutingInterfaceVrf(_BaseSchema):
    """The VRF settings of the interface. Requires IOS XE 17.18 or higher."""

    name: str | None = None


class UpdateNetworkSwitchStackRoutingStaticRouteVrf(_BaseSchema):
    """The VRF settings of the interface. Requires IOS XE 17.18 or higher."""

    name: str | None = None
    leak_route_to_default_vrf: bool | None = Field(
        default=None,
        validation_alias="leakRouteToDefaultVrf",
        serialization_alias="leakRouteToDefaultVrf",
    )


class UpdateNetworkSwitchStpStpBridgePriorityItem(_BaseSchema):
    """Item schema for stpBridgePriority."""

    switch_profiles: list[str] = Field(
        default_factory=list,
        validation_alias="switchProfiles",
        serialization_alias="switchProfiles",
    )
    switches: list[str] = Field(default_factory=list)
    stacks: list[str] = Field(default_factory=list)
    stp_priority: int = Field(validation_alias="stpPriority", serialization_alias="stpPriority")


class UpdateOrganizationConfigTemplateSwitchProfilePortDot3az(_BaseSchema):
    """dot3az settings for the port."""

    enabled: bool | None = None


class UpdateOrganizationConfigTemplateSwitchProfilePortHighSpeed(_BaseSchema):
    """High speed port enablement settings for C9500-32QC."""

    enabled: bool | None = None


class UpdateOrganizationConfigTemplateSwitchProfilePortProfile(_BaseSchema):
    """Profile attributes."""

    enabled: bool | None = None
    id: str | None = None
    iname: str | None = None
