# generated by datamodel-codegen:
#   filename:  netbox-openapi-4.3.json
#   timestamp: 2026-03-27T21:55:45+00:00

"""
Pydantic models generated from NetBox 4.3 OpenAPI.

Do not edit by hand. Regenerate with scripts/generate_typed_sdk.py.
"""

from __future__ import annotations

from datetime import date
from typing import Any, Literal
from uuid import UUID

from pydantic import (
    AnyUrl,
    AwareDatetime,
    BaseModel,
    EmailStr,
    Field,
    RootModel,
    confloat,
    conint,
    constr,
)


class Family(BaseModel):
    value: Literal[4, 6] | None = Field(None, description="* `4` - IPv4\n* `6` - IPv6")
    label: Literal["IPv4", "IPv6"] | None = None


class AvailableASN(BaseModel):
    asn: int
    description: str | None = None


class BriefCable(BaseModel):
    id: int
    url: AnyUrl
    display: str
    label: constr(max_length=100) | None = None
    description: constr(max_length=200) | None = None


class BriefCableRequest(BaseModel):
    label: constr(max_length=100) | None = None
    description: constr(max_length=200) | None = None


class CircuitID(RootModel[constr(max_length=100)]):
    root: constr(max_length=100) = Field(..., description="Unique circuit ID", title="Circuit ID")


class BriefCircuitGroup(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)


class Priority(BaseModel):
    value: Literal["primary", "secondary", "tertiary", "inactive", ""] | None = Field(
        None,
        description="* `primary` - Primary\n* `secondary` - Secondary\n* `tertiary` - Tertiary\n* `inactive` - Inactive",
    )
    label: Literal["Primary", "Secondary", "Tertiary", "Inactive"] | None = None


class BriefCircuitGroupAssignmentSerializer(BaseModel):
    id: int
    url: AnyUrl
    display: str
    group: BriefCircuitGroup
    priority: Priority | None = None


class BriefCircuitGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)


class CircuitID1(RootModel[constr(min_length=1, max_length=100)]):
    root: constr(min_length=1, max_length=100) = Field(
        ..., description="Unique circuit ID", title="Circuit ID"
    )


class BriefCircuitType(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    circuit_count: int | None = None


class BriefCircuitTypeRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    description: constr(max_length=200) | None = None


class BriefCluster(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    virtualmachine_count: int | None = None


class BriefClusterGroup(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    cluster_count: int | None = None


class BriefClusterGroupRequest(BriefCircuitTypeRequest):
    pass


class BriefClusterRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None


class BriefClusterType(BriefClusterGroup):
    pass


class BriefClusterTypeRequest(BriefCircuitTypeRequest):
    pass


class BriefConfigTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None


class BriefConfigTemplateRequest(BriefClusterRequest):
    pass


class BriefContact(BriefConfigTemplate):
    pass


class BriefContactRequest(BriefClusterRequest):
    pass


class BriefContactRole(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None


class BriefContactRoleRequest(BriefCircuitTypeRequest):
    pass


class BriefCustomFieldChoiceSet(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    choices_count: str | None = None


class BriefCustomFieldChoiceSetRequest(BriefClusterRequest):
    pass


class BriefDataFile(BaseModel):
    id: int
    url: AnyUrl
    display: str
    path: str = Field(..., description="File path relative to the data source's root")


class BriefDataSource(BriefConfigTemplate):
    pass


class BriefDataSourceRequest(BriefClusterRequest):
    pass


class BriefDevice(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=64) | None = None
    description: constr(max_length=200) | None = None


class BriefDeviceRequest(BaseModel):
    name: constr(max_length=64) | None = None
    description: constr(max_length=200) | None = None


class FieldDepth(RootModel[int]):
    root: int = Field(..., title=" depth")


class BriefDeviceRole(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    device_count: int | None = None
    virtualmachine_count: int | None = None
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class BriefDeviceRoleRequest(BriefCircuitTypeRequest):
    pass


class BriefFHRPGroup(BaseModel):
    id: int
    url: AnyUrl
    display: str
    protocol: Literal["vrrp2", "vrrp3", "carp", "clusterxl", "hsrp", "glbp", "other"] = Field(
        ...,
        description="* `vrrp2` - VRRPv2\n* `vrrp3` - VRRPv3\n* `carp` - CARP\n* `clusterxl` - ClusterXL\n* `hsrp` - HSRP\n* `glbp` - GLBP\n* `other` - Other",
    )
    group_id: conint(ge=0, le=32767)
    description: constr(max_length=200) | None = None


class BriefFHRPGroupRequest(BaseModel):
    protocol: Literal["vrrp2", "vrrp3", "carp", "clusterxl", "hsrp", "glbp", "other"] = Field(
        ...,
        description="* `vrrp2` - VRRPv2\n* `vrrp3` - VRRPv3\n* `carp` - CARP\n* `clusterxl` - ClusterXL\n* `hsrp` - HSRP\n* `glbp` - GLBP\n* `other` - Other",
    )
    group_id: conint(ge=0, le=32767)
    description: constr(max_length=200) | None = None


class BriefIKEPolicy(BriefConfigTemplate):
    pass


class BriefIKEPolicyRequest(BriefClusterRequest):
    pass


class BriefIPAddress(BaseModel):
    id: int
    url: AnyUrl
    display: str
    family: Family
    address: str
    description: constr(max_length=200) | None = None


class BriefIPAddressRequest(BaseModel):
    address: constr(min_length=1)
    description: constr(max_length=200) | None = None


class BriefIPSecPolicy(BriefConfigTemplate):
    pass


class BriefIPSecPolicyRequest(BriefClusterRequest):
    pass


class BriefIPSecProfile(BriefConfigTemplate):
    pass


class BriefIPSecProfileRequest(BriefClusterRequest):
    pass


class FieldOccupied(RootModel[bool]):
    root: bool = Field(..., title=" occupied")


class BriefInterface(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device: BriefDevice
    name: constr(max_length=64)
    description: constr(max_length=200) | None = None
    cable: BriefCable | None = None
    field_occupied: FieldOccupied = Field(..., alias="_occupied", title=" occupied")


class BriefInterfaceRequest(BaseModel):
    device: int | BriefDeviceRequest
    name: constr(min_length=1, max_length=64)
    description: constr(max_length=200) | None = None


class BriefInventoryItemRole(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    inventoryitem_count: int | None = None


class BriefInventoryItemRoleRequest(BriefCircuitTypeRequest):
    pass


class Status(BaseModel):
    value: Literal["pending", "scheduled", "running", "completed", "errored", "failed"] | None = (
        Field(
            None,
            description="* `pending` - Pending\n* `scheduled` - Scheduled\n* `running` - Running\n* `completed` - Completed\n* `errored` - Errored\n* `failed` - Failed",
        )
    )
    label: Literal["Pending", "Scheduled", "Running", "Completed", "Errored", "Failed"] | None = (
        None
    )


class BriefJobRequest(BaseModel):
    completed: AwareDatetime | None = None


class Type(BaseModel):
    value: (
        Literal[
            "vpws",
            "vpls",
            "vxlan",
            "vxlan-evpn",
            "mpls-evpn",
            "pbb-evpn",
            "evpn-vpws",
            "epl",
            "evpl",
            "ep-lan",
            "evp-lan",
            "ep-tree",
            "evp-tree",
            "spb",
        ]
        | None
    ) = Field(
        None,
        description="* `vpws` - VPWS\n* `vpls` - VPLS\n* `vxlan` - VXLAN\n* `vxlan-evpn` - VXLAN-EVPN\n* `mpls-evpn` - MPLS EVPN\n* `pbb-evpn` - PBB EVPN\n* `evpn-vpws` - EVPN VPWS\n* `epl` - EPL\n* `evpl` - EVPL\n* `ep-lan` - Ethernet Private LAN\n* `evp-lan` - Ethernet Virtual Private LAN\n* `ep-tree` - Ethernet Private Tree\n* `evp-tree` - Ethernet Virtual Private Tree\n* `spb` - SPB",
    )
    label: (
        Literal[
            "VPWS",
            "VPLS",
            "VXLAN",
            "VXLAN-EVPN",
            "MPLS EVPN",
            "PBB EVPN",
            "EVPN VPWS",
            "EPL",
            "EVPL",
            "Ethernet Private LAN",
            "Ethernet Virtual Private LAN",
            "Ethernet Private Tree",
            "Ethernet Virtual Private Tree",
            "SPB",
        ]
        | None
    ) = None


class BriefL2VPN(BaseModel):
    id: int
    url: AnyUrl
    display: str
    identifier: conint(ge=-9223372036854775808, le=9223372036854775807) | None = None
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    type: Type | None = None
    description: constr(max_length=200) | None = None


class BriefL2VPNRequest(BaseModel):
    identifier: conint(ge=-9223372036854775808, le=9223372036854775807) | None = None
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    type: (
        Literal[
            "vpws",
            "vpls",
            "vxlan",
            "vxlan-evpn",
            "mpls-evpn",
            "pbb-evpn",
            "evpn-vpws",
            "epl",
            "evpl",
            "ep-lan",
            "evp-lan",
            "ep-tree",
            "evp-tree",
            "spb",
        ]
        | None
    ) = Field(
        None,
        description="* `vpws` - VPWS\n* `vpls` - VPLS\n* `vxlan` - VXLAN\n* `vxlan-evpn` - VXLAN-EVPN\n* `mpls-evpn` - MPLS EVPN\n* `pbb-evpn` - PBB EVPN\n* `evpn-vpws` - EVPN VPWS\n* `epl` - EPL\n* `evpl` - EVPL\n* `ep-lan` - Ethernet Private LAN\n* `evp-lan` - Ethernet Virtual Private LAN\n* `ep-tree` - Ethernet Private Tree\n* `evp-tree` - Ethernet Virtual Private Tree\n* `spb` - SPB",
    )
    description: constr(max_length=200) | None = None


class BriefL2VPNTermination(BaseModel):
    id: int
    url: AnyUrl
    display: str
    l2vpn: BriefL2VPN


class BriefL2VPNTerminationRequest(BaseModel):
    l2vpn: int | BriefL2VPNRequest


class BriefLocation(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    rack_count: int | None = 0
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class BriefLocationRequest(BriefCircuitTypeRequest):
    pass


class BriefMACAddress(BaseModel):
    id: int
    url: AnyUrl
    display: str
    mac_address: str
    description: constr(max_length=200) | None = None


class BriefMACAddressRequest(BaseModel):
    mac_address: str
    description: constr(max_length=200) | None = None


class BriefManufacturer(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    devicetype_count: int | None = None


class BriefManufacturerRequest(BriefCircuitTypeRequest):
    pass


class BriefModuleTypeProfile(BriefConfigTemplate):
    pass


class BriefModuleTypeProfileRequest(BriefClusterRequest):
    pass


class BriefModuleTypeRequest(BaseModel):
    profile: int | BriefModuleTypeProfileRequest | None = None
    manufacturer: int | BriefManufacturerRequest
    model: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None


class BriefPlatform(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    device_count: int | None = None
    virtualmachine_count: int | None = None


class BriefPlatformRequest(BriefCircuitTypeRequest):
    pass


class BriefPowerPanel(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    powerfeed_count: int | None = None


class BriefPowerPanelRequest(BriefClusterRequest):
    pass


class BriefPowerPort(BriefInterface):
    pass


class BriefPowerPortRequest(BriefInterfaceRequest):
    pass


class BriefPowerPortTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    description: constr(max_length=200) | None = None


class BriefPowerPortTemplateRequest(BaseModel):
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    description: constr(max_length=200) | None = None


class BriefProvider(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100) = Field(..., description="Full name of the provider")
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    circuit_count: int | None = None


class AccountID(RootModel[constr(max_length=100)]):
    root: constr(max_length=100) = Field(..., title="Account ID")


class BriefProviderAccount(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100) | None = ""
    account: AccountID = Field(..., title="Account ID")
    description: constr(max_length=200) | None = None


class AccountID1(RootModel[constr(min_length=1, max_length=100)]):
    root: constr(min_length=1, max_length=100) = Field(..., title="Account ID")


class BriefProviderAccountRequest(BaseModel):
    name: constr(max_length=100) | None = ""
    account: AccountID1 = Field(..., title="Account ID")
    description: constr(max_length=200) | None = None


class BriefProviderNetwork(BriefConfigTemplate):
    pass


class BriefProviderNetworkRequest(BriefClusterRequest):
    pass


class BriefProviderRequest(BaseModel):
    name: constr(min_length=1, max_length=100) = Field(..., description="Full name of the provider")
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    description: constr(max_length=200) | None = None


class BriefRIR(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    aggregate_count: int | None = None


class BriefRIRRequest(BriefCircuitTypeRequest):
    pass


class BriefRack(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    device_count: int | None = None


class BriefRackRequest(BriefClusterRequest):
    pass


class BriefRackRole(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    rack_count: int | None = None


class BriefRackRoleRequest(BriefCircuitTypeRequest):
    pass


class BriefRackType(BaseModel):
    id: int
    url: AnyUrl
    display: str
    manufacturer: BriefManufacturer
    model: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None


class BriefRackTypeRequest(BaseModel):
    manufacturer: int | BriefManufacturerRequest
    model: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    description: constr(max_length=200) | None = None


class BriefRearPortTemplate(BriefPowerPortTemplate):
    pass


class BriefRearPortTemplateRequest(BriefPowerPortTemplateRequest):
    pass


class BriefRegion(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    site_count: int | None = 0
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class BriefRegionRequest(BriefCircuitTypeRequest):
    pass


class BriefRole(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    prefix_count: int | None = None
    vlan_count: int | None = None


class BriefRoleRequest(BriefCircuitTypeRequest):
    pass


class BriefSite(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100) = Field(..., description="Full name of the site")
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None


class BriefSiteGroup(BriefRegion):
    pass


class BriefSiteGroupRequest(BriefCircuitTypeRequest):
    pass


class BriefSiteRequest(BaseModel):
    name: constr(min_length=1, max_length=100) = Field(..., description="Full name of the site")
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    description: constr(max_length=200) | None = None


class BriefTag(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-\w]+$", max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    description: constr(max_length=200) | None = None


class BriefTenant(BriefContactRole):
    pass


class BriefTenantGroup(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    tenant_count: int | None = 0
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class BriefTenantGroupRequest(BriefCircuitTypeRequest):
    pass


class BriefTenantRequest(BriefCircuitTypeRequest):
    pass


class BriefTunnel(BriefConfigTemplate):
    pass


class BriefTunnelGroup(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    tunnel_count: int | None = None


class BriefTunnelGroupRequest(BriefCircuitTypeRequest):
    pass


class BriefTunnelRequest(BriefClusterRequest):
    pass


class BriefUser(BaseModel):
    id: int
    url: AnyUrl
    display: str
    username: constr(pattern=r"^[\w.@+-]+$", max_length=150) = Field(
        ...,
        description="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
    )


class BriefUserRequest(BaseModel):
    username: constr(pattern=r"^[\w.@+-]+$", min_length=1, max_length=150) = Field(
        ...,
        description="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
    )


class VLANID(RootModel[conint(ge=1, le=4094)]):
    root: conint(ge=1, le=4094) = Field(
        ..., description="Numeric VLAN ID (1-4094)", title="VLAN ID"
    )


class BriefVLAN(BaseModel):
    id: int
    url: AnyUrl
    display: str
    vid: VLANID = Field(..., description="Numeric VLAN ID (1-4094)", title="VLAN ID")
    name: constr(max_length=64)
    description: constr(max_length=200) | None = None


class BriefVLANGroup(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    vlan_count: int | None = None


class BriefVLANGroupRequest(BriefCircuitTypeRequest):
    pass


class BriefVLANRequest(BaseModel):
    vid: VLANID = Field(..., description="Numeric VLAN ID (1-4094)", title="VLAN ID")
    name: constr(min_length=1, max_length=64)
    description: constr(max_length=200) | None = None


class BriefVLANTranslationPolicy(BriefConfigTemplate):
    pass


class BriefVLANTranslationPolicyRequest(BriefClusterRequest):
    pass


class RouteDistinguisher(RootModel[constr(max_length=21) | None]):
    root: constr(max_length=21) | None = Field(
        None,
        description="Unique route distinguisher (as defined in RFC 4364)",
        title="Route distinguisher",
    )


class BriefVRF(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    rd: RouteDistinguisher | None = Field(
        None,
        description="Unique route distinguisher (as defined in RFC 4364)",
        title="Route distinguisher",
    )
    description: constr(max_length=200) | None = None
    prefix_count: int | None = None


class BriefVRFRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    rd: RouteDistinguisher | None = Field(
        None,
        description="Unique route distinguisher (as defined in RFC 4364)",
        title="Route distinguisher",
    )
    description: constr(max_length=200) | None = None


class CircuitID2(CircuitID):
    pass


class BriefVirtualCircuit(BaseModel):
    id: int
    url: AnyUrl
    display: str
    cid: CircuitID2 = Field(..., description="Unique circuit ID", title="Circuit ID")
    provider_network: BriefProviderNetwork
    description: constr(max_length=200) | None = None


class CircuitID3(CircuitID1):
    pass


class BriefVirtualCircuitRequest(BaseModel):
    cid: CircuitID3 = Field(..., description="Unique circuit ID", title="Circuit ID")
    provider_network: int | BriefProviderNetworkRequest
    description: constr(max_length=200) | None = None


class BriefVirtualCircuitType(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    virtual_circuit_count: int


class BriefVirtualCircuitTypeRequest(BriefCircuitTypeRequest):
    pass


class BriefVirtualMachine(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=64)
    description: constr(max_length=200) | None = None


class BriefVirtualMachineRequest(BaseModel):
    name: constr(min_length=1, max_length=64)
    description: constr(max_length=200) | None = None


class BriefWirelessLANGroup(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    wirelesslan_count: int | None = 0
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class BriefWirelessLANGroupRequest(BriefCircuitTypeRequest):
    pass


class Status1(BaseModel):
    value: Literal["connected", "planned", "decommissioning"] | None = Field(
        None,
        description="* `connected` - Connected\n* `planned` - Planned\n* `decommissioning` - Decommissioning",
    )
    label: Literal["Connected", "Planned", "Decommissioning"] | None = None


class LengthUnit(BaseModel):
    value: Literal["km", "m", "cm", "mi", "ft", "in", ""] | None = Field(
        None,
        description="* `km` - Kilometers\n* `m` - Meters\n* `cm` - Centimeters\n* `mi` - Miles\n* `ft` - Feet\n* `in` - Inches",
    )
    label: Literal["Kilometers", "Meters", "Centimeters", "Miles", "Feet", "Inches"] | None = None


class End(RootModel[Literal["A", "B"]]):
    root: Literal["A", "B"] = Field(..., description="* `A` - A\n* `B` - B", title="End")


class CableTermination(BaseModel):
    id: int
    url: AnyUrl
    display: str
    cable: int
    cable_end: End | None = Field(None, description="* `A` - A\n* `B` - B", title="End")
    termination_type: str
    termination_id: conint(ge=0, le=9223372036854775807)
    termination: Any | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class CableTerminationRequest(BaseModel):
    cable: int
    cable_end: End | None = Field(None, description="* `A` - A\n* `B` - B", title="End")
    termination_type: str
    termination_id: conint(ge=0, le=9223372036854775807)


class CircuitID4(CircuitID):
    pass


class Status2(BaseModel):
    value: (
        Literal[
            "planned",
            "provisioning",
            "active",
            "offline",
            "deprovisioning",
            "decommissioned",
        ]
        | None
    ) = Field(
        None,
        description="* `planned` - Planned\n* `provisioning` - Provisioning\n* `active` - Active\n* `offline` - Offline\n* `deprovisioning` - Deprovisioning\n* `decommissioned` - Decommissioned",
    )
    label: (
        Literal[
            "Planned",
            "Provisioning",
            "Active",
            "Offline",
            "Deprovisioning",
            "Decommissioned",
        ]
        | None
    ) = None


class Installed(RootModel[date | None]):
    root: date | None = Field(None, title="Installed")


class Terminates(RootModel[date | None]):
    root: date | None = Field(None, title="Terminates")


class CommitRateKbps(RootModel[conint(ge=0, le=2147483647) | None]):
    root: conint(ge=0, le=2147483647) | None = Field(
        None, description="Committed rate", title="Commit rate (Kbps)"
    )


class DistanceUnit(BaseModel):
    value: Literal["km", "m", "mi", "ft", ""] | None = Field(
        None,
        description="* `km` - Kilometers\n* `m` - Meters\n* `mi` - Miles\n* `ft` - Feet",
    )
    label: Literal["Kilometers", "Meters", "Miles", "Feet"] | None = None


class PortSpeedKbps(RootModel[conint(ge=0, le=2147483647) | None]):
    root: conint(ge=0, le=2147483647) | None = Field(
        None, description="Physical circuit speed", title="Port speed (Kbps)"
    )


class UpstreamSpeedKbps(RootModel[conint(ge=0, le=2147483647) | None]):
    root: conint(ge=0, le=2147483647) | None = Field(
        None,
        description="Upstream speed, if different from port speed",
        title="Upstream speed (Kbps)",
    )


class CrossConnectID(RootModel[constr(max_length=50)]):
    root: constr(max_length=50) = Field(
        ..., description="ID of the local cross-connect", title="Cross-connect ID"
    )


class CircuitCircuitTermination(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    termination_type: str | None = None
    termination_id: int | None = None
    termination: Any | None = None
    port_speed: PortSpeedKbps | None = Field(
        None, description="Physical circuit speed", title="Port speed (Kbps)"
    )
    upstream_speed: UpstreamSpeedKbps | None = Field(
        None,
        description="Upstream speed, if different from port speed",
        title="Upstream speed (Kbps)",
    )
    xconnect_id: CrossConnectID | None = Field(
        None, description="ID of the local cross-connect", title="Cross-connect ID"
    )
    description: constr(max_length=200) | None = None


class CircuitCircuitTerminationRequest(BaseModel):
    termination_type: str | None = None
    termination_id: int | None = None
    port_speed: PortSpeedKbps | None = Field(
        None, description="Physical circuit speed", title="Port speed (Kbps)"
    )
    upstream_speed: UpstreamSpeedKbps | None = Field(
        None,
        description="Upstream speed, if different from port speed",
        title="Upstream speed (Kbps)",
    )
    xconnect_id: CrossConnectID | None = Field(
        None, description="ID of the local cross-connect", title="Cross-connect ID"
    )
    description: constr(max_length=200) | None = None


class CircuitID5(CircuitID1):
    pass


class TerminationSide(RootModel[Literal["A", "Z"]]):
    root: Literal["A", "Z"] = Field(
        ..., description="* `A` - A\n* `Z` - Z", title="Termination side"
    )


class PatchPanelPortS(RootModel[constr(max_length=100)]):
    root: constr(max_length=100) = Field(
        ...,
        description="Patch panel ID and port number(s)",
        title="Patch panel/port(s)",
    )


class Status3(BaseModel):
    value: Literal["planned", "staging", "active", "decommissioning", "offline"] | None = Field(
        None,
        description="* `planned` - Planned\n* `staging` - Staging\n* `active` - Active\n* `decommissioning` - Decommissioning\n* `offline` - Offline",
    )
    label: Literal["Planned", "Staging", "Active", "Decommissioning", "Offline"] | None = None


class DateSynced(RootModel[AwareDatetime | None]):
    root: AwareDatetime | None = Field(None, title="Date synced")


class ConfigContextRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    weight: conint(ge=0, le=32767) | None = None
    description: constr(max_length=200) | None = None
    is_active: bool | None = None
    regions: list[int] | None = None
    site_groups: list[int] | None = None
    sites: list[int] | None = None
    locations: list[int] | None = None
    device_types: list[int] | None = None
    roles: list[int] | None = None
    platforms: list[int] | None = None
    cluster_types: list[int] | None = None
    cluster_groups: list[int] | None = None
    clusters: list[int] | None = None
    tenant_groups: list[int] | None = None
    tenants: list[int] | None = None
    tags: list[constr(min_length=1)] | None = None
    data_source: int | BriefDataSourceRequest | None = None
    data: Any


class Type1(BaseModel):
    value: (
        Literal[
            "de-9",
            "db-25",
            "rj-11",
            "rj-12",
            "rj-45",
            "mini-din-8",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `de-9` - DE-9\n* `db-25` - DB-25\n* `rj-11` - RJ-11\n* `rj-12` - RJ-12\n* `rj-45` - RJ-45\n* `mini-din-8` - Mini-DIN 8\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    label: (
        Literal[
            "DE-9",
            "DB-25",
            "RJ-11",
            "RJ-12",
            "RJ-45",
            "Mini-DIN 8",
            "USB Type A",
            "USB Type B",
            "USB Type C",
            "USB Mini A",
            "USB Mini B",
            "USB Micro A",
            "USB Micro B",
            "USB Micro AB",
            "Other",
        ]
        | None
    ) = None


class Speed(BaseModel):
    value: Literal[1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200] | None = Field(
        None,
        description="* `1200` - 1200 bps\n* `2400` - 2400 bps\n* `4800` - 4800 bps\n* `9600` - 9600 bps\n* `19200` - 19.2 kbps\n* `38400` - 38.4 kbps\n* `57600` - 57.6 kbps\n* `115200` - 115.2 kbps",
    )
    label: (
        Literal[
            "1200 bps",
            "2400 bps",
            "4800 bps",
            "9600 bps",
            "19.2 kbps",
            "38.4 kbps",
            "57.6 kbps",
            "115.2 kbps",
        ]
        | None
    ) = None


class Type5(BaseModel):
    value: (
        Literal[
            "text",
            "longtext",
            "integer",
            "decimal",
            "boolean",
            "date",
            "datetime",
            "url",
            "json",
            "select",
            "multiselect",
            "object",
            "multiobject",
        ]
        | None
    ) = Field(
        None,
        description="* `text` - Text\n* `longtext` - Text (long)\n* `integer` - Integer\n* `decimal` - Decimal\n* `boolean` - Boolean (true/false)\n* `date` - Date\n* `datetime` - Date & time\n* `url` - URL\n* `json` - JSON\n* `select` - Selection\n* `multiselect` - Multiple selection\n* `object` - Object\n* `multiobject` - Multiple objects",
    )
    label: (
        Literal[
            "Text",
            "Text (long)",
            "Integer",
            "Decimal",
            "Boolean (true/false)",
            "Date",
            "Date & time",
            "URL",
            "JSON",
            "Selection",
            "Multiple selection",
            "Object",
            "Multiple objects",
        ]
        | None
    ) = None


class MustBeUnique(RootModel[bool]):
    root: bool = Field(
        ...,
        description="The value of this field must be unique for the assigned object",
        title="Must be unique",
    )


class FilterLogic(BaseModel):
    value: Literal["disabled", "loose", "exact"] | None = Field(
        None,
        description="* `disabled` - Disabled\n* `loose` - Loose\n* `exact` - Exact",
    )
    label: Literal["Disabled", "Loose", "Exact"] | None = None


class UiVisible(BaseModel):
    value: Literal["always", "if-set", "hidden"] | None = Field(
        None,
        description="* `always` - Always\n* `if-set` - If set\n* `hidden` - Hidden",
    )
    label: Literal["Always", "If set", "Hidden"] | None = None


class UiEditable(BaseModel):
    value: Literal["yes", "no", "hidden"] | None = Field(
        None, description="* `yes` - Yes\n* `no` - No\n* `hidden` - Hidden"
    )
    label: Literal["Yes", "No", "Hidden"] | None = None


class DisplayWeight(RootModel[conint(ge=0, le=32767)]):
    root: conint(ge=0, le=32767) = Field(
        ...,
        description="Fields with higher weights appear lower in a form.",
        title="Display weight",
    )


class MinimumValue(RootModel[conint(ge=-9223372036854775808, le=9223372036854775807) | None]):
    root: conint(ge=-9223372036854775808, le=9223372036854775807) | None = Field(
        None,
        description="Minimum allowed value (for numeric fields)",
        title="Minimum value",
    )


class MaximumValue(RootModel[conint(ge=-9223372036854775808, le=9223372036854775807) | None]):
    root: conint(ge=-9223372036854775808, le=9223372036854775807) | None = Field(
        None,
        description="Maximum allowed value (for numeric fields)",
        title="Maximum value",
    )


class CustomField(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    object_types: list[str]
    type: Type5
    related_object_type: str | None = None
    data_type: str
    name: constr(pattern=r"^[a-z0-9_]+$", max_length=50) = Field(
        ..., description="Internal field name"
    )
    label: constr(max_length=50) | None = Field(
        None,
        description="Name of the field as displayed to users (if not provided, 'the field's name will be used)",
    )
    group_name: constr(max_length=50) | None = Field(
        None,
        description="Custom fields within the same group will be displayed together",
    )
    description: constr(max_length=200) | None = None
    required: bool | None = Field(
        None,
        description="This field is required when creating new objects or editing an existing object.",
    )
    unique: MustBeUnique | None = Field(
        None,
        description="The value of this field must be unique for the assigned object",
        title="Must be unique",
    )
    search_weight: conint(ge=0, le=32767) | None = Field(
        None,
        description="Weighting for search. Lower values are considered more important. Fields with a search weight of zero will be ignored.",
    )
    filter_logic: FilterLogic | None = None
    ui_visible: UiVisible | None = None
    ui_editable: UiEditable | None = None
    is_cloneable: bool | None = Field(None, description="Replicate this value when cloning objects")
    default: Any | None = Field(
        None,
        description='Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. "Foo").',
    )
    related_object_filter: Any | None = Field(
        None,
        description='Filter the object selection choices using a query_params dict (must be a JSON value).Encapsulate strings with double quotes (e.g. "Foo").',
    )
    weight: DisplayWeight | None = Field(
        None,
        description="Fields with higher weights appear lower in a form.",
        title="Display weight",
    )
    validation_minimum: MinimumValue | None = Field(
        None,
        description="Minimum allowed value (for numeric fields)",
        title="Minimum value",
    )
    validation_maximum: MaximumValue | None = Field(
        None,
        description="Maximum allowed value (for numeric fields)",
        title="Maximum value",
    )
    validation_regex: constr(max_length=500) | None = Field(
        None,
        description="Regular expression to enforce on text field values. Use ^ and $ to force matching of entire string. For example, <code>^[A-Z]{3}$</code> will limit values to exactly three uppercase letters.",
    )
    choice_set: BriefCustomFieldChoiceSet | None = None
    comments: str | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class BaseChoices(BaseModel):
    value: Literal["IATA", "ISO_3166", "UN_LOCODE"] | None = Field(
        None,
        description="* `IATA` - IATA (Airport codes)\n* `ISO_3166` - ISO 3166 (Country codes)\n* `UN_LOCODE` - UN/LOCODE (Location codes)",
    )
    label: (
        Literal[
            "IATA (Airport codes)",
            "ISO 3166 (Country codes)",
            "UN/LOCODE (Location codes)",
        ]
        | None
    ) = None


class CustomFieldChoiceSet(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    base_choices: BaseChoices | None = None
    extra_choices: list[list[Any]]
    order_alphabetically: bool | None = Field(
        None, description="Choices are automatically ordered alphabetically"
    )
    choices_count: str | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class CustomFieldChoiceSetRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    base_choices: Literal["IATA", "ISO_3166", "UN_LOCODE"] | None = Field(
        None,
        description="* `IATA` - IATA (Airport codes)\n* `ISO_3166` - ISO 3166 (Country codes)\n* `UN_LOCODE` - UN/LOCODE (Location codes)",
    )
    extra_choices: list[list[Any]]
    order_alphabetically: bool | None = Field(
        None, description="Choices are automatically ordered alphabetically"
    )


class CustomFieldRequest(BaseModel):
    object_types: list[str]
    type: Literal[
        "text",
        "longtext",
        "integer",
        "decimal",
        "boolean",
        "date",
        "datetime",
        "url",
        "json",
        "select",
        "multiselect",
        "object",
        "multiobject",
    ] = Field(
        ...,
        description="* `text` - Text\n* `longtext` - Text (long)\n* `integer` - Integer\n* `decimal` - Decimal\n* `boolean` - Boolean (true/false)\n* `date` - Date\n* `datetime` - Date & time\n* `url` - URL\n* `json` - JSON\n* `select` - Selection\n* `multiselect` - Multiple selection\n* `object` - Object\n* `multiobject` - Multiple objects",
    )
    related_object_type: str | None = None
    name: constr(pattern=r"^[a-z0-9_]+$", min_length=1, max_length=50) = Field(
        ..., description="Internal field name"
    )
    label: constr(max_length=50) | None = Field(
        None,
        description="Name of the field as displayed to users (if not provided, 'the field's name will be used)",
    )
    group_name: constr(max_length=50) | None = Field(
        None,
        description="Custom fields within the same group will be displayed together",
    )
    description: constr(max_length=200) | None = None
    required: bool | None = Field(
        None,
        description="This field is required when creating new objects or editing an existing object.",
    )
    unique: MustBeUnique | None = Field(
        None,
        description="The value of this field must be unique for the assigned object",
        title="Must be unique",
    )
    search_weight: conint(ge=0, le=32767) | None = Field(
        None,
        description="Weighting for search. Lower values are considered more important. Fields with a search weight of zero will be ignored.",
    )
    filter_logic: Literal["disabled", "loose", "exact"] | None = Field(
        None,
        description="* `disabled` - Disabled\n* `loose` - Loose\n* `exact` - Exact",
    )
    ui_visible: Literal["always", "if-set", "hidden"] | None = Field(
        None,
        description="* `always` - Always\n* `if-set` - If set\n* `hidden` - Hidden",
    )
    ui_editable: Literal["yes", "no", "hidden"] | None = Field(
        None, description="* `yes` - Yes\n* `no` - No\n* `hidden` - Hidden"
    )
    is_cloneable: bool | None = Field(None, description="Replicate this value when cloning objects")
    default: Any | None = Field(
        None,
        description='Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. "Foo").',
    )
    related_object_filter: Any | None = Field(
        None,
        description='Filter the object selection choices using a query_params dict (must be a JSON value).Encapsulate strings with double quotes (e.g. "Foo").',
    )
    weight: DisplayWeight | None = Field(
        None,
        description="Fields with higher weights appear lower in a form.",
        title="Display weight",
    )
    validation_minimum: MinimumValue | None = Field(
        None,
        description="Minimum allowed value (for numeric fields)",
        title="Minimum value",
    )
    validation_maximum: MaximumValue | None = Field(
        None,
        description="Maximum allowed value (for numeric fields)",
        title="Maximum value",
    )
    validation_regex: constr(max_length=500) | None = Field(
        None,
        description="Regular expression to enforce on text field values. Use ^ and $ to force matching of entire string. For example, <code>^[A-Z]{3}$</code> will limit values to exactly three uppercase letters.",
    )
    choice_set: int | BriefCustomFieldChoiceSetRequest | None = None
    comments: str | None = None


class CustomLink(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    object_types: list[str]
    name: constr(max_length=100)
    enabled: bool | None = None
    link_text: str = Field(..., description="Jinja2 template code for link text")
    link_url: str = Field(..., description="Jinja2 template code for link URL")
    weight: conint(ge=0, le=32767) | None = None
    group_name: constr(max_length=50) | None = Field(
        None, description="Links with the same group will appear as a dropdown menu"
    )
    button_class: (
        Literal[
            "default",
            "blue",
            "indigo",
            "purple",
            "pink",
            "red",
            "orange",
            "yellow",
            "green",
            "teal",
            "cyan",
            "gray",
            "black",
            "white",
            "ghost-dark",
        ]
        | None
    ) = Field(
        None,
        description="The class of the first link in a group will be used for the dropdown button\n\n* `default` - Default\n* `blue` - Blue\n* `indigo` - Indigo\n* `purple` - Purple\n* `pink` - Pink\n* `red` - Red\n* `orange` - Orange\n* `yellow` - Yellow\n* `green` - Green\n* `teal` - Teal\n* `cyan` - Cyan\n* `gray` - Gray\n* `black` - Black\n* `white` - White\n* `ghost-dark` - Link",
    )
    new_window: bool | None = Field(None, description="Force link to open in a new window")
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class CustomLinkRequest(BaseModel):
    object_types: list[str]
    name: constr(min_length=1, max_length=100)
    enabled: bool | None = None
    link_text: constr(min_length=1) = Field(..., description="Jinja2 template code for link text")
    link_url: constr(min_length=1) = Field(..., description="Jinja2 template code for link URL")
    weight: conint(ge=0, le=32767) | None = None
    group_name: constr(max_length=50) | None = Field(
        None, description="Links with the same group will appear as a dropdown menu"
    )
    button_class: (
        Literal[
            "default",
            "blue",
            "indigo",
            "purple",
            "pink",
            "red",
            "orange",
            "yellow",
            "green",
            "teal",
            "cyan",
            "gray",
            "black",
            "white",
            "ghost-dark",
        ]
        | None
    ) = Field(
        None,
        description="The class of the first link in a group will be used for the dropdown button\n\n* `default` - Default\n* `blue` - Blue\n* `indigo` - Indigo\n* `purple` - Purple\n* `pink` - Pink\n* `red` - Red\n* `orange` - Orange\n* `yellow` - Yellow\n* `green` - Green\n* `teal` - Teal\n* `cyan` - Cyan\n* `gray` - Gray\n* `black` - Black\n* `white` - White\n* `ghost-dark` - Link",
    )
    new_window: bool | None = Field(None, description="Force link to open in a new window")


class Dashboard(BaseModel):
    layout: Any | None = None
    config: Any | None = None


class DashboardRequest(Dashboard):
    pass


class DataFile(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    source: BriefDataSource
    path: str = Field(..., description="File path relative to the data source's root")
    last_updated: AwareDatetime
    size: int
    hash: str = Field(..., description="SHA256 hash of the file data")


class Type6(BaseModel):
    value: Literal["local", "git", "amazon-s3"] | None = Field(
        None,
        description="* `None` - ---------\n* `local` - Local\n* `git` - Git\n* `amazon-s3` - Amazon S3",
    )
    label: Literal["---------", "Local", "Git", "Amazon S3"] | None = None


class URL(RootModel[constr(max_length=200)]):
    root: constr(max_length=200) = Field(..., title="URL")


class Status4(BaseModel):
    value: Literal["new", "queued", "syncing", "completed", "failed"] | None = Field(
        None,
        description="* `new` - New\n* `queued` - Queued\n* `syncing` - Syncing\n* `completed` - Completed\n* `failed` - Failed",
    )
    label: Literal["New", "Queued", "Syncing", "Completed", "Failed"] | None = None


class DataSource(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    type: Type6
    source_url: URL = Field(..., title="URL")
    enabled: bool | None = None
    status: Status4
    description: constr(max_length=200) | None = None
    sync_interval: Literal[1, 60, 720, 1440, 10080, 43200] | None = Field(
        None,
        description="* `1` - Minutely\n* `60` - Hourly\n* `720` - 12 hours\n* `1440` - Daily\n* `10080` - Weekly\n* `43200` - 30 days",
    )
    parameters: Any | None = None
    ignore_rules: str | None = Field(
        None,
        description="Patterns (one per line) matching files to ignore when syncing",
    )
    comments: str | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    last_synced: AwareDatetime | None = None
    file_count: int | None = None


class URL1(RootModel[constr(min_length=1, max_length=200)]):
    root: constr(min_length=1, max_length=200) = Field(..., title="URL")


class DataSourceRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    type: Literal["local", "git", "amazon-s3"] = Field(
        ...,
        description="* `None` - ---------\n* `local` - Local\n* `git` - Git\n* `amazon-s3` - Amazon S3",
    )
    source_url: URL1 = Field(..., title="URL")
    enabled: bool | None = None
    description: constr(max_length=200) | None = None
    sync_interval: Literal[1, 60, 720, 1440, 10080, 43200] | None = Field(
        None,
        description="* `1` - Minutely\n* `60` - Hourly\n* `720` - 12 hours\n* `1440` - Daily\n* `10080` - Weekly\n* `43200` - 30 days",
    )
    parameters: Any | None = None
    ignore_rules: str | None = Field(
        None,
        description="Patterns (one per line) matching files to ignore when syncing",
    )
    comments: str | None = None
    custom_fields: dict[str, Any] | None = None


class SerialNumber(RootModel[constr(max_length=50)]):
    root: constr(max_length=50) = Field(
        ...,
        description="Chassis serial number, assigned by the manufacturer",
        title="Serial number",
    )


class PositionU(RootModel[confloat(ge=0.5, lt=1000.0) | None]):
    root: confloat(ge=0.5, lt=1000.0) | None = Field(None, title="Position (U)")


class Face(BaseModel):
    value: Literal["front", "rear", ""] | None = Field(
        None, description="* `front` - Front\n* `rear` - Rear"
    )
    label: Literal["Front", "Rear"] | None = None


class Status5(BaseModel):
    value: (
        Literal[
            "offline",
            "active",
            "planned",
            "staged",
            "failed",
            "inventory",
            "decommissioning",
        ]
        | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `inventory` - Inventory\n* `decommissioning` - Decommissioning",
    )
    label: (
        Literal[
            "Offline",
            "Active",
            "Planned",
            "Staged",
            "Failed",
            "Inventory",
            "Decommissioning",
        ]
        | None
    ) = None


class Airflow(BaseModel):
    value: (
        Literal[
            "front-to-rear",
            "rear-to-front",
            "left-to-right",
            "right-to-left",
            "side-to-rear",
            "rear-to-side",
            "bottom-to-top",
            "top-to-bottom",
            "passive",
            "mixed",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front\n* `left-to-right` - Left to right\n* `right-to-left` - Right to left\n* `side-to-rear` - Side to rear\n* `rear-to-side` - Rear to side\n* `bottom-to-top` - Bottom to top\n* `top-to-bottom` - Top to bottom\n* `passive` - Passive\n* `mixed` - Mixed",
    )
    label: (
        Literal[
            "Front to rear",
            "Rear to front",
            "Left to right",
            "Right to left",
            "Side to rear",
            "Rear to side",
            "Bottom to top",
            "Top to bottom",
            "Passive",
            "Mixed",
        ]
        | None
    ) = None


class PositionU1(RootModel[confloat(ge=0.0, lt=1000.0)]):
    root: confloat(ge=0.0, lt=1000.0) = Field(1.0, title="Position (U)")


class SubdeviceRole(BaseModel):
    value: Literal["parent", "child", ""] | None = Field(
        None, description="* `parent` - Parent\n* `child` - Child"
    )
    label: Literal["Parent", "Child"] | None = None


class WeightUnit(BaseModel):
    value: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    label: Literal["Kilograms", "Grams", "Pounds", "Ounces"] | None = None


class PositionU3(PositionU):
    pass


class ActionType(BaseModel):
    value: Literal["webhook", "script", "notification"] | None = Field(
        None,
        description="* `webhook` - Webhook\n* `script` - Script\n* `notification` - Notification",
    )
    label: Literal["Webhook", "Script", "Notification"] | None = None


class ExportTemplate(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    object_types: list[str]
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    environment_params: Any | None = Field(
        None,
        description='Any <a href="https://jinja.palletsprojects.com/en/stable/api/#jinja2.Environment">additional parameters</a> to pass when constructing the Jinja environment',
        title="Environment parameters",
    )
    template_code: str = Field(..., description="Jinja template code.")
    mime_type: constr(max_length=50) | None = Field(
        None, description="Defaults to <code>text/plain; charset=utf-8</code>"
    )
    file_name: constr(max_length=200) | None = Field(
        None, description="Filename to give to the rendered export file"
    )
    file_extension: constr(max_length=15) | None = Field(
        None, description="Extension to append to the rendered filename"
    )
    as_attachment: bool | None = Field(None, description="Download file as attachment")
    data_source: BriefDataSource | None = None
    data_path: str = Field(..., description="Path to remote file (relative to data source root)")
    data_file: BriefDataFile
    data_synced: DateSynced | None = Field(None, title="Date synced")
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ExportTemplateRequest(BaseModel):
    object_types: list[str]
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    environment_params: Any | None = Field(
        None,
        description='Any <a href="https://jinja.palletsprojects.com/en/stable/api/#jinja2.Environment">additional parameters</a> to pass when constructing the Jinja environment',
        title="Environment parameters",
    )
    template_code: constr(min_length=1) = Field(..., description="Jinja template code.")
    mime_type: constr(max_length=50) | None = Field(
        None, description="Defaults to <code>text/plain; charset=utf-8</code>"
    )
    file_name: constr(max_length=200) | None = Field(
        None, description="Filename to give to the rendered export file"
    )
    file_extension: constr(max_length=15) | None = Field(
        None, description="Extension to append to the rendered filename"
    )
    as_attachment: bool | None = Field(None, description="Download file as attachment")
    data_source: int | BriefDataSourceRequest | None = None


class AuthenticationType(RootModel[Literal["plaintext", "md5", ""] | None]):
    root: Literal["plaintext", "md5", ""] | None = Field(
        None,
        description="* `plaintext` - Plaintext\n* `md5` - MD5",
        title="Authentication type",
    )


class AuthenticationKey(RootModel[constr(max_length=255)]):
    root: constr(max_length=255) = Field(..., title="Authentication key")


class FHRPGroupAssignment(BaseModel):
    id: int
    url: AnyUrl
    display: str
    group: BriefFHRPGroup
    interface_type: str
    interface_id: conint(ge=0, le=9223372036854775807)
    interface: Any | None = None
    priority: conint(ge=0, le=255)
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class FHRPGroupAssignmentRequest(BaseModel):
    group: int | BriefFHRPGroupRequest
    interface_type: str
    interface_id: conint(ge=0, le=9223372036854775807)
    priority: conint(ge=0, le=255)


class Type7(BaseModel):
    value: (
        Literal[
            "8p8c",
            "8p6c",
            "8p4c",
            "8p2c",
            "6p6c",
            "6p4c",
            "6p2c",
            "4p4c",
            "4p2c",
            "gg45",
            "tera-4p",
            "tera-2p",
            "tera-1p",
            "110-punch",
            "bnc",
            "f",
            "n",
            "mrj21",
            "fc",
            "fc-pc",
            "fc-upc",
            "fc-apc",
            "lc",
            "lc-pc",
            "lc-upc",
            "lc-apc",
            "lsh",
            "lsh-pc",
            "lsh-upc",
            "lsh-apc",
            "lx5",
            "lx5-pc",
            "lx5-upc",
            "lx5-apc",
            "mpo",
            "mtrj",
            "sc",
            "sc-pc",
            "sc-upc",
            "sc-apc",
            "st",
            "cs",
            "sn",
            "sma-905",
            "sma-906",
            "urm-p2",
            "urm-p4",
            "urm-p8",
            "splice",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
        ]
        | None
    ) = Field(
        None,
        description="* `8p8c` - 8P8C\n* `8p6c` - 8P6C\n* `8p4c` - 8P4C\n* `8p2c` - 8P2C\n* `6p6c` - 6P6C\n* `6p4c` - 6P4C\n* `6p2c` - 6P2C\n* `4p4c` - 4P4C\n* `4p2c` - 4P2C\n* `gg45` - GG45\n* `tera-4p` - TERA 4P\n* `tera-2p` - TERA 2P\n* `tera-1p` - TERA 1P\n* `110-punch` - 110 Punch\n* `bnc` - BNC\n* `f` - F Connector\n* `n` - N Connector\n* `mrj21` - MRJ21\n* `fc` - FC\n* `fc-pc` - FC/PC\n* `fc-upc` - FC/UPC\n* `fc-apc` - FC/APC\n* `lc` - LC\n* `lc-pc` - LC/PC\n* `lc-upc` - LC/UPC\n* `lc-apc` - LC/APC\n* `lsh` - LSH\n* `lsh-pc` - LSH/PC\n* `lsh-upc` - LSH/UPC\n* `lsh-apc` - LSH/APC\n* `lx5` - LX.5\n* `lx5-pc` - LX.5/PC\n* `lx5-upc` - LX.5/UPC\n* `lx5-apc` - LX.5/APC\n* `mpo` - MPO\n* `mtrj` - MTRJ\n* `sc` - SC\n* `sc-pc` - SC/PC\n* `sc-upc` - SC/UPC\n* `sc-apc` - SC/APC\n* `st` - ST\n* `cs` - CS\n* `sn` - SN\n* `sma-905` - SMA 905\n* `sma-906` - SMA 906\n* `urm-p2` - URM-P2\n* `urm-p4` - URM-P4\n* `urm-p8` - URM-P8\n* `splice` - Splice\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    label: (
        Literal[
            "8P8C",
            "8P6C",
            "8P4C",
            "8P2C",
            "6P6C",
            "6P4C",
            "6P2C",
            "4P4C",
            "4P2C",
            "GG45",
            "TERA 4P",
            "TERA 2P",
            "TERA 1P",
            "110 Punch",
            "BNC",
            "F Connector",
            "N Connector",
            "MRJ21",
            "FC",
            "FC/PC",
            "FC/UPC",
            "FC/APC",
            "LC",
            "LC/PC",
            "LC/UPC",
            "LC/APC",
            "LSH",
            "LSH/PC",
            "LSH/UPC",
            "LSH/APC",
            "LX.5",
            "LX.5/PC",
            "LX.5/UPC",
            "LX.5/APC",
            "MPO",
            "MTRJ",
            "SC",
            "SC/PC",
            "SC/UPC",
            "SC/APC",
            "ST",
            "CS",
            "SN",
            "SMA 905",
            "SMA 906",
            "URM-P2",
            "URM-P4",
            "URM-P8",
            "Splice",
            "USB Type A",
            "USB Type B",
            "USB Type C",
            "USB Mini A",
            "USB Mini B",
            "USB Micro A",
            "USB Micro B",
            "USB Micro AB",
            "Other",
        ]
        | None
    ) = None


class FrontPortRearPort(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    description: constr(max_length=200) | None = None


class FrontPortRearPortRequest(BaseModel):
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    description: constr(max_length=200) | None = None


class GenericObject(BaseModel):
    object_type: str
    object_id: int
    object: Any | None = None


class GenericObjectRequest(BaseModel):
    object_type: str
    object_id: int


class GroupRequest(BaseModel):
    name: constr(min_length=1, max_length=150)
    description: constr(max_length=200) | None = None
    permissions: list[int] | None = None


class Version(BaseModel):
    value: Literal[1, 2] | None = Field(None, description="* `1` - IKEv1\n* `2` - IKEv2")
    label: Literal["IKEv1", "IKEv2"] | None = None


class Mode(BaseModel):
    value: Literal["aggressive", "main"] | None = Field(
        None, description="* `aggressive` - Aggressive\n* `main` - Main"
    )
    label: Literal["Aggressive", "Main"] | None = None


class PreSharedKey(RootModel[str]):
    root: str = Field(..., title="Pre-shared key")


class AuthenticationMethod(BaseModel):
    value: Literal["preshared-keys", "certificates", "rsa-signatures", "dsa-signatures"] | None = (
        Field(
            None,
            description="* `preshared-keys` - Pre-shared keys\n* `certificates` - Certificates\n* `rsa-signatures` - RSA signatures\n* `dsa-signatures` - DSA signatures",
        )
    )
    label: Literal["Pre-shared keys", "Certificates", "RSA signatures", "DSA signatures"] | None = (
        None
    )


class EncryptionAlgorithm(BaseModel):
    value: (
        Literal[
            "aes-128-cbc",
            "aes-128-gcm",
            "aes-192-cbc",
            "aes-192-gcm",
            "aes-256-cbc",
            "aes-256-gcm",
            "3des-cbc",
            "des-cbc",
        ]
        | None
    ) = Field(
        None,
        description="* `aes-128-cbc` - 128-bit AES (CBC)\n* `aes-128-gcm` - 128-bit AES (GCM)\n* `aes-192-cbc` - 192-bit AES (CBC)\n* `aes-192-gcm` - 192-bit AES (GCM)\n* `aes-256-cbc` - 256-bit AES (CBC)\n* `aes-256-gcm` - 256-bit AES (GCM)\n* `3des-cbc` - 3DES\n* `des-cbc` - DES",
    )
    label: (
        Literal[
            "128-bit AES (CBC)",
            "128-bit AES (GCM)",
            "192-bit AES (CBC)",
            "192-bit AES (GCM)",
            "256-bit AES (CBC)",
            "256-bit AES (GCM)",
            "3DES",
            "DES",
        ]
        | None
    ) = None


class AuthenticationAlgorithm(BaseModel):
    value: Literal["hmac-sha1", "hmac-sha256", "hmac-sha384", "hmac-sha512", "hmac-md5"] | None = (
        Field(
            None,
            description="* `hmac-sha1` - SHA-1 HMAC\n* `hmac-sha256` - SHA-256 HMAC\n* `hmac-sha384` - SHA-384 HMAC\n* `hmac-sha512` - SHA-512 HMAC\n* `hmac-md5` - MD5 HMAC",
        )
    )
    label: (
        Literal["SHA-1 HMAC", "SHA-256 HMAC", "SHA-384 HMAC", "SHA-512 HMAC", "MD5 HMAC"] | None
    ) = None


class Group1(BaseModel):
    value: (
        Literal[
            1,
            2,
            5,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            27,
            28,
            29,
            30,
            31,
            32,
            33,
            34,
        ]
        | None
    ) = Field(
        None,
        description="* `1` - Group 1\n* `2` - Group 2\n* `5` - Group 5\n* `14` - Group 14\n* `15` - Group 15\n* `16` - Group 16\n* `17` - Group 17\n* `18` - Group 18\n* `19` - Group 19\n* `20` - Group 20\n* `21` - Group 21\n* `22` - Group 22\n* `23` - Group 23\n* `24` - Group 24\n* `25` - Group 25\n* `26` - Group 26\n* `27` - Group 27\n* `28` - Group 28\n* `29` - Group 29\n* `30` - Group 30\n* `31` - Group 31\n* `32` - Group 32\n* `33` - Group 33\n* `34` - Group 34",
    )
    label: (
        Literal[
            "Group 1",
            "Group 2",
            "Group 5",
            "Group 14",
            "Group 15",
            "Group 16",
            "Group 17",
            "Group 18",
            "Group 19",
            "Group 20",
            "Group 21",
            "Group 22",
            "Group 23",
            "Group 24",
            "Group 25",
            "Group 26",
            "Group 27",
            "Group 28",
            "Group 29",
            "Group 30",
            "Group 31",
            "Group 32",
            "Group 33",
            "Group 34",
        ]
        | None
    ) = None


class Status7(BaseModel):
    value: Literal["active", "reserved", "deprecated", "dhcp", "slaac"] | None = Field(
        None,
        description="* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated\n* `dhcp` - DHCP\n* `slaac` - SLAAC",
    )
    label: Literal["Active", "Reserved", "Deprecated", "DHCP", "SLAAC"] | None = None


class Role(BaseModel):
    value: (
        Literal[
            "loopback",
            "secondary",
            "anycast",
            "vip",
            "vrrp",
            "hsrp",
            "glbp",
            "carp",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `loopback` - Loopback\n* `secondary` - Secondary\n* `anycast` - Anycast\n* `vip` - VIP\n* `vrrp` - VRRP\n* `hsrp` - HSRP\n* `glbp` - GLBP\n* `carp` - CARP",
    )
    label: (
        Literal["Loopback", "Secondary", "Anycast", "VIP", "VRRP", "HSRP", "GLBP", "CARP"] | None
    ) = None


class Status8(BaseModel):
    value: Literal["active", "reserved", "deprecated"] | None = Field(
        None,
        description="* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    label: Literal["Active", "Reserved", "Deprecated"] | None = None


class PfsGroup(Group1):
    pass


class Mode1(BaseModel):
    value: Literal["esp", "ah"] | None = Field(None, description="* `esp` - ESP\n* `ah` - AH")
    label: Literal["ESP", "AH"] | None = None


class SALifetimeSeconds(RootModel[conint(ge=0, le=2147483647) | None]):
    root: conint(ge=0, le=2147483647) | None = Field(
        None,
        description="Security association lifetime (seconds)",
        title="SA lifetime (seconds)",
    )


class SALifetimeKB(RootModel[conint(ge=0, le=2147483647) | None]):
    root: conint(ge=0, le=2147483647) | None = Field(
        None,
        description="Security association lifetime (in kilobytes)",
        title="SA lifetime (KB)",
    )


class ImageAttachment(BaseModel):
    id: int
    url: AnyUrl
    display: str
    object_type: str
    object_id: conint(ge=0, le=9223372036854775807)
    parent: Any | None = None
    name: constr(max_length=50) | None = None
    image: AnyUrl
    image_height: int
    image_width: int
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ImageAttachmentRequest(BaseModel):
    object_type: str
    object_id: conint(ge=0, le=9223372036854775807)
    name: constr(max_length=50) | None = None
    image: bytes


class IntegerRange(RootModel[list[list[int]]]):
    root: list[list[int]]


class IntegerRangeRequest(IntegerRange):
    pass


class Type9(BaseModel):
    value: (
        Literal[
            "virtual",
            "bridge",
            "lag",
            "100base-fx",
            "100base-lfx",
            "100base-tx",
            "100base-t1",
            "1000base-t",
            "1000base-lx",
            "1000base-tx",
            "2.5gbase-t",
            "5gbase-t",
            "10gbase-t",
            "10gbase-cx4",
            "100base-x-sfp",
            "1000base-x-gbic",
            "1000base-x-sfp",
            "10gbase-x-sfpp",
            "10gbase-x-xfp",
            "10gbase-x-xenpak",
            "10gbase-x-x2",
            "25gbase-x-sfp28",
            "50gbase-x-sfp56",
            "40gbase-x-qsfpp",
            "50gbase-x-sfp28",
            "100gbase-x-cfp",
            "100gbase-x-cfp2",
            "200gbase-x-cfp2",
            "400gbase-x-cfp2",
            "100gbase-x-cfp4",
            "100gbase-x-cxp",
            "100gbase-x-cpak",
            "100gbase-x-dsfp",
            "100gbase-x-sfpdd",
            "100gbase-x-qsfp28",
            "100gbase-x-qsfpdd",
            "200gbase-x-qsfp56",
            "200gbase-x-qsfpdd",
            "400gbase-x-qsfp112",
            "400gbase-x-qsfpdd",
            "400gbase-x-osfp",
            "400gbase-x-osfp-rhs",
            "400gbase-x-cdfp",
            "400gbase-x-cfp8",
            "800gbase-x-qsfpdd",
            "800gbase-x-osfp",
            "1000base-kx",
            "2.5gbase-kx",
            "5gbase-kr",
            "10gbase-kr",
            "10gbase-kx4",
            "25gbase-kr",
            "40gbase-kr4",
            "50gbase-kr",
            "100gbase-kp4",
            "100gbase-kr2",
            "100gbase-kr4",
            "ieee802.11a",
            "ieee802.11g",
            "ieee802.11n",
            "ieee802.11ac",
            "ieee802.11ad",
            "ieee802.11ax",
            "ieee802.11ay",
            "ieee802.11be",
            "ieee802.15.1",
            "ieee802.15.4",
            "other-wireless",
            "gsm",
            "cdma",
            "lte",
            "4g",
            "5g",
            "sonet-oc3",
            "sonet-oc12",
            "sonet-oc48",
            "sonet-oc192",
            "sonet-oc768",
            "sonet-oc1920",
            "sonet-oc3840",
            "1gfc-sfp",
            "2gfc-sfp",
            "4gfc-sfp",
            "8gfc-sfpp",
            "16gfc-sfpp",
            "32gfc-sfp28",
            "32gfc-sfpp",
            "64gfc-qsfpp",
            "64gfc-sfpdd",
            "64gfc-sfpp",
            "128gfc-qsfp28",
            "infiniband-sdr",
            "infiniband-ddr",
            "infiniband-qdr",
            "infiniband-fdr10",
            "infiniband-fdr",
            "infiniband-edr",
            "infiniband-hdr",
            "infiniband-ndr",
            "infiniband-xdr",
            "t1",
            "e1",
            "t3",
            "e3",
            "xdsl",
            "docsis",
            "moca",
            "bpon",
            "epon",
            "10g-epon",
            "gpon",
            "xg-pon",
            "xgs-pon",
            "ng-pon2",
            "25g-pon",
            "50g-pon",
            "cisco-stackwise",
            "cisco-stackwise-plus",
            "cisco-flexstack",
            "cisco-flexstack-plus",
            "cisco-stackwise-80",
            "cisco-stackwise-160",
            "cisco-stackwise-320",
            "cisco-stackwise-480",
            "cisco-stackwise-1t",
            "juniper-vcp",
            "extreme-summitstack",
            "extreme-summitstack-128",
            "extreme-summitstack-256",
            "extreme-summitstack-512",
            "other",
        ]
        | None
    ) = Field(
        None,
        description="* `virtual` - Virtual\n* `bridge` - Bridge\n* `lag` - Link Aggregation Group (LAG)\n* `100base-fx` - 100BASE-FX (10/100ME FIBER)\n* `100base-lfx` - 100BASE-LFX (10/100ME FIBER)\n* `100base-tx` - 100BASE-TX (10/100ME)\n* `100base-t1` - 100BASE-T1 (10/100ME Single Pair)\n* `1000base-t` - 1000BASE-T (1GE)\n* `1000base-lx` - 1000BASE-LX (1GE)\n* `1000base-tx` - 1000BASE-TX (1GE)\n* `2.5gbase-t` - 2.5GBASE-T (2.5GE)\n* `5gbase-t` - 5GBASE-T (5GE)\n* `10gbase-t` - 10GBASE-T (10GE)\n* `10gbase-cx4` - 10GBASE-CX4 (10GE)\n* `100base-x-sfp` - SFP (100ME)\n* `1000base-x-gbic` - GBIC (1GE)\n* `1000base-x-sfp` - SFP (1GE)\n* `10gbase-x-sfpp` - SFP+ (10GE)\n* `10gbase-x-xfp` - XFP (10GE)\n* `10gbase-x-xenpak` - XENPAK (10GE)\n* `10gbase-x-x2` - X2 (10GE)\n* `25gbase-x-sfp28` - SFP28 (25GE)\n* `50gbase-x-sfp56` - SFP56 (50GE)\n* `40gbase-x-qsfpp` - QSFP+ (40GE)\n* `50gbase-x-sfp28` - QSFP28 (50GE)\n* `100gbase-x-cfp` - CFP (100GE)\n* `100gbase-x-cfp2` - CFP2 (100GE)\n* `200gbase-x-cfp2` - CFP2 (200GE)\n* `400gbase-x-cfp2` - CFP2 (400GE)\n* `100gbase-x-cfp4` - CFP4 (100GE)\n* `100gbase-x-cxp` - CXP (100GE)\n* `100gbase-x-cpak` - Cisco CPAK (100GE)\n* `100gbase-x-dsfp` - DSFP (100GE)\n* `100gbase-x-sfpdd` - SFP-DD (100GE)\n* `100gbase-x-qsfp28` - QSFP28 (100GE)\n* `100gbase-x-qsfpdd` - QSFP-DD (100GE)\n* `200gbase-x-qsfp56` - QSFP56 (200GE)\n* `200gbase-x-qsfpdd` - QSFP-DD (200GE)\n* `400gbase-x-qsfp112` - QSFP112 (400GE)\n* `400gbase-x-qsfpdd` - QSFP-DD (400GE)\n* `400gbase-x-osfp` - OSFP (400GE)\n* `400gbase-x-osfp-rhs` - OSFP-RHS (400GE)\n* `400gbase-x-cdfp` - CDFP (400GE)\n* `400gbase-x-cfp8` - CPF8 (400GE)\n* `800gbase-x-qsfpdd` - QSFP-DD (800GE)\n* `800gbase-x-osfp` - OSFP (800GE)\n* `1000base-kx` - 1000BASE-KX (1GE)\n* `2.5gbase-kx` - 2.5GBASE-KX (2.5GE)\n* `5gbase-kr` - 5GBASE-KR (5GE)\n* `10gbase-kr` - 10GBASE-KR (10GE)\n* `10gbase-kx4` - 10GBASE-KX4 (10GE)\n* `25gbase-kr` - 25GBASE-KR (25GE)\n* `40gbase-kr4` - 40GBASE-KR4 (40GE)\n* `50gbase-kr` - 50GBASE-KR (50GE)\n* `100gbase-kp4` - 100GBASE-KP4 (100GE)\n* `100gbase-kr2` - 100GBASE-KR2 (100GE)\n* `100gbase-kr4` - 100GBASE-KR4 (100GE)\n* `ieee802.11a` - IEEE 802.11a\n* `ieee802.11g` - IEEE 802.11b/g\n* `ieee802.11n` - IEEE 802.11n\n* `ieee802.11ac` - IEEE 802.11ac\n* `ieee802.11ad` - IEEE 802.11ad\n* `ieee802.11ax` - IEEE 802.11ax\n* `ieee802.11ay` - IEEE 802.11ay\n* `ieee802.11be` - IEEE 802.11be\n* `ieee802.15.1` - IEEE 802.15.1 (Bluetooth)\n* `ieee802.15.4` - IEEE 802.15.4 (LR-WPAN)\n* `other-wireless` - Other (Wireless)\n* `gsm` - GSM\n* `cdma` - CDMA\n* `lte` - LTE\n* `4g` - 4G\n* `5g` - 5G\n* `sonet-oc3` - OC-3/STM-1\n* `sonet-oc12` - OC-12/STM-4\n* `sonet-oc48` - OC-48/STM-16\n* `sonet-oc192` - OC-192/STM-64\n* `sonet-oc768` - OC-768/STM-256\n* `sonet-oc1920` - OC-1920/STM-640\n* `sonet-oc3840` - OC-3840/STM-1234\n* `1gfc-sfp` - SFP (1GFC)\n* `2gfc-sfp` - SFP (2GFC)\n* `4gfc-sfp` - SFP (4GFC)\n* `8gfc-sfpp` - SFP+ (8GFC)\n* `16gfc-sfpp` - SFP+ (16GFC)\n* `32gfc-sfp28` - SFP28 (32GFC)\n* `32gfc-sfpp` - SFP+ (32GFC)\n* `64gfc-qsfpp` - QSFP+ (64GFC)\n* `64gfc-sfpdd` - SFP-DD (64GFC)\n* `64gfc-sfpp` - SFP+ (64GFC)\n* `128gfc-qsfp28` - QSFP28 (128GFC)\n* `infiniband-sdr` - SDR (2 Gbps)\n* `infiniband-ddr` - DDR (4 Gbps)\n* `infiniband-qdr` - QDR (8 Gbps)\n* `infiniband-fdr10` - FDR10 (10 Gbps)\n* `infiniband-fdr` - FDR (13.5 Gbps)\n* `infiniband-edr` - EDR (25 Gbps)\n* `infiniband-hdr` - HDR (50 Gbps)\n* `infiniband-ndr` - NDR (100 Gbps)\n* `infiniband-xdr` - XDR (250 Gbps)\n* `t1` - T1 (1.544 Mbps)\n* `e1` - E1 (2.048 Mbps)\n* `t3` - T3 (45 Mbps)\n* `e3` - E3 (34 Mbps)\n* `xdsl` - xDSL\n* `docsis` - DOCSIS\n* `moca` - MoCA\n* `bpon` - BPON (622 Mbps / 155 Mbps)\n* `epon` - EPON (1 Gbps)\n* `10g-epon` - 10G-EPON (10 Gbps)\n* `gpon` - GPON (2.5 Gbps / 1.25 Gbps)\n* `xg-pon` - XG-PON (10 Gbps / 2.5 Gbps)\n* `xgs-pon` - XGS-PON (10 Gbps)\n* `ng-pon2` - NG-PON2 (TWDM-PON) (4x10 Gbps)\n* `25g-pon` - 25G-PON (25 Gbps)\n* `50g-pon` - 50G-PON (50 Gbps)\n* `cisco-stackwise` - Cisco StackWise\n* `cisco-stackwise-plus` - Cisco StackWise Plus\n* `cisco-flexstack` - Cisco FlexStack\n* `cisco-flexstack-plus` - Cisco FlexStack Plus\n* `cisco-stackwise-80` - Cisco StackWise-80\n* `cisco-stackwise-160` - Cisco StackWise-160\n* `cisco-stackwise-320` - Cisco StackWise-320\n* `cisco-stackwise-480` - Cisco StackWise-480\n* `cisco-stackwise-1t` - Cisco StackWise-1T\n* `juniper-vcp` - Juniper VCP\n* `extreme-summitstack` - Extreme SummitStack\n* `extreme-summitstack-128` - Extreme SummitStack-128\n* `extreme-summitstack-256` - Extreme SummitStack-256\n* `extreme-summitstack-512` - Extreme SummitStack-512\n* `other` - Other",
    )
    label: (
        Literal[
            "Virtual",
            "Bridge",
            "Link Aggregation Group (LAG)",
            "100BASE-FX (10/100ME FIBER)",
            "100BASE-LFX (10/100ME FIBER)",
            "100BASE-TX (10/100ME)",
            "100BASE-T1 (10/100ME Single Pair)",
            "1000BASE-T (1GE)",
            "1000BASE-LX (1GE)",
            "1000BASE-TX (1GE)",
            "2.5GBASE-T (2.5GE)",
            "5GBASE-T (5GE)",
            "10GBASE-T (10GE)",
            "10GBASE-CX4 (10GE)",
            "SFP (100ME)",
            "GBIC (1GE)",
            "SFP (1GE)",
            "SFP+ (10GE)",
            "XFP (10GE)",
            "XENPAK (10GE)",
            "X2 (10GE)",
            "SFP28 (25GE)",
            "SFP56 (50GE)",
            "QSFP+ (40GE)",
            "QSFP28 (50GE)",
            "CFP (100GE)",
            "CFP2 (100GE)",
            "CFP2 (200GE)",
            "CFP2 (400GE)",
            "CFP4 (100GE)",
            "CXP (100GE)",
            "Cisco CPAK (100GE)",
            "DSFP (100GE)",
            "SFP-DD (100GE)",
            "QSFP28 (100GE)",
            "QSFP-DD (100GE)",
            "QSFP56 (200GE)",
            "QSFP-DD (200GE)",
            "QSFP112 (400GE)",
            "QSFP-DD (400GE)",
            "OSFP (400GE)",
            "OSFP-RHS (400GE)",
            "CDFP (400GE)",
            "CPF8 (400GE)",
            "QSFP-DD (800GE)",
            "OSFP (800GE)",
            "1000BASE-KX (1GE)",
            "2.5GBASE-KX (2.5GE)",
            "5GBASE-KR (5GE)",
            "10GBASE-KR (10GE)",
            "10GBASE-KX4 (10GE)",
            "25GBASE-KR (25GE)",
            "40GBASE-KR4 (40GE)",
            "50GBASE-KR (50GE)",
            "100GBASE-KP4 (100GE)",
            "100GBASE-KR2 (100GE)",
            "100GBASE-KR4 (100GE)",
            "IEEE 802.11a",
            "IEEE 802.11b/g",
            "IEEE 802.11n",
            "IEEE 802.11ac",
            "IEEE 802.11ad",
            "IEEE 802.11ax",
            "IEEE 802.11ay",
            "IEEE 802.11be",
            "IEEE 802.15.1 (Bluetooth)",
            "IEEE 802.15.4 (LR-WPAN)",
            "Other (Wireless)",
            "GSM",
            "CDMA",
            "LTE",
            "4G",
            "5G",
            "OC-3/STM-1",
            "OC-12/STM-4",
            "OC-48/STM-16",
            "OC-192/STM-64",
            "OC-768/STM-256",
            "OC-1920/STM-640",
            "OC-3840/STM-1234",
            "SFP (1GFC)",
            "SFP (2GFC)",
            "SFP (4GFC)",
            "SFP+ (8GFC)",
            "SFP+ (16GFC)",
            "SFP28 (32GFC)",
            "SFP+ (32GFC)",
            "QSFP+ (64GFC)",
            "SFP-DD (64GFC)",
            "SFP+ (64GFC)",
            "QSFP28 (128GFC)",
            "SDR (2 Gbps)",
            "DDR (4 Gbps)",
            "QDR (8 Gbps)",
            "FDR10 (10 Gbps)",
            "FDR (13.5 Gbps)",
            "EDR (25 Gbps)",
            "HDR (50 Gbps)",
            "NDR (100 Gbps)",
            "XDR (250 Gbps)",
            "T1 (1.544 Mbps)",
            "E1 (2.048 Mbps)",
            "T3 (45 Mbps)",
            "E3 (34 Mbps)",
            "xDSL",
            "DOCSIS",
            "MoCA",
            "BPON (622 Mbps / 155 Mbps)",
            "EPON (1 Gbps)",
            "10G-EPON (10 Gbps)",
            "GPON (2.5 Gbps / 1.25 Gbps)",
            "XG-PON (10 Gbps / 2.5 Gbps)",
            "XGS-PON (10 Gbps)",
            "NG-PON2 (TWDM-PON) (4x10 Gbps)",
            "25G-PON (25 Gbps)",
            "50G-PON (50 Gbps)",
            "Cisco StackWise",
            "Cisco StackWise Plus",
            "Cisco FlexStack",
            "Cisco FlexStack Plus",
            "Cisco StackWise-80",
            "Cisco StackWise-160",
            "Cisco StackWise-320",
            "Cisco StackWise-480",
            "Cisco StackWise-1T",
            "Juniper VCP",
            "Extreme SummitStack",
            "Extreme SummitStack-128",
            "Extreme SummitStack-256",
            "Extreme SummitStack-512",
            "Other",
        ]
        | None
    ) = None


class SpeedKbps(RootModel[conint(ge=0, le=2147483647) | None]):
    root: conint(ge=0, le=2147483647) | None = Field(None, title="Speed (Kbps)")


class Duplex(BaseModel):
    value: Literal["half", "full", "auto", ""] | None = Field(
        None, description="* `half` - Half\n* `full` - Full\n* `auto` - Auto"
    )
    label: Literal["Half", "Full", "Auto"] | None = None


class ManagementOnly(RootModel[bool]):
    root: bool = Field(
        ...,
        description="This interface is used only for out-of-band management",
        title="Management only",
    )


class Mode2(BaseModel):
    value: Literal["access", "tagged", "tagged-all", "q-in-q", ""] | None = Field(
        None,
        description="* `access` - Access\n* `tagged` - Tagged\n* `tagged-all` - Tagged (All)\n* `q-in-q` - Q-in-Q (802.1ad)",
    )
    label: Literal["Access", "Tagged", "Tagged (All)", "Q-in-Q (802.1ad)"] | None = None


class RfRole(BaseModel):
    value: Literal["ap", "station", ""] | None = Field(
        None, description="* `ap` - Access point\n* `station` - Station"
    )
    label: Literal["Access point", "Station"] | None = None


class RfChannel(BaseModel):
    value: (
        Literal[
            "2.4g-1-2412-22",
            "2.4g-2-2417-22",
            "2.4g-3-2422-22",
            "2.4g-4-2427-22",
            "2.4g-5-2432-22",
            "2.4g-6-2437-22",
            "2.4g-7-2442-22",
            "2.4g-8-2447-22",
            "2.4g-9-2452-22",
            "2.4g-10-2457-22",
            "2.4g-11-2462-22",
            "2.4g-12-2467-22",
            "2.4g-13-2472-22",
            "5g-32-5160-20",
            "5g-34-5170-40",
            "5g-36-5180-20",
            "5g-38-5190-40",
            "5g-40-5200-20",
            "5g-42-5210-80",
            "5g-44-5220-20",
            "5g-46-5230-40",
            "5g-48-5240-20",
            "5g-50-5250-160",
            "5g-52-5260-20",
            "5g-54-5270-40",
            "5g-56-5280-20",
            "5g-58-5290-80",
            "5g-60-5300-20",
            "5g-62-5310-40",
            "5g-64-5320-20",
            "5g-100-5500-20",
            "5g-102-5510-40",
            "5g-104-5520-20",
            "5g-106-5530-80",
            "5g-108-5540-20",
            "5g-110-5550-40",
            "5g-112-5560-20",
            "5g-114-5570-160",
            "5g-116-5580-20",
            "5g-118-5590-40",
            "5g-120-5600-20",
            "5g-122-5610-80",
            "5g-124-5620-20",
            "5g-126-5630-40",
            "5g-128-5640-20",
            "5g-132-5660-20",
            "5g-134-5670-40",
            "5g-136-5680-20",
            "5g-138-5690-80",
            "5g-140-5700-20",
            "5g-142-5710-40",
            "5g-144-5720-20",
            "5g-149-5745-20",
            "5g-151-5755-40",
            "5g-153-5765-20",
            "5g-155-5775-80",
            "5g-157-5785-20",
            "5g-159-5795-40",
            "5g-161-5805-20",
            "5g-163-5815-160",
            "5g-165-5825-20",
            "5g-167-5835-40",
            "5g-169-5845-20",
            "5g-171-5855-80",
            "5g-173-5865-20",
            "5g-175-5875-40",
            "5g-177-5885-20",
            "6g-1-5955-20",
            "6g-3-5965-40",
            "6g-5-5975-20",
            "6g-7-5985-80",
            "6g-9-5995-20",
            "6g-11-6005-40",
            "6g-13-6015-20",
            "6g-15-6025-160",
            "6g-17-6035-20",
            "6g-19-6045-40",
            "6g-21-6055-20",
            "6g-23-6065-80",
            "6g-25-6075-20",
            "6g-27-6085-40",
            "6g-29-6095-20",
            "6g-31-6105-320",
            "6g-33-6115-20",
            "6g-35-6125-40",
            "6g-37-6135-20",
            "6g-39-6145-80",
            "6g-41-6155-20",
            "6g-43-6165-40",
            "6g-45-6175-20",
            "6g-47-6185-160",
            "6g-49-6195-20",
            "6g-51-6205-40",
            "6g-53-6215-20",
            "6g-55-6225-80",
            "6g-57-6235-20",
            "6g-59-6245-40",
            "6g-61-6255-20",
            "6g-65-6275-20",
            "6g-67-6285-40",
            "6g-69-6295-20",
            "6g-71-6305-80",
            "6g-73-6315-20",
            "6g-75-6325-40",
            "6g-77-6335-20",
            "6g-79-6345-160",
            "6g-81-6355-20",
            "6g-83-6365-40",
            "6g-85-6375-20",
            "6g-87-6385-80",
            "6g-89-6395-20",
            "6g-91-6405-40",
            "6g-93-6415-20",
            "6g-95-6425-320",
            "6g-97-6435-20",
            "6g-99-6445-40",
            "6g-101-6455-20",
            "6g-103-6465-80",
            "6g-105-6475-20",
            "6g-107-6485-40",
            "6g-109-6495-20",
            "6g-111-6505-160",
            "6g-113-6515-20",
            "6g-115-6525-40",
            "6g-117-6535-20",
            "6g-119-6545-80",
            "6g-121-6555-20",
            "6g-123-6565-40",
            "6g-125-6575-20",
            "6g-129-6595-20",
            "6g-131-6605-40",
            "6g-133-6615-20",
            "6g-135-6625-80",
            "6g-137-6635-20",
            "6g-139-6645-40",
            "6g-141-6655-20",
            "6g-143-6665-160",
            "6g-145-6675-20",
            "6g-147-6685-40",
            "6g-149-6695-20",
            "6g-151-6705-80",
            "6g-153-6715-20",
            "6g-155-6725-40",
            "6g-157-6735-20",
            "6g-159-6745-320",
            "6g-161-6755-20",
            "6g-163-6765-40",
            "6g-165-6775-20",
            "6g-167-6785-80",
            "6g-169-6795-20",
            "6g-171-6805-40",
            "6g-173-6815-20",
            "6g-175-6825-160",
            "6g-177-6835-20",
            "6g-179-6845-40",
            "6g-181-6855-20",
            "6g-183-6865-80",
            "6g-185-6875-20",
            "6g-187-6885-40",
            "6g-189-6895-20",
            "6g-193-6915-20",
            "6g-195-6925-40",
            "6g-197-6935-20",
            "6g-199-6945-80",
            "6g-201-6955-20",
            "6g-203-6965-40",
            "6g-205-6975-20",
            "6g-207-6985-160",
            "6g-209-6995-20",
            "6g-211-7005-40",
            "6g-213-7015-20",
            "6g-215-7025-80",
            "6g-217-7035-20",
            "6g-219-7045-40",
            "6g-221-7055-20",
            "6g-225-7075-20",
            "6g-227-7085-40",
            "6g-229-7095-20",
            "6g-233-7115-20",
            "60g-1-58320-2160",
            "60g-2-60480-2160",
            "60g-3-62640-2160",
            "60g-4-64800-2160",
            "60g-5-66960-2160",
            "60g-6-69120-2160",
            "60g-9-59400-4320",
            "60g-10-61560-4320",
            "60g-11-63720-4320",
            "60g-12-65880-4320",
            "60g-13-68040-4320",
            "60g-17-60480-6480",
            "60g-18-62640-6480",
            "60g-19-64800-6480",
            "60g-20-66960-6480",
            "60g-25-61560-6480",
            "60g-26-63720-6480",
            "60g-27-65880-6480",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `2.4g-1-2412-22` - 1 (2412 MHz)\n* `2.4g-2-2417-22` - 2 (2417 MHz)\n* `2.4g-3-2422-22` - 3 (2422 MHz)\n* `2.4g-4-2427-22` - 4 (2427 MHz)\n* `2.4g-5-2432-22` - 5 (2432 MHz)\n* `2.4g-6-2437-22` - 6 (2437 MHz)\n* `2.4g-7-2442-22` - 7 (2442 MHz)\n* `2.4g-8-2447-22` - 8 (2447 MHz)\n* `2.4g-9-2452-22` - 9 (2452 MHz)\n* `2.4g-10-2457-22` - 10 (2457 MHz)\n* `2.4g-11-2462-22` - 11 (2462 MHz)\n* `2.4g-12-2467-22` - 12 (2467 MHz)\n* `2.4g-13-2472-22` - 13 (2472 MHz)\n* `5g-32-5160-20` - 32 (5160/20 MHz)\n* `5g-34-5170-40` - 34 (5170/40 MHz)\n* `5g-36-5180-20` - 36 (5180/20 MHz)\n* `5g-38-5190-40` - 38 (5190/40 MHz)\n* `5g-40-5200-20` - 40 (5200/20 MHz)\n* `5g-42-5210-80` - 42 (5210/80 MHz)\n* `5g-44-5220-20` - 44 (5220/20 MHz)\n* `5g-46-5230-40` - 46 (5230/40 MHz)\n* `5g-48-5240-20` - 48 (5240/20 MHz)\n* `5g-50-5250-160` - 50 (5250/160 MHz)\n* `5g-52-5260-20` - 52 (5260/20 MHz)\n* `5g-54-5270-40` - 54 (5270/40 MHz)\n* `5g-56-5280-20` - 56 (5280/20 MHz)\n* `5g-58-5290-80` - 58 (5290/80 MHz)\n* `5g-60-5300-20` - 60 (5300/20 MHz)\n* `5g-62-5310-40` - 62 (5310/40 MHz)\n* `5g-64-5320-20` - 64 (5320/20 MHz)\n* `5g-100-5500-20` - 100 (5500/20 MHz)\n* `5g-102-5510-40` - 102 (5510/40 MHz)\n* `5g-104-5520-20` - 104 (5520/20 MHz)\n* `5g-106-5530-80` - 106 (5530/80 MHz)\n* `5g-108-5540-20` - 108 (5540/20 MHz)\n* `5g-110-5550-40` - 110 (5550/40 MHz)\n* `5g-112-5560-20` - 112 (5560/20 MHz)\n* `5g-114-5570-160` - 114 (5570/160 MHz)\n* `5g-116-5580-20` - 116 (5580/20 MHz)\n* `5g-118-5590-40` - 118 (5590/40 MHz)\n* `5g-120-5600-20` - 120 (5600/20 MHz)\n* `5g-122-5610-80` - 122 (5610/80 MHz)\n* `5g-124-5620-20` - 124 (5620/20 MHz)\n* `5g-126-5630-40` - 126 (5630/40 MHz)\n* `5g-128-5640-20` - 128 (5640/20 MHz)\n* `5g-132-5660-20` - 132 (5660/20 MHz)\n* `5g-134-5670-40` - 134 (5670/40 MHz)\n* `5g-136-5680-20` - 136 (5680/20 MHz)\n* `5g-138-5690-80` - 138 (5690/80 MHz)\n* `5g-140-5700-20` - 140 (5700/20 MHz)\n* `5g-142-5710-40` - 142 (5710/40 MHz)\n* `5g-144-5720-20` - 144 (5720/20 MHz)\n* `5g-149-5745-20` - 149 (5745/20 MHz)\n* `5g-151-5755-40` - 151 (5755/40 MHz)\n* `5g-153-5765-20` - 153 (5765/20 MHz)\n* `5g-155-5775-80` - 155 (5775/80 MHz)\n* `5g-157-5785-20` - 157 (5785/20 MHz)\n* `5g-159-5795-40` - 159 (5795/40 MHz)\n* `5g-161-5805-20` - 161 (5805/20 MHz)\n* `5g-163-5815-160` - 163 (5815/160 MHz)\n* `5g-165-5825-20` - 165 (5825/20 MHz)\n* `5g-167-5835-40` - 167 (5835/40 MHz)\n* `5g-169-5845-20` - 169 (5845/20 MHz)\n* `5g-171-5855-80` - 171 (5855/80 MHz)\n* `5g-173-5865-20` - 173 (5865/20 MHz)\n* `5g-175-5875-40` - 175 (5875/40 MHz)\n* `5g-177-5885-20` - 177 (5885/20 MHz)\n* `6g-1-5955-20` - 1 (5955/20 MHz)\n* `6g-3-5965-40` - 3 (5965/40 MHz)\n* `6g-5-5975-20` - 5 (5975/20 MHz)\n* `6g-7-5985-80` - 7 (5985/80 MHz)\n* `6g-9-5995-20` - 9 (5995/20 MHz)\n* `6g-11-6005-40` - 11 (6005/40 MHz)\n* `6g-13-6015-20` - 13 (6015/20 MHz)\n* `6g-15-6025-160` - 15 (6025/160 MHz)\n* `6g-17-6035-20` - 17 (6035/20 MHz)\n* `6g-19-6045-40` - 19 (6045/40 MHz)\n* `6g-21-6055-20` - 21 (6055/20 MHz)\n* `6g-23-6065-80` - 23 (6065/80 MHz)\n* `6g-25-6075-20` - 25 (6075/20 MHz)\n* `6g-27-6085-40` - 27 (6085/40 MHz)\n* `6g-29-6095-20` - 29 (6095/20 MHz)\n* `6g-31-6105-320` - 31 (6105/320 MHz)\n* `6g-33-6115-20` - 33 (6115/20 MHz)\n* `6g-35-6125-40` - 35 (6125/40 MHz)\n* `6g-37-6135-20` - 37 (6135/20 MHz)\n* `6g-39-6145-80` - 39 (6145/80 MHz)\n* `6g-41-6155-20` - 41 (6155/20 MHz)\n* `6g-43-6165-40` - 43 (6165/40 MHz)\n* `6g-45-6175-20` - 45 (6175/20 MHz)\n* `6g-47-6185-160` - 47 (6185/160 MHz)\n* `6g-49-6195-20` - 49 (6195/20 MHz)\n* `6g-51-6205-40` - 51 (6205/40 MHz)\n* `6g-53-6215-20` - 53 (6215/20 MHz)\n* `6g-55-6225-80` - 55 (6225/80 MHz)\n* `6g-57-6235-20` - 57 (6235/20 MHz)\n* `6g-59-6245-40` - 59 (6245/40 MHz)\n* `6g-61-6255-20` - 61 (6255/20 MHz)\n* `6g-65-6275-20` - 65 (6275/20 MHz)\n* `6g-67-6285-40` - 67 (6285/40 MHz)\n* `6g-69-6295-20` - 69 (6295/20 MHz)\n* `6g-71-6305-80` - 71 (6305/80 MHz)\n* `6g-73-6315-20` - 73 (6315/20 MHz)\n* `6g-75-6325-40` - 75 (6325/40 MHz)\n* `6g-77-6335-20` - 77 (6335/20 MHz)\n* `6g-79-6345-160` - 79 (6345/160 MHz)\n* `6g-81-6355-20` - 81 (6355/20 MHz)\n* `6g-83-6365-40` - 83 (6365/40 MHz)\n* `6g-85-6375-20` - 85 (6375/20 MHz)\n* `6g-87-6385-80` - 87 (6385/80 MHz)\n* `6g-89-6395-20` - 89 (6395/20 MHz)\n* `6g-91-6405-40` - 91 (6405/40 MHz)\n* `6g-93-6415-20` - 93 (6415/20 MHz)\n* `6g-95-6425-320` - 95 (6425/320 MHz)\n* `6g-97-6435-20` - 97 (6435/20 MHz)\n* `6g-99-6445-40` - 99 (6445/40 MHz)\n* `6g-101-6455-20` - 101 (6455/20 MHz)\n* `6g-103-6465-80` - 103 (6465/80 MHz)\n* `6g-105-6475-20` - 105 (6475/20 MHz)\n* `6g-107-6485-40` - 107 (6485/40 MHz)\n* `6g-109-6495-20` - 109 (6495/20 MHz)\n* `6g-111-6505-160` - 111 (6505/160 MHz)\n* `6g-113-6515-20` - 113 (6515/20 MHz)\n* `6g-115-6525-40` - 115 (6525/40 MHz)\n* `6g-117-6535-20` - 117 (6535/20 MHz)\n* `6g-119-6545-80` - 119 (6545/80 MHz)\n* `6g-121-6555-20` - 121 (6555/20 MHz)\n* `6g-123-6565-40` - 123 (6565/40 MHz)\n* `6g-125-6575-20` - 125 (6575/20 MHz)\n* `6g-129-6595-20` - 129 (6595/20 MHz)\n* `6g-131-6605-40` - 131 (6605/40 MHz)\n* `6g-133-6615-20` - 133 (6615/20 MHz)\n* `6g-135-6625-80` - 135 (6625/80 MHz)\n* `6g-137-6635-20` - 137 (6635/20 MHz)\n* `6g-139-6645-40` - 139 (6645/40 MHz)\n* `6g-141-6655-20` - 141 (6655/20 MHz)\n* `6g-143-6665-160` - 143 (6665/160 MHz)\n* `6g-145-6675-20` - 145 (6675/20 MHz)\n* `6g-147-6685-40` - 147 (6685/40 MHz)\n* `6g-149-6695-20` - 149 (6695/20 MHz)\n* `6g-151-6705-80` - 151 (6705/80 MHz)\n* `6g-153-6715-20` - 153 (6715/20 MHz)\n* `6g-155-6725-40` - 155 (6725/40 MHz)\n* `6g-157-6735-20` - 157 (6735/20 MHz)\n* `6g-159-6745-320` - 159 (6745/320 MHz)\n* `6g-161-6755-20` - 161 (6755/20 MHz)\n* `6g-163-6765-40` - 163 (6765/40 MHz)\n* `6g-165-6775-20` - 165 (6775/20 MHz)\n* `6g-167-6785-80` - 167 (6785/80 MHz)\n* `6g-169-6795-20` - 169 (6795/20 MHz)\n* `6g-171-6805-40` - 171 (6805/40 MHz)\n* `6g-173-6815-20` - 173 (6815/20 MHz)\n* `6g-175-6825-160` - 175 (6825/160 MHz)\n* `6g-177-6835-20` - 177 (6835/20 MHz)\n* `6g-179-6845-40` - 179 (6845/40 MHz)\n* `6g-181-6855-20` - 181 (6855/20 MHz)\n* `6g-183-6865-80` - 183 (6865/80 MHz)\n* `6g-185-6875-20` - 185 (6875/20 MHz)\n* `6g-187-6885-40` - 187 (6885/40 MHz)\n* `6g-189-6895-20` - 189 (6895/20 MHz)\n* `6g-193-6915-20` - 193 (6915/20 MHz)\n* `6g-195-6925-40` - 195 (6925/40 MHz)\n* `6g-197-6935-20` - 197 (6935/20 MHz)\n* `6g-199-6945-80` - 199 (6945/80 MHz)\n* `6g-201-6955-20` - 201 (6955/20 MHz)\n* `6g-203-6965-40` - 203 (6965/40 MHz)\n* `6g-205-6975-20` - 205 (6975/20 MHz)\n* `6g-207-6985-160` - 207 (6985/160 MHz)\n* `6g-209-6995-20` - 209 (6995/20 MHz)\n* `6g-211-7005-40` - 211 (7005/40 MHz)\n* `6g-213-7015-20` - 213 (7015/20 MHz)\n* `6g-215-7025-80` - 215 (7025/80 MHz)\n* `6g-217-7035-20` - 217 (7035/20 MHz)\n* `6g-219-7045-40` - 219 (7045/40 MHz)\n* `6g-221-7055-20` - 221 (7055/20 MHz)\n* `6g-225-7075-20` - 225 (7075/20 MHz)\n* `6g-227-7085-40` - 227 (7085/40 MHz)\n* `6g-229-7095-20` - 229 (7095/20 MHz)\n* `6g-233-7115-20` - 233 (7115/20 MHz)\n* `60g-1-58320-2160` - 1 (58.32/2.16 GHz)\n* `60g-2-60480-2160` - 2 (60.48/2.16 GHz)\n* `60g-3-62640-2160` - 3 (62.64/2.16 GHz)\n* `60g-4-64800-2160` - 4 (64.80/2.16 GHz)\n* `60g-5-66960-2160` - 5 (66.96/2.16 GHz)\n* `60g-6-69120-2160` - 6 (69.12/2.16 GHz)\n* `60g-9-59400-4320` - 9 (59.40/4.32 GHz)\n* `60g-10-61560-4320` - 10 (61.56/4.32 GHz)\n* `60g-11-63720-4320` - 11 (63.72/4.32 GHz)\n* `60g-12-65880-4320` - 12 (65.88/4.32 GHz)\n* `60g-13-68040-4320` - 13 (68.04/4.32 GHz)\n* `60g-17-60480-6480` - 17 (60.48/6.48 GHz)\n* `60g-18-62640-6480` - 18 (62.64/6.48 GHz)\n* `60g-19-64800-6480` - 19 (64.80/6.48 GHz)\n* `60g-20-66960-6480` - 20 (66.96/6.48 GHz)\n* `60g-25-61560-6480` - 25 (61.56/8.64 GHz)\n* `60g-26-63720-6480` - 26 (63.72/8.64 GHz)\n* `60g-27-65880-6480` - 27 (65.88/8.64 GHz)",
    )
    label: (
        Literal[
            "1 (2412 MHz)",
            "2 (2417 MHz)",
            "3 (2422 MHz)",
            "4 (2427 MHz)",
            "5 (2432 MHz)",
            "6 (2437 MHz)",
            "7 (2442 MHz)",
            "8 (2447 MHz)",
            "9 (2452 MHz)",
            "10 (2457 MHz)",
            "11 (2462 MHz)",
            "12 (2467 MHz)",
            "13 (2472 MHz)",
            "32 (5160/20 MHz)",
            "34 (5170/40 MHz)",
            "36 (5180/20 MHz)",
            "38 (5190/40 MHz)",
            "40 (5200/20 MHz)",
            "42 (5210/80 MHz)",
            "44 (5220/20 MHz)",
            "46 (5230/40 MHz)",
            "48 (5240/20 MHz)",
            "50 (5250/160 MHz)",
            "52 (5260/20 MHz)",
            "54 (5270/40 MHz)",
            "56 (5280/20 MHz)",
            "58 (5290/80 MHz)",
            "60 (5300/20 MHz)",
            "62 (5310/40 MHz)",
            "64 (5320/20 MHz)",
            "100 (5500/20 MHz)",
            "102 (5510/40 MHz)",
            "104 (5520/20 MHz)",
            "106 (5530/80 MHz)",
            "108 (5540/20 MHz)",
            "110 (5550/40 MHz)",
            "112 (5560/20 MHz)",
            "114 (5570/160 MHz)",
            "116 (5580/20 MHz)",
            "118 (5590/40 MHz)",
            "120 (5600/20 MHz)",
            "122 (5610/80 MHz)",
            "124 (5620/20 MHz)",
            "126 (5630/40 MHz)",
            "128 (5640/20 MHz)",
            "132 (5660/20 MHz)",
            "134 (5670/40 MHz)",
            "136 (5680/20 MHz)",
            "138 (5690/80 MHz)",
            "140 (5700/20 MHz)",
            "142 (5710/40 MHz)",
            "144 (5720/20 MHz)",
            "149 (5745/20 MHz)",
            "151 (5755/40 MHz)",
            "153 (5765/20 MHz)",
            "155 (5775/80 MHz)",
            "157 (5785/20 MHz)",
            "159 (5795/40 MHz)",
            "161 (5805/20 MHz)",
            "163 (5815/160 MHz)",
            "165 (5825/20 MHz)",
            "167 (5835/40 MHz)",
            "169 (5845/20 MHz)",
            "171 (5855/80 MHz)",
            "173 (5865/20 MHz)",
            "175 (5875/40 MHz)",
            "177 (5885/20 MHz)",
            "1 (5955/20 MHz)",
            "3 (5965/40 MHz)",
            "5 (5975/20 MHz)",
            "7 (5985/80 MHz)",
            "9 (5995/20 MHz)",
            "11 (6005/40 MHz)",
            "13 (6015/20 MHz)",
            "15 (6025/160 MHz)",
            "17 (6035/20 MHz)",
            "19 (6045/40 MHz)",
            "21 (6055/20 MHz)",
            "23 (6065/80 MHz)",
            "25 (6075/20 MHz)",
            "27 (6085/40 MHz)",
            "29 (6095/20 MHz)",
            "31 (6105/320 MHz)",
            "33 (6115/20 MHz)",
            "35 (6125/40 MHz)",
            "37 (6135/20 MHz)",
            "39 (6145/80 MHz)",
            "41 (6155/20 MHz)",
            "43 (6165/40 MHz)",
            "45 (6175/20 MHz)",
            "47 (6185/160 MHz)",
            "49 (6195/20 MHz)",
            "51 (6205/40 MHz)",
            "53 (6215/20 MHz)",
            "55 (6225/80 MHz)",
            "57 (6235/20 MHz)",
            "59 (6245/40 MHz)",
            "61 (6255/20 MHz)",
            "65 (6275/20 MHz)",
            "67 (6285/40 MHz)",
            "69 (6295/20 MHz)",
            "71 (6305/80 MHz)",
            "73 (6315/20 MHz)",
            "75 (6325/40 MHz)",
            "77 (6335/20 MHz)",
            "79 (6345/160 MHz)",
            "81 (6355/20 MHz)",
            "83 (6365/40 MHz)",
            "85 (6375/20 MHz)",
            "87 (6385/80 MHz)",
            "89 (6395/20 MHz)",
            "91 (6405/40 MHz)",
            "93 (6415/20 MHz)",
            "95 (6425/320 MHz)",
            "97 (6435/20 MHz)",
            "99 (6445/40 MHz)",
            "101 (6455/20 MHz)",
            "103 (6465/80 MHz)",
            "105 (6475/20 MHz)",
            "107 (6485/40 MHz)",
            "109 (6495/20 MHz)",
            "111 (6505/160 MHz)",
            "113 (6515/20 MHz)",
            "115 (6525/40 MHz)",
            "117 (6535/20 MHz)",
            "119 (6545/80 MHz)",
            "121 (6555/20 MHz)",
            "123 (6565/40 MHz)",
            "125 (6575/20 MHz)",
            "129 (6595/20 MHz)",
            "131 (6605/40 MHz)",
            "133 (6615/20 MHz)",
            "135 (6625/80 MHz)",
            "137 (6635/20 MHz)",
            "139 (6645/40 MHz)",
            "141 (6655/20 MHz)",
            "143 (6665/160 MHz)",
            "145 (6675/20 MHz)",
            "147 (6685/40 MHz)",
            "149 (6695/20 MHz)",
            "151 (6705/80 MHz)",
            "153 (6715/20 MHz)",
            "155 (6725/40 MHz)",
            "157 (6735/20 MHz)",
            "159 (6745/320 MHz)",
            "161 (6755/20 MHz)",
            "163 (6765/40 MHz)",
            "165 (6775/20 MHz)",
            "167 (6785/80 MHz)",
            "169 (6795/20 MHz)",
            "171 (6805/40 MHz)",
            "173 (6815/20 MHz)",
            "175 (6825/160 MHz)",
            "177 (6835/20 MHz)",
            "179 (6845/40 MHz)",
            "181 (6855/20 MHz)",
            "183 (6865/80 MHz)",
            "185 (6875/20 MHz)",
            "187 (6885/40 MHz)",
            "189 (6895/20 MHz)",
            "193 (6915/20 MHz)",
            "195 (6925/40 MHz)",
            "197 (6935/20 MHz)",
            "199 (6945/80 MHz)",
            "201 (6955/20 MHz)",
            "203 (6965/40 MHz)",
            "205 (6975/20 MHz)",
            "207 (6985/160 MHz)",
            "209 (6995/20 MHz)",
            "211 (7005/40 MHz)",
            "213 (7015/20 MHz)",
            "215 (7025/80 MHz)",
            "217 (7035/20 MHz)",
            "219 (7045/40 MHz)",
            "221 (7055/20 MHz)",
            "225 (7075/20 MHz)",
            "227 (7085/40 MHz)",
            "229 (7095/20 MHz)",
            "233 (7115/20 MHz)",
            "1 (58.32/2.16 GHz)",
            "2 (60.48/2.16 GHz)",
            "3 (62.64/2.16 GHz)",
            "4 (64.80/2.16 GHz)",
            "5 (66.96/2.16 GHz)",
            "6 (69.12/2.16 GHz)",
            "9 (59.40/4.32 GHz)",
            "10 (61.56/4.32 GHz)",
            "11 (63.72/4.32 GHz)",
            "12 (65.88/4.32 GHz)",
            "13 (68.04/4.32 GHz)",
            "17 (60.48/6.48 GHz)",
            "18 (62.64/6.48 GHz)",
            "19 (64.80/6.48 GHz)",
            "20 (66.96/6.48 GHz)",
            "25 (61.56/8.64 GHz)",
            "26 (63.72/8.64 GHz)",
            "27 (65.88/8.64 GHz)",
        ]
        | None
    ) = None


class PoeMode(BaseModel):
    value: Literal["pd", "pse", ""] | None = Field(None, description="* `pd` - PD\n* `pse` - PSE")
    label: Literal["PD", "PSE"] | None = None


class PoeType(BaseModel):
    value: (
        Literal[
            "type1-ieee802.3af",
            "type2-ieee802.3at",
            "type3-ieee802.3bt",
            "type4-ieee802.3bt",
            "passive-24v-2pair",
            "passive-24v-4pair",
            "passive-48v-2pair",
            "passive-48v-4pair",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `type1-ieee802.3af` - 802.3af (Type 1)\n* `type2-ieee802.3at` - 802.3at (Type 2)\n* `type3-ieee802.3bt` - 802.3bt (Type 3)\n* `type4-ieee802.3bt` - 802.3bt (Type 4)\n* `passive-24v-2pair` - Passive 24V (2-pair)\n* `passive-24v-4pair` - Passive 24V (4-pair)\n* `passive-48v-2pair` - Passive 48V (2-pair)\n* `passive-48v-4pair` - Passive 48V (4-pair)",
    )
    label: (
        Literal[
            "802.3af (Type 1)",
            "802.3at (Type 2)",
            "802.3bt (Type 3)",
            "802.3bt (Type 4)",
            "Passive 24V (2-pair)",
            "Passive 24V (4-pair)",
            "Passive 48V (2-pair)",
            "Passive 48V (4-pair)",
        ]
        | None
    ) = None


class ChannelFrequencyMHz(RootModel[confloat(lt=100000.0, gt=-100000.0) | None]):
    root: confloat(lt=100000.0, gt=-100000.0) | None = Field(
        None,
        description="Populated by selected channel (if set)",
        title="Channel frequency (MHz)",
    )


class ChannelWidthMHz(RootModel[confloat(lt=10000.0, gt=-10000.0) | None]):
    root: confloat(lt=10000.0, gt=-10000.0) | None = Field(
        None,
        description="Populated by selected channel (if set)",
        title="Channel width (MHz)",
    )


class TransmitPowerDBm(RootModel[conint(ge=0, le=127) | None]):
    root: conint(ge=0, le=127) | None = Field(None, title="Transmit power (dBm)")


class ManagementOnly2(RootModel[bool]):
    root: bool = Field(..., title="Management only")


class Status9(BaseModel):
    value: Literal["offline", "active", "planned", "staged", "failed", "decommissioning"] | None = (
        Field(
            None,
            description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning",
        )
    )
    label: Literal["Offline", "Active", "Planned", "Staged", "Failed", "Decommissioning"] | None = (
        None
    )


class SerialNumber3(RootModel[constr(max_length=50)]):
    root: constr(max_length=50) = Field(..., title="Serial number")


class Status10(Status):
    pass


class Job(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    object_type: str
    object_id: conint(ge=0, le=9223372036854775807) | None = None
    name: constr(max_length=200)
    status: Status10
    created: AwareDatetime | None = None
    scheduled: AwareDatetime | None = None
    interval: conint(ge=1, le=2147483647) | None = Field(
        None, description="Recurrence interval (in minutes)"
    )
    started: AwareDatetime | None = None
    completed: AwareDatetime | None = None
    user: BriefUser
    data: Any | None = None
    error: str
    job_id: UUID


class Kind(BaseModel):
    value: Literal["info", "success", "warning", "danger"] | None = Field(
        None,
        description="* `info` - Info\n* `success` - Success\n* `warning` - Warning\n* `danger` - Danger",
    )
    label: Literal["Info", "Success", "Warning", "Danger"] | None = None


class Type11(Type):
    pass


class Status11(BaseModel):
    value: Literal["active", "planned", "decommissioning"] | None = Field(
        None,
        description="* `active` - Active\n* `planned` - Planned\n* `decommissioning` - Decommissioning",
    )
    label: Literal["Active", "Planned", "Decommissioning"] | None = None


class Status12(BaseModel):
    value: Literal["planned", "staging", "active", "decommissioning", "retired"] | None = Field(
        None,
        description="* `planned` - Planned\n* `staging` - Staging\n* `active` - Active\n* `decommissioning` - Decommissioning\n* `retired` - Retired",
    )
    label: Literal["Planned", "Staging", "Active", "Decommissioning", "Retired"] | None = None


class Status13(Status9):
    pass


class Airflow3(BaseModel):
    value: (
        Literal[
            "front-to-rear",
            "rear-to-front",
            "left-to-right",
            "right-to-left",
            "side-to-rear",
            "passive",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front\n* `left-to-right` - Left to right\n* `right-to-left` - Right to left\n* `side-to-rear` - Side to rear\n* `passive` - Passive",
    )
    label: (
        Literal[
            "Front to rear",
            "Rear to front",
            "Left to right",
            "Right to left",
            "Side to rear",
            "Passive",
        ]
        | None
    ) = None


class NestedContactGroup(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class NestedContactGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)


class NestedDevice(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=64) | None = None


class NestedDeviceRequest(BaseModel):
    name: constr(max_length=64) | None = None


class NestedDeviceRole(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)


class NestedDeviceRoleRequest(BriefCircuitGroupRequest):
    pass


class NestedGroup(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=150)


class NestedIPAddress(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    family: int
    address: str


class NestedIPAddressRequest(BaseModel):
    address: constr(min_length=1)


class NestedInterface(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: NestedDevice
    name: constr(max_length=64)
    cable: int | None = None
    field_occupied: FieldOccupied = Field(..., alias="_occupied", title=" occupied")


class NestedInterfaceRequest(BaseModel):
    name: constr(min_length=1, max_length=64)
    cable: int | None = None


class NestedInterfaceTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )


class NestedInterfaceTemplateRequest(BaseModel):
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )


class NestedLocation(NestedContactGroup):
    pass


class NestedLocationRequest(NestedContactGroupRequest):
    pass


class NestedModuleBay(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=64)


class NestedModuleBayRequest(BaseModel):
    name: constr(min_length=1, max_length=64)


class AccountID2(AccountID):
    pass


class NestedProviderAccount(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100) | None = None
    account: AccountID2 = Field(..., title="Account ID")


class NestedRegion(NestedContactGroup):
    pass


class NestedRegionRequest(NestedContactGroupRequest):
    pass


class NestedSiteGroup(NestedContactGroup):
    pass


class NestedSiteGroupRequest(NestedContactGroupRequest):
    pass


class NestedTag(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-\w]+$", max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None


class NestedTagRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-\w]+$", min_length=1, max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", min_length=1, max_length=6) | None = None


class NestedTenantGroup(NestedContactGroup):
    pass


class NestedTenantGroupRequest(NestedContactGroupRequest):
    pass


class NestedUser(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    username: constr(pattern=r"^[\w.@+-]+$", max_length=150) = Field(
        ...,
        description="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
    )


class NestedVLAN(BriefVLAN):
    pass


class NestedVLANRequest(BriefVLANRequest):
    pass


class NestedVMInterfaceRequest(NestedModuleBayRequest):
    pass


class NestedVirtualMachine(NestedModuleBay):
    pass


class NestedVirtualMachineRequest(NestedModuleBayRequest):
    pass


class NestedWirelessLANGroup(NestedContactGroup):
    pass


class NestedWirelessLANGroupRequest(NestedContactGroupRequest):
    pass


class NestedWirelessLink(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    ssid: constr(max_length=32) | None = None


class NestedWirelessLinkRequest(BaseModel):
    ssid: constr(max_length=32) | None = None


class Event(
    RootModel[
        Literal[
            "object_created",
            "object_updated",
            "object_deleted",
            "job_started",
            "job_completed",
            "job_failed",
            "job_errored",
        ]
    ]
):
    root: Literal[
        "object_created",
        "object_updated",
        "object_deleted",
        "job_started",
        "job_completed",
        "job_failed",
        "job_errored",
    ] = Field(
        ...,
        description="* `object_created` - Object created\n* `object_updated` - Object updated\n* `object_deleted` - Object deleted\n* `job_started` - Job started\n* `job_completed` - Job completed\n* `job_failed` - Job failed\n* `job_errored` - Job errored",
        title="Event",
    )


class Notification(BaseModel):
    id: int
    url: AnyUrl
    display: str
    object_type: str
    object_id: conint(ge=0, le=9223372036854775807)
    object: Any | None = None
    user: BriefUser
    created: AwareDatetime | None = None
    read: AwareDatetime | None = None
    event_type: Event = Field(
        ...,
        description="* `object_created` - Object created\n* `object_updated` - Object updated\n* `object_deleted` - Object deleted\n* `job_started` - Job started\n* `job_completed` - Job completed\n* `job_failed` - Job failed\n* `job_errored` - Job errored",
        title="Event",
    )


class NotificationGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    groups: list[int] | None = None
    users: list[int] | None = None


class NotificationRequest(BaseModel):
    object_type: str
    object_id: conint(ge=0, le=9223372036854775807)
    user: int | BriefUserRequest
    read: AwareDatetime | None = None
    event_type: Event = Field(
        ...,
        description="* `object_created` - Object created\n* `object_updated` - Object updated\n* `object_deleted` - Object deleted\n* `job_started` - Job started\n* `job_completed` - Job completed\n* `job_failed` - Job failed\n* `job_errored` - Job errored",
        title="Event",
    )


class Action(BaseModel):
    value: Literal["create", "update", "delete"] | None = Field(
        None,
        description="* `create` - Created\n* `update` - Updated\n* `delete` - Deleted",
    )
    label: Literal["Created", "Updated", "Deleted"] | None = None


class ObjectChange(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    time: AwareDatetime
    user: BriefUser
    user_name: str
    request_id: UUID
    action: Action
    changed_object_type: str
    changed_object_id: conint(ge=0, le=9223372036854775807)
    changed_object: Any | None = None
    prechange_data: Any | None = None
    postchange_data: Any | None = None


class ObjectPermission(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    enabled: bool | None = None
    object_types: list[str]
    actions: list[constr(max_length=30)] = Field(
        ..., description="The list of actions granted by this permission"
    )
    constraints: Any | None = Field(
        None,
        description="Queryset filter matching the applicable objects of the selected type(s)",
    )
    groups: list[NestedGroup] | None = None
    users: list[NestedUser] | None = None


class ObjectPermissionRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    enabled: bool | None = None
    object_types: list[str]
    actions: list[constr(min_length=1, max_length=30)] = Field(
        ..., description="The list of actions granted by this permission"
    )
    constraints: Any | None = Field(
        None,
        description="Queryset filter matching the applicable objects of the selected type(s)",
    )
    groups: list[int] | None = None
    users: list[int] | None = None


class PythonModelClassName(RootModel[constr(max_length=100)]):
    root: constr(max_length=100) = Field(..., title="Python model class name")


class ObjectType(BaseModel):
    id: int
    url: AnyUrl
    display: str
    app_label: constr(max_length=100)
    model: PythonModelClassName = Field(..., title="Python model class name")


class PaginatedCableTerminationList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[CableTermination]


class PaginatedCustomFieldChoiceSetList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[CustomFieldChoiceSet]


class PaginatedCustomFieldList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[CustomField]


class PaginatedCustomLinkList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[CustomLink]


class PaginatedDataFileList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[DataFile]


class PaginatedDataSourceList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[DataSource]


class PaginatedExportTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ExportTemplate]


class PaginatedFHRPGroupAssignmentList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[FHRPGroupAssignment]


class PaginatedImageAttachmentList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ImageAttachment]


class PaginatedJobList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Job]


class PaginatedNotificationList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Notification]


class PaginatedObjectChangeList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ObjectChange]


class PaginatedObjectPermissionList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ObjectPermission]


class PaginatedObjectTypeList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ObjectType]


class PatchedASNRangeRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    rir: int | BriefRIRRequest | None = None
    start: conint(ge=1, le=4294967295) | None = None
    end: conint(ge=1, le=4294967295) | None = None
    tenant: int | BriefTenantRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedASNRequest(BaseModel):
    asn: conint(ge=1, le=4294967295) | None = Field(
        None, description="16- or 32-bit autonomous system number"
    )
    rir: int | BriefRIRRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedBookmarkRequest(BaseModel):
    object_type: str | None = None
    object_id: conint(ge=0, le=9223372036854775807) | None = None
    user: int | BriefUserRequest | None = None


class PatchedCableTerminationRequest(BaseModel):
    cable: int | None = None
    cable_end: End | None = Field(None, description="* `A` - A\n* `B` - B", title="End")
    termination_type: str | None = None
    termination_id: conint(ge=0, le=9223372036854775807) | None = None


class PatchedCircuitGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    tenant: int | BriefTenantRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedCircuitTypeRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedClusterGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedClusterTypeRequest(PatchedClusterGroupRequest):
    pass


class PatchedConfigContextRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    weight: conint(ge=0, le=32767) | None = None
    description: constr(max_length=200) | None = None
    is_active: bool | None = None
    regions: list[int] | None = None
    site_groups: list[int] | None = None
    sites: list[int] | None = None
    locations: list[int] | None = None
    device_types: list[int] | None = None
    roles: list[int] | None = None
    platforms: list[int] | None = None
    cluster_types: list[int] | None = None
    cluster_groups: list[int] | None = None
    clusters: list[int] | None = None
    tenant_groups: list[int] | None = None
    tenants: list[int] | None = None
    tags: list[constr(min_length=1)] | None = None
    data_source: int | BriefDataSourceRequest | None = None
    data: Any | None = None


class PatchedConfigTemplateRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    environment_params: Any | None = Field(
        None,
        description='Any <a href="https://jinja.palletsprojects.com/en/stable/api/#jinja2.Environment">additional parameters</a> to pass when constructing the Jinja environment',
        title="Environment parameters",
    )
    template_code: constr(min_length=1) | None = Field(None, description="Jinja template code.")
    mime_type: constr(max_length=50) | None = Field(
        None, description="Defaults to <code>text/plain; charset=utf-8</code>"
    )
    file_name: constr(max_length=200) | None = Field(
        None, description="Filename to give to the rendered export file"
    )
    file_extension: constr(max_length=15) | None = Field(
        None, description="Extension to append to the rendered filename"
    )
    as_attachment: bool | None = Field(None, description="Download file as attachment")
    data_source: int | BriefDataSourceRequest | None = None
    tags: list[NestedTagRequest] | None = None


class PatchedContactRequest(BaseModel):
    groups: list[int] | None = None
    name: constr(min_length=1, max_length=100) | None = None
    title: constr(max_length=100) | None = None
    phone: constr(max_length=50) | None = None
    email: EmailStr | None = None
    address: constr(max_length=200) | None = None
    link: AnyUrl | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedContactRoleRequest(PatchedClusterGroupRequest):
    pass


class PatchedCustomLinkRequest(BaseModel):
    object_types: list[str] | None = None
    name: constr(min_length=1, max_length=100) | None = None
    enabled: bool | None = None
    link_text: constr(min_length=1) | None = Field(
        None, description="Jinja2 template code for link text"
    )
    link_url: constr(min_length=1) | None = Field(
        None, description="Jinja2 template code for link URL"
    )
    weight: conint(ge=0, le=32767) | None = None
    group_name: constr(max_length=50) | None = Field(
        None, description="Links with the same group will appear as a dropdown menu"
    )
    button_class: (
        Literal[
            "default",
            "blue",
            "indigo",
            "purple",
            "pink",
            "red",
            "orange",
            "yellow",
            "green",
            "teal",
            "cyan",
            "gray",
            "black",
            "white",
            "ghost-dark",
        ]
        | None
    ) = Field(
        None,
        description="The class of the first link in a group will be used for the dropdown button\n\n* `default` - Default\n* `blue` - Blue\n* `indigo` - Indigo\n* `purple` - Purple\n* `pink` - Pink\n* `red` - Red\n* `orange` - Orange\n* `yellow` - Yellow\n* `green` - Green\n* `teal` - Teal\n* `cyan` - Cyan\n* `gray` - Gray\n* `black` - Black\n* `white` - White\n* `ghost-dark` - Link",
    )
    new_window: bool | None = Field(None, description="Force link to open in a new window")


class PatchedDashboardRequest(Dashboard):
    pass


class PatchedDeviceBayRequest(BaseModel):
    device: int | BriefDeviceRequest | None = None
    name: constr(min_length=1, max_length=64) | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    description: constr(max_length=200) | None = None
    installed_device: int | BriefDeviceRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedExportTemplateRequest(BaseModel):
    object_types: list[str] | None = None
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    environment_params: Any | None = Field(
        None,
        description='Any <a href="https://jinja.palletsprojects.com/en/stable/api/#jinja2.Environment">additional parameters</a> to pass when constructing the Jinja environment',
        title="Environment parameters",
    )
    template_code: constr(min_length=1) | None = Field(None, description="Jinja template code.")
    mime_type: constr(max_length=50) | None = Field(
        None, description="Defaults to <code>text/plain; charset=utf-8</code>"
    )
    file_name: constr(max_length=200) | None = Field(
        None, description="Filename to give to the rendered export file"
    )
    file_extension: constr(max_length=15) | None = Field(
        None, description="Extension to append to the rendered filename"
    )
    as_attachment: bool | None = Field(None, description="Download file as attachment")
    data_source: int | BriefDataSourceRequest | None = None


class PatchedFHRPGroupAssignmentRequest(BaseModel):
    group: int | BriefFHRPGroupRequest | None = None
    interface_type: str | None = None
    interface_id: conint(ge=0, le=9223372036854775807) | None = None
    priority: conint(ge=0, le=255) | None = None


class PatchedFHRPGroupRequest(BaseModel):
    name: constr(max_length=100) | None = None
    protocol: Literal["vrrp2", "vrrp3", "carp", "clusterxl", "hsrp", "glbp", "other"] | None = (
        Field(
            None,
            description="* `vrrp2` - VRRPv2\n* `vrrp3` - VRRPv3\n* `carp` - CARP\n* `clusterxl` - ClusterXL\n* `hsrp` - HSRP\n* `glbp` - GLBP\n* `other` - Other",
        )
    )
    group_id: conint(ge=0, le=32767) | None = None
    auth_type: AuthenticationType | None = Field(
        None,
        description="* `plaintext` - Plaintext\n* `md5` - MD5",
        title="Authentication type",
    )
    auth_key: AuthenticationKey | None = Field(None, title="Authentication key")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=150) | None = None
    description: constr(max_length=200) | None = None
    permissions: list[int] | None = None


class PatchedImageAttachmentRequest(BaseModel):
    object_type: str | None = None
    object_id: conint(ge=0, le=9223372036854775807) | None = None
    name: constr(max_length=50) | None = None
    image: bytes | None = None


class PatchedInventoryItemRoleRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    color: constr(pattern=r"^[0-9a-f]{6}$", min_length=1, max_length=6) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedL2VPNTerminationRequest(BaseModel):
    l2vpn: int | BriefL2VPNRequest | None = None
    assigned_object_type: str | None = None
    assigned_object_id: conint(ge=0, le=9223372036854775807) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedMACAddressRequest(BaseModel):
    mac_address: str | None = None
    assigned_object_type: str | None = None
    assigned_object_id: conint(ge=0, le=9223372036854775807) | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedManufacturerRequest(PatchedClusterGroupRequest):
    pass


class PatchedModuleTypeProfileRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    schema_: Any | None = Field(None, alias="schema")
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedNotificationGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    groups: list[int] | None = None
    users: list[int] | None = None


class PatchedNotificationRequest(BaseModel):
    object_type: str | None = None
    object_id: conint(ge=0, le=9223372036854775807) | None = None
    user: int | BriefUserRequest | None = None
    read: AwareDatetime | None = None
    event_type: Event | None = Field(
        None,
        description="* `object_created` - Object created\n* `object_updated` - Object updated\n* `object_deleted` - Object deleted\n* `job_started` - Job started\n* `job_completed` - Job completed\n* `job_failed` - Job failed\n* `job_errored` - Job errored",
        title="Event",
    )


class PatchedObjectPermissionRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    enabled: bool | None = None
    object_types: list[str] | None = None
    actions: list[constr(min_length=1, max_length=30)] | None = Field(
        None, description="The list of actions granted by this permission"
    )
    constraints: Any | None = Field(
        None,
        description="Queryset filter matching the applicable objects of the selected type(s)",
    )
    groups: list[int] | None = None
    users: list[int] | None = None


class PatchedPlatformRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    manufacturer: int | BriefManufacturerRequest | None = None
    config_template: int | BriefConfigTemplateRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedPowerPanelRequest(BaseModel):
    site: int | BriefSiteRequest | None = None
    location: int | BriefLocationRequest | None = None
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class AccountID3(AccountID1):
    pass


class PatchedProviderAccountRequest(BaseModel):
    provider: int | BriefProviderRequest | None = None
    name: constr(max_length=100) | None = ""
    account: AccountID3 | None = Field(None, title="Account ID")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedProviderNetworkRequest(BaseModel):
    provider: int | BriefProviderRequest | None = None
    name: constr(min_length=1, max_length=100) | None = None
    service_id: constr(max_length=100) | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedProviderRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = Field(
        None, description="Full name of the provider"
    )
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    accounts: list[int] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    asns: list[int] | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Private(RootModel[bool]):
    root: bool = Field(
        ...,
        description="IP space managed by this RIR is considered private",
        title="Private",
    )


class PatchedRIRRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    is_private: Private | None = Field(
        None,
        description="IP space managed by this RIR is considered private",
        title="Private",
    )
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedRackReservationRequest(BaseModel):
    rack: int | BriefRackRequest | None = None
    units: list[conint(ge=0, le=32767)] | None = None
    user: int | BriefUserRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    description: constr(min_length=1, max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedRackRoleRequest(PatchedInventoryItemRoleRequest):
    pass


class PatchedRoleRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    weight: conint(ge=0, le=32767) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedRouteTargetRequest(BaseModel):
    name: constr(min_length=1, max_length=21) | None = Field(
        None, description="Route target value (formatted in accordance with RFC 4360)"
    )
    tenant: int | BriefTenantRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedSavedFilterRequest(BaseModel):
    object_types: list[str] | None = None
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    user: int | None = None
    weight: conint(ge=0, le=32767) | None = None
    enabled: bool | None = None
    shared: bool | None = None
    parameters: Any | None = None


class PatchedScriptInputRequest(BaseModel):
    data: Any | None = None
    commit: bool | None = None
    schedule_at: AwareDatetime | None = None
    interval: int | None = None


class PatchedSubscriptionRequest(PatchedBookmarkRequest):
    pass


class PatchedTableConfigRequest(BaseModel):
    object_type: str | None = None
    table: constr(min_length=1, max_length=100) | None = None
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    user: int | None = None
    weight: conint(ge=0, le=32767) | None = None
    enabled: bool | None = None
    shared: bool | None = None
    columns: list[constr(min_length=1, max_length=100)] | None = None
    ordering: list[constr(min_length=1, max_length=100)] | None = None


class PatchedTagRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-\w]+$", min_length=1, max_length=100) | None = None
    color: constr(pattern=r"^[0-9a-f]{6}$", min_length=1, max_length=6) | None = None
    description: constr(max_length=200) | None = None
    weight: conint(ge=0, le=32767) | None = None
    object_types: list[str] | None = None


class PatchedTenantRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    group: int | BriefTenantGroupRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedTokenRequest(BaseModel):
    user: int | BriefUserRequest | None = None
    expires: AwareDatetime | None = None
    last_used: AwareDatetime | None = None
    key: constr(min_length=40, max_length=40) | None = None
    write_enabled: bool | None = Field(
        None, description="Permit create/update/delete operations using this key"
    )
    description: constr(max_length=200) | None = None


class PatchedTunnelGroupRequest(PatchedClusterGroupRequest):
    pass


class EmailAddress(RootModel[EmailStr]):
    root: EmailStr = Field(..., title="Email address")


class StaffStatus(RootModel[bool]):
    root: bool = Field(
        ...,
        description="Designates whether the user can log into this admin site.",
        title="Staff status",
    )


class Active(RootModel[bool]):
    root: bool = Field(
        ...,
        description="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
        title="Active",
    )


class PatchedUserRequest(BaseModel):
    username: constr(pattern=r"^[\w.@+-]+$", min_length=1, max_length=150) | None = Field(
        None,
        description="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
    )
    password: constr(min_length=1, max_length=128) | None = None
    first_name: constr(max_length=150) | None = None
    last_name: constr(max_length=150) | None = None
    email: EmailAddress | None = Field(None, title="Email address")
    is_staff: StaffStatus | None = Field(
        None,
        description="Designates whether the user can log into this admin site.",
        title="Staff status",
    )
    is_active: Active | None = Field(
        None,
        description="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
        title="Active",
    )
    date_joined: AwareDatetime | None = None
    last_login: AwareDatetime | None = None
    groups: list[int] | None = None
    permissions: list[int] | None = None


class PatchedVLANGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    vid_ranges: list[IntegerRangeRequest] | None = None
    tenant: int | BriefTenantRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedVLANTranslationPolicyRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None


class LocalVLANID(RootModel[conint(ge=1, le=4094)]):
    root: conint(ge=1, le=4094) = Field(
        ..., description="Numeric VLAN ID (1-4094)", title="Local VLAN ID"
    )


class RemoteVLANID(RootModel[conint(ge=1, le=4094)]):
    root: conint(ge=1, le=4094) = Field(
        ..., description="Numeric VLAN ID (1-4094)", title="Remote VLAN ID"
    )


class PatchedVLANTranslationRuleRequest(BaseModel):
    policy: int | None = None
    local_vid: LocalVLANID | None = Field(
        None, description="Numeric VLAN ID (1-4094)", title="Local VLAN ID"
    )
    remote_vid: RemoteVLANID | None = Field(
        None, description="Numeric VLAN ID (1-4094)", title="Remote VLAN ID"
    )
    description: constr(max_length=200) | None = None


class EnforceUniqueSpace(RootModel[bool]):
    root: bool = Field(
        ...,
        description="Prevent duplicate prefixes/IP addresses within this VRF",
        title="Enforce unique space",
    )


class PatchedVRFRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    rd: RouteDistinguisher | None = Field(
        None,
        description="Unique route distinguisher (as defined in RFC 4364)",
        title="Route distinguisher",
    )
    tenant: int | BriefTenantRequest | None = None
    enforce_unique: EnforceUniqueSpace | None = Field(
        None,
        description="Prevent duplicate prefixes/IP addresses within this VRF",
        title="Enforce unique space",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    import_targets: list[int] | None = None
    export_targets: list[int] | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedVirtualCircuitTypeRequest(PatchedCircuitTypeRequest):
    pass


class SizeMB(RootModel[conint(ge=0, le=2147483647)]):
    root: conint(ge=0, le=2147483647) = Field(..., title="Size (MB)")


class PatchedVirtualDiskRequest(BaseModel):
    virtual_machine: int | BriefVirtualMachineRequest | None = None
    name: constr(min_length=1, max_length=64) | None = None
    description: constr(max_length=200) | None = None
    size: SizeMB | None = Field(None, title="Size (MB)")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class URL2(RootModel[constr(min_length=1, max_length=500)]):
    root: constr(min_length=1, max_length=500) = Field(
        ...,
        description="This URL will be called using the HTTP method defined when the webhook is called. Jinja2 template processing is supported with the same context as the request body.",
        title="URL",
    )


class PatchedWebhookRequest(BaseModel):
    name: constr(min_length=1, max_length=150) | None = None
    description: constr(max_length=200) | None = None
    payload_url: URL2 | None = Field(
        None,
        description="This URL will be called using the HTTP method defined when the webhook is called. Jinja2 template processing is supported with the same context as the request body.",
        title="URL",
    )
    http_method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] | None = Field(
        None,
        description="* `GET` - GET\n* `POST` - POST\n* `PUT` - PUT\n* `PATCH` - PATCH\n* `DELETE` - DELETE",
    )
    http_content_type: constr(min_length=1, max_length=100) | None = Field(
        None,
        description='The complete list of official content types is available <a href="https://www.iana.org/assignments/media-types/media-types.xhtml">here</a>.',
    )
    additional_headers: str | None = Field(
        None,
        description="User-supplied HTTP headers to be sent with the request in addition to the HTTP content type. Headers should be defined in the format <code>Name: Value</code>. Jinja2 template processing is supported with the same context as the request body (below).",
    )
    body_template: str | None = Field(
        None,
        description="Jinja2 template for a custom request body. If blank, a JSON object representing the change will be included. Available context data includes: <code>event</code>, <code>model</code>, <code>timestamp</code>, <code>username</code>, <code>request_id</code>, and <code>data</code>.",
    )
    secret: constr(max_length=255) | None = Field(
        None,
        description="When provided, the request will include a <code>X-Hook-Signature</code> header containing a HMAC hex digest of the payload body using the secret as the key. The secret is not transmitted in the request.",
    )
    ssl_verification: bool | None = Field(
        None, description="Enable SSL certificate verification. Disable with caution!"
    )
    ca_file_path: constr(max_length=4096) | None = Field(
        None,
        description="The specific CA certificate file to use for SSL verification. Leave blank to use the system defaults.",
    )
    custom_fields: dict[str, Any] | None = None
    tags: list[NestedTagRequest] | None = None


class PatchedWritableAggregateRequest(BaseModel):
    prefix: constr(min_length=1) | None = None
    rir: int | BriefRIRRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    date_added: date | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableCableRequest(BaseModel):
    type: (
        Literal[
            "cat3",
            "cat5",
            "cat5e",
            "cat6",
            "cat6a",
            "cat7",
            "cat7a",
            "cat8",
            "dac-active",
            "dac-passive",
            "mrj21-trunk",
            "coaxial",
            "mmf",
            "mmf-om1",
            "mmf-om2",
            "mmf-om3",
            "mmf-om4",
            "mmf-om5",
            "smf",
            "smf-os1",
            "smf-os2",
            "aoc",
            "usb",
            "power",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `cat3` - CAT3\n* `cat5` - CAT5\n* `cat5e` - CAT5e\n* `cat6` - CAT6\n* `cat6a` - CAT6a\n* `cat7` - CAT7\n* `cat7a` - CAT7a\n* `cat8` - CAT8\n* `dac-active` - Direct Attach Copper (Active)\n* `dac-passive` - Direct Attach Copper (Passive)\n* `mrj21-trunk` - MRJ21 Trunk\n* `coaxial` - Coaxial\n* `mmf` - Multimode Fiber\n* `mmf-om1` - Multimode Fiber (OM1)\n* `mmf-om2` - Multimode Fiber (OM2)\n* `mmf-om3` - Multimode Fiber (OM3)\n* `mmf-om4` - Multimode Fiber (OM4)\n* `mmf-om5` - Multimode Fiber (OM5)\n* `smf` - Singlemode Fiber\n* `smf-os1` - Singlemode Fiber (OS1)\n* `smf-os2` - Singlemode Fiber (OS2)\n* `aoc` - Active Optical Cabling (AOC)\n* `usb` - USB\n* `power` - Power",
    )
    a_terminations: list[GenericObjectRequest] | None = None
    b_terminations: list[GenericObjectRequest] | None = None
    status: Literal["connected", "planned", "decommissioning"] | None = Field(
        None,
        description="* `connected` - Connected\n* `planned` - Planned\n* `decommissioning` - Decommissioning",
    )
    tenant: int | BriefTenantRequest | None = None
    label: constr(max_length=100) | None = None
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    length: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    length_unit: Literal["km", "m", "cm", "mi", "ft", "in", ""] | None = Field(
        None,
        description="* `km` - Kilometers\n* `m` - Meters\n* `cm` - Centimeters\n* `mi` - Miles\n* `ft` - Feet\n* `in` - Inches",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableCircuitGroupAssignmentRequest(BaseModel):
    group: int | BriefCircuitGroupRequest | None = None
    member_type: str | None = None
    member_id: conint(ge=0, le=9223372036854775807) | None = None
    priority: Literal["primary", "secondary", "tertiary", "inactive", ""] | None = Field(
        None,
        description="* `primary` - Primary\n* `secondary` - Secondary\n* `tertiary` - Tertiary\n* `inactive` - Inactive",
    )
    tags: list[NestedTagRequest] | None = None


class PatchedWritableClusterRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    type: int | BriefClusterTypeRequest | None = None
    group: int | BriefClusterGroupRequest | None = None
    status: Literal["planned", "staging", "active", "decommissioning", "offline"] | None = Field(
        None,
        description="* `planned` - Planned\n* `staging` - Staging\n* `active` - Active\n* `decommissioning` - Decommissioning\n* `offline` - Offline",
    )
    tenant: int | BriefTenantRequest | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableContactAssignmentRequest(BaseModel):
    object_type: str | None = None
    object_id: conint(ge=0, le=9223372036854775807) | None = None
    contact: int | BriefContactRequest | None = None
    role: int | BriefContactRoleRequest | None = None
    priority: Literal["primary", "secondary", "tertiary", "inactive", ""] | None = Field(
        None,
        description="* `primary` - Primary\n* `secondary` - Secondary\n* `tertiary` - Tertiary\n* `inactive` - Inactive",
    )
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableContactGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    parent: int | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class PatchedWritableCustomFieldChoiceSetRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    base_choices: Literal["IATA", "ISO_3166", "UN_LOCODE", ""] | None = Field(
        None,
        description="Base set of predefined choices (optional)\n\n* `IATA` - IATA (Airport codes)\n* `ISO_3166` - ISO 3166 (Country codes)\n* `UN_LOCODE` - UN/LOCODE (Location codes)",
    )
    extra_choices: list[list[Any]] | None = None
    order_alphabetically: bool | None = Field(
        None, description="Choices are automatically ordered alphabetically"
    )


class PatchedWritableCustomFieldRequest(BaseModel):
    object_types: list[str] | None = None
    type: (
        Literal[
            "text",
            "longtext",
            "integer",
            "decimal",
            "boolean",
            "date",
            "datetime",
            "url",
            "json",
            "select",
            "multiselect",
            "object",
            "multiobject",
        ]
        | None
    ) = Field(
        None,
        description="The type of data this custom field holds\n\n* `text` - Text\n* `longtext` - Text (long)\n* `integer` - Integer\n* `decimal` - Decimal\n* `boolean` - Boolean (true/false)\n* `date` - Date\n* `datetime` - Date & time\n* `url` - URL\n* `json` - JSON\n* `select` - Selection\n* `multiselect` - Multiple selection\n* `object` - Object\n* `multiobject` - Multiple objects",
    )
    related_object_type: str | None = None
    name: constr(pattern=r"^[a-z0-9_]+$", min_length=1, max_length=50) | None = Field(
        None, description="Internal field name"
    )
    label: constr(max_length=50) | None = Field(
        None,
        description="Name of the field as displayed to users (if not provided, 'the field's name will be used)",
    )
    group_name: constr(max_length=50) | None = Field(
        None,
        description="Custom fields within the same group will be displayed together",
    )
    description: constr(max_length=200) | None = None
    required: bool | None = Field(
        None,
        description="This field is required when creating new objects or editing an existing object.",
    )
    unique: MustBeUnique | None = Field(
        None,
        description="The value of this field must be unique for the assigned object",
        title="Must be unique",
    )
    search_weight: conint(ge=0, le=32767) | None = Field(
        None,
        description="Weighting for search. Lower values are considered more important. Fields with a search weight of zero will be ignored.",
    )
    filter_logic: Literal["disabled", "loose", "exact"] | None = Field(
        None,
        description="Loose matches any instance of a given string; exact matches the entire field.\n\n* `disabled` - Disabled\n* `loose` - Loose\n* `exact` - Exact",
    )
    ui_visible: Literal["always", "if-set", "hidden"] | None = Field(
        None,
        description="Specifies whether the custom field is displayed in the UI\n\n* `always` - Always\n* `if-set` - If set\n* `hidden` - Hidden",
    )
    ui_editable: Literal["yes", "no", "hidden"] | None = Field(
        None,
        description="Specifies whether the custom field value can be edited in the UI\n\n* `yes` - Yes\n* `no` - No\n* `hidden` - Hidden",
    )
    is_cloneable: bool | None = Field(None, description="Replicate this value when cloning objects")
    default: Any | None = Field(
        None,
        description='Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. "Foo").',
    )
    related_object_filter: Any | None = Field(
        None,
        description='Filter the object selection choices using a query_params dict (must be a JSON value).Encapsulate strings with double quotes (e.g. "Foo").',
    )
    weight: DisplayWeight | None = Field(
        None,
        description="Fields with higher weights appear lower in a form.",
        title="Display weight",
    )
    validation_minimum: MinimumValue | None = Field(
        None,
        description="Minimum allowed value (for numeric fields)",
        title="Minimum value",
    )
    validation_maximum: MaximumValue | None = Field(
        None,
        description="Maximum allowed value (for numeric fields)",
        title="Maximum value",
    )
    validation_regex: constr(max_length=500) | None = Field(
        None,
        description="Regular expression to enforce on text field values. Use ^ and $ to force matching of entire string. For example, <code>^[A-Z]{3}$</code> will limit values to exactly three uppercase letters.",
    )
    choice_set: int | BriefCustomFieldChoiceSetRequest | None = None
    comments: str | None = None


class URL3(URL1):
    pass


class PatchedWritableDataSourceRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    type: constr(min_length=1, max_length=50) | None = None
    source_url: URL3 | None = Field(None, title="URL")
    enabled: bool | None = None
    description: constr(max_length=200) | None = None
    sync_interval: Literal[1, 60, 720, 1440, 10080, 43200] | None = Field(
        None,
        description="* `1` - Minutely\n* `60` - Hourly\n* `720` - 12 hours\n* `1440` - Daily\n* `10080` - Weekly\n* `43200` - 30 days",
    )
    parameters: Any | None = None
    ignore_rules: str | None = Field(
        None,
        description="Patterns (one per line) matching files to ignore when syncing",
    )
    comments: str | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableDeviceRoleRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    color: constr(pattern=r"^[0-9a-f]{6}$", min_length=1, max_length=6) | None = None
    vm_role: bool | None = Field(None, description="Virtual machines may be assigned to this role")
    config_template: int | BriefConfigTemplateRequest | None = None
    parent: int | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class PositionU5(PositionU1):
    pass


class ParentChildStatus(RootModel[Literal["parent", "child", ""] | None]):
    root: Literal["parent", "child", ""] | None = Field(
        None,
        description="Parent devices house child devices in device bays. Leave blank if this device type is neither a parent nor a child.\n\n* `parent` - Parent\n* `child` - Child",
        title="Parent/child status",
    )


class PatchedWritableDeviceTypeRequest(BaseModel):
    manufacturer: int | BriefManufacturerRequest | None = None
    default_platform: int | BriefPlatformRequest | None = None
    model: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    part_number: constr(max_length=50) | None = Field(
        None, description="Discrete part number (optional)"
    )
    u_height: PositionU5 | None = Field(
        default_factory=lambda: PositionU5(1.0), title="Position (U)"
    )
    exclude_from_utilization: bool | None = Field(
        None,
        description="Devices of this type are excluded when calculating rack utilization.",
    )
    is_full_depth: bool | None = Field(
        None, description="Device consumes both front and rear rack faces."
    )
    subdevice_role: ParentChildStatus | None = Field(
        None,
        description="Parent devices house child devices in device bays. Leave blank if this device type is neither a parent nor a child.\n\n* `parent` - Parent\n* `child` - Child",
        title="Parent/child status",
    )
    airflow: (
        Literal[
            "front-to-rear",
            "rear-to-front",
            "left-to-right",
            "right-to-left",
            "side-to-rear",
            "rear-to-side",
            "bottom-to-top",
            "top-to-bottom",
            "passive",
            "mixed",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front\n* `left-to-right` - Left to right\n* `right-to-left` - Right to left\n* `side-to-rear` - Side to rear\n* `rear-to-side` - Rear to side\n* `bottom-to-top` - Bottom to top\n* `top-to-bottom` - Top to bottom\n* `passive` - Passive\n* `mixed` - Mixed",
    )
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    front_image: bytes | None = None
    rear_image: bytes | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class SerialNumber7(SerialNumber):
    pass


class PositionU6(PositionU):
    pass


class RackFace(RootModel[Literal["front", "rear", ""] | None]):
    root: Literal["front", "rear", ""] | None = Field(
        None, description="* `front` - Front\n* `rear` - Rear", title="Rack face"
    )


class PatchedWritableEventRuleRequest(BaseModel):
    object_types: list[str] | None = None
    name: constr(min_length=1, max_length=150) | None = None
    enabled: bool | None = None
    event_types: (
        list[
            Literal[
                "object_created",
                "object_updated",
                "object_deleted",
                "job_started",
                "job_completed",
                "job_failed",
                "job_errored",
            ]
        ]
        | None
    ) = Field(None, description="The types of event which will trigger this rule.")
    conditions: Any | None = Field(
        None,
        description="A set of conditions which determine whether the event will be generated.",
    )
    action_type: Literal["webhook", "script", "notification"] | None = Field(
        None,
        description="* `webhook` - Webhook\n* `script` - Script\n* `notification` - Notification",
    )
    action_object_type: str | None = None
    action_object_id: conint(ge=0, le=9223372036854775807) | None = None
    description: constr(max_length=200) | None = None
    custom_fields: dict[str, Any] | None = None
    tags: list[NestedTagRequest] | None = None


class PatchedWritableIKEPolicyRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    version: Literal[1, 2] | None = Field(None, description="* `1` - IKEv1\n* `2` - IKEv2")
    mode: Literal["aggressive", "main", ""] | None = Field(
        None, description="* `aggressive` - Aggressive\n* `main` - Main"
    )
    proposals: list[int] | None = None
    preshared_key: PreSharedKey | None = Field(None, title="Pre-shared key")
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableIKEProposalRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    authentication_method: (
        Literal["preshared-keys", "certificates", "rsa-signatures", "dsa-signatures"] | None
    ) = Field(
        None,
        description="* `preshared-keys` - Pre-shared keys\n* `certificates` - Certificates\n* `rsa-signatures` - RSA signatures\n* `dsa-signatures` - DSA signatures",
    )
    encryption_algorithm: (
        Literal[
            "aes-128-cbc",
            "aes-128-gcm",
            "aes-192-cbc",
            "aes-192-gcm",
            "aes-256-cbc",
            "aes-256-gcm",
            "3des-cbc",
            "des-cbc",
        ]
        | None
    ) = Field(
        None,
        description="* `aes-128-cbc` - 128-bit AES (CBC)\n* `aes-128-gcm` - 128-bit AES (GCM)\n* `aes-192-cbc` - 192-bit AES (CBC)\n* `aes-192-gcm` - 192-bit AES (GCM)\n* `aes-256-cbc` - 256-bit AES (CBC)\n* `aes-256-gcm` - 256-bit AES (GCM)\n* `3des-cbc` - 3DES\n* `des-cbc` - DES",
    )
    authentication_algorithm: (
        Literal["hmac-sha1", "hmac-sha256", "hmac-sha384", "hmac-sha512", "hmac-md5", ""] | None
    ) = Field(
        None,
        description="* `hmac-sha1` - SHA-1 HMAC\n* `hmac-sha256` - SHA-256 HMAC\n* `hmac-sha384` - SHA-384 HMAC\n* `hmac-sha512` - SHA-512 HMAC\n* `hmac-md5` - MD5 HMAC",
    )
    group: (
        Literal[
            1,
            2,
            5,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            27,
            28,
            29,
            30,
            31,
            32,
            33,
            34,
        ]
        | None
    ) = Field(
        None,
        description="Diffie-Hellman group ID\n\n* `1` - Group 1\n* `2` - Group 2\n* `5` - Group 5\n* `14` - Group 14\n* `15` - Group 15\n* `16` - Group 16\n* `17` - Group 17\n* `18` - Group 18\n* `19` - Group 19\n* `20` - Group 20\n* `21` - Group 21\n* `22` - Group 22\n* `23` - Group 23\n* `24` - Group 24\n* `25` - Group 25\n* `26` - Group 26\n* `27` - Group 27\n* `28` - Group 28\n* `29` - Group 29\n* `30` - Group 30\n* `31` - Group 31\n* `32` - Group 32\n* `33` - Group 33\n* `34` - Group 34",
    )
    sa_lifetime: conint(ge=0, le=2147483647) | None = Field(
        None, description="Security association lifetime (in seconds)"
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class NATInside(RootModel[int | None]):
    root: int | None = Field(
        None,
        description='The IP for which this address is the "outside" IP',
        title="NAT (inside)",
    )


class PatchedWritableIPAddressRequest(BaseModel):
    address: constr(min_length=1) | None = None
    vrf: int | BriefVRFRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    status: Literal["active", "reserved", "deprecated", "dhcp", "slaac"] | None = Field(
        None,
        description="The operational status of this IP\n\n* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated\n* `dhcp` - DHCP\n* `slaac` - SLAAC",
    )
    role: (
        Literal[
            "loopback",
            "secondary",
            "anycast",
            "vip",
            "vrrp",
            "hsrp",
            "glbp",
            "carp",
            "",
        ]
        | None
    ) = Field(
        None,
        description="The functional role of this IP\n\n* `loopback` - Loopback\n* `secondary` - Secondary\n* `anycast` - Anycast\n* `vip` - VIP\n* `vrrp` - VRRP\n* `hsrp` - HSRP\n* `glbp` - GLBP\n* `carp` - CARP",
    )
    assigned_object_type: str | None = None
    assigned_object_id: conint(ge=0, le=9223372036854775807) | None = None
    nat_inside: NATInside | None = Field(
        None,
        description='The IP for which this address is the "outside" IP',
        title="NAT (inside)",
    )
    dns_name: (
        constr(pattern=r"^([0-9A-Za-z_-]+|\*)(\.[0-9A-Za-z_-]+)*\.?$", max_length=255) | None
    ) = Field(None, description="Hostname or FQDN (not case-sensitive)")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableIPRangeRequest(BaseModel):
    start_address: constr(min_length=1) | None = None
    end_address: constr(min_length=1) | None = None
    vrf: int | BriefVRFRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    status: Literal["active", "reserved", "deprecated"] | None = Field(
        None,
        description="Operational status of this range\n\n* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    role: int | BriefRoleRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    mark_populated: bool | None = Field(
        None, description="Prevent the creation of IP addresses within this range"
    )
    mark_utilized: bool | None = Field(None, description="Report space as 100% utilized")


class PatchedWritableIPSecPolicyRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    proposals: list[int] | None = None
    pfs_group: (
        Literal[
            1,
            2,
            5,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            27,
            28,
            29,
            30,
            31,
            32,
            33,
            34,
        ]
        | None
    ) = Field(
        None,
        description="Diffie-Hellman group for Perfect Forward Secrecy\n\n* `1` - Group 1\n* `2` - Group 2\n* `5` - Group 5\n* `14` - Group 14\n* `15` - Group 15\n* `16` - Group 16\n* `17` - Group 17\n* `18` - Group 18\n* `19` - Group 19\n* `20` - Group 20\n* `21` - Group 21\n* `22` - Group 22\n* `23` - Group 23\n* `24` - Group 24\n* `25` - Group 25\n* `26` - Group 26\n* `27` - Group 27\n* `28` - Group 28\n* `29` - Group 29\n* `30` - Group 30\n* `31` - Group 31\n* `32` - Group 32\n* `33` - Group 33\n* `34` - Group 34",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableIPSecProfileRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    mode: Literal["esp", "ah"] | None = Field(None, description="* `esp` - ESP\n* `ah` - AH")
    ike_policy: int | BriefIKEPolicyRequest | None = None
    ipsec_policy: int | BriefIPSecPolicyRequest | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Encryption(
    RootModel[
        Literal[
            "aes-128-cbc",
            "aes-128-gcm",
            "aes-192-cbc",
            "aes-192-gcm",
            "aes-256-cbc",
            "aes-256-gcm",
            "3des-cbc",
            "des-cbc",
            "",
        ]
        | None
    ]
):
    root: (
        Literal[
            "aes-128-cbc",
            "aes-128-gcm",
            "aes-192-cbc",
            "aes-192-gcm",
            "aes-256-cbc",
            "aes-256-gcm",
            "3des-cbc",
            "des-cbc",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `aes-128-cbc` - 128-bit AES (CBC)\n* `aes-128-gcm` - 128-bit AES (GCM)\n* `aes-192-cbc` - 192-bit AES (CBC)\n* `aes-192-gcm` - 192-bit AES (GCM)\n* `aes-256-cbc` - 256-bit AES (CBC)\n* `aes-256-gcm` - 256-bit AES (GCM)\n* `3des-cbc` - 3DES\n* `des-cbc` - DES",
        title="Encryption",
    )


class Authentication(
    RootModel[
        Literal["hmac-sha1", "hmac-sha256", "hmac-sha384", "hmac-sha512", "hmac-md5", ""] | None
    ]
):
    root: (
        Literal["hmac-sha1", "hmac-sha256", "hmac-sha384", "hmac-sha512", "hmac-md5", ""] | None
    ) = Field(
        None,
        description="* `hmac-sha1` - SHA-1 HMAC\n* `hmac-sha256` - SHA-256 HMAC\n* `hmac-sha384` - SHA-384 HMAC\n* `hmac-sha512` - SHA-512 HMAC\n* `hmac-md5` - MD5 HMAC",
        title="Authentication",
    )


class PatchedWritableIPSecProposalRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    encryption_algorithm: Encryption | None = Field(
        None,
        description="* `aes-128-cbc` - 128-bit AES (CBC)\n* `aes-128-gcm` - 128-bit AES (GCM)\n* `aes-192-cbc` - 192-bit AES (CBC)\n* `aes-192-gcm` - 192-bit AES (GCM)\n* `aes-256-cbc` - 256-bit AES (CBC)\n* `aes-256-gcm` - 256-bit AES (GCM)\n* `3des-cbc` - 3DES\n* `des-cbc` - DES",
        title="Encryption",
    )
    authentication_algorithm: Authentication | None = Field(
        None,
        description="* `hmac-sha1` - SHA-1 HMAC\n* `hmac-sha256` - SHA-256 HMAC\n* `hmac-sha384` - SHA-384 HMAC\n* `hmac-sha512` - SHA-512 HMAC\n* `hmac-md5` - MD5 HMAC",
        title="Authentication",
    )
    sa_lifetime_seconds: SALifetimeSeconds | None = Field(
        None,
        description="Security association lifetime (seconds)",
        title="SA lifetime (seconds)",
    )
    sa_lifetime_data: SALifetimeKB | None = Field(
        None,
        description="Security association lifetime (in kilobytes)",
        title="SA lifetime (KB)",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ParentInterface(RootModel[int | None]):
    root: int | None = Field(None, title="Parent interface")


class BridgeInterface(RootModel[int | None]):
    root: int | None = Field(None, title="Bridge interface")


class ParentLAG(RootModel[int | None]):
    root: int | None = Field(None, title="Parent LAG")


class ManagementOnly4(ManagementOnly):
    pass


class WirelessRole(RootModel[Literal["ap", "station", ""] | None]):
    root: Literal["ap", "station", ""] | None = Field(
        None,
        description="* `ap` - Access point\n* `station` - Station",
        title="Wireless role",
    )


class WirelessChannel(
    RootModel[
        Literal[
            "2.4g-1-2412-22",
            "2.4g-2-2417-22",
            "2.4g-3-2422-22",
            "2.4g-4-2427-22",
            "2.4g-5-2432-22",
            "2.4g-6-2437-22",
            "2.4g-7-2442-22",
            "2.4g-8-2447-22",
            "2.4g-9-2452-22",
            "2.4g-10-2457-22",
            "2.4g-11-2462-22",
            "2.4g-12-2467-22",
            "2.4g-13-2472-22",
            "5g-32-5160-20",
            "5g-34-5170-40",
            "5g-36-5180-20",
            "5g-38-5190-40",
            "5g-40-5200-20",
            "5g-42-5210-80",
            "5g-44-5220-20",
            "5g-46-5230-40",
            "5g-48-5240-20",
            "5g-50-5250-160",
            "5g-52-5260-20",
            "5g-54-5270-40",
            "5g-56-5280-20",
            "5g-58-5290-80",
            "5g-60-5300-20",
            "5g-62-5310-40",
            "5g-64-5320-20",
            "5g-100-5500-20",
            "5g-102-5510-40",
            "5g-104-5520-20",
            "5g-106-5530-80",
            "5g-108-5540-20",
            "5g-110-5550-40",
            "5g-112-5560-20",
            "5g-114-5570-160",
            "5g-116-5580-20",
            "5g-118-5590-40",
            "5g-120-5600-20",
            "5g-122-5610-80",
            "5g-124-5620-20",
            "5g-126-5630-40",
            "5g-128-5640-20",
            "5g-132-5660-20",
            "5g-134-5670-40",
            "5g-136-5680-20",
            "5g-138-5690-80",
            "5g-140-5700-20",
            "5g-142-5710-40",
            "5g-144-5720-20",
            "5g-149-5745-20",
            "5g-151-5755-40",
            "5g-153-5765-20",
            "5g-155-5775-80",
            "5g-157-5785-20",
            "5g-159-5795-40",
            "5g-161-5805-20",
            "5g-163-5815-160",
            "5g-165-5825-20",
            "5g-167-5835-40",
            "5g-169-5845-20",
            "5g-171-5855-80",
            "5g-173-5865-20",
            "5g-175-5875-40",
            "5g-177-5885-20",
            "6g-1-5955-20",
            "6g-3-5965-40",
            "6g-5-5975-20",
            "6g-7-5985-80",
            "6g-9-5995-20",
            "6g-11-6005-40",
            "6g-13-6015-20",
            "6g-15-6025-160",
            "6g-17-6035-20",
            "6g-19-6045-40",
            "6g-21-6055-20",
            "6g-23-6065-80",
            "6g-25-6075-20",
            "6g-27-6085-40",
            "6g-29-6095-20",
            "6g-31-6105-320",
            "6g-33-6115-20",
            "6g-35-6125-40",
            "6g-37-6135-20",
            "6g-39-6145-80",
            "6g-41-6155-20",
            "6g-43-6165-40",
            "6g-45-6175-20",
            "6g-47-6185-160",
            "6g-49-6195-20",
            "6g-51-6205-40",
            "6g-53-6215-20",
            "6g-55-6225-80",
            "6g-57-6235-20",
            "6g-59-6245-40",
            "6g-61-6255-20",
            "6g-65-6275-20",
            "6g-67-6285-40",
            "6g-69-6295-20",
            "6g-71-6305-80",
            "6g-73-6315-20",
            "6g-75-6325-40",
            "6g-77-6335-20",
            "6g-79-6345-160",
            "6g-81-6355-20",
            "6g-83-6365-40",
            "6g-85-6375-20",
            "6g-87-6385-80",
            "6g-89-6395-20",
            "6g-91-6405-40",
            "6g-93-6415-20",
            "6g-95-6425-320",
            "6g-97-6435-20",
            "6g-99-6445-40",
            "6g-101-6455-20",
            "6g-103-6465-80",
            "6g-105-6475-20",
            "6g-107-6485-40",
            "6g-109-6495-20",
            "6g-111-6505-160",
            "6g-113-6515-20",
            "6g-115-6525-40",
            "6g-117-6535-20",
            "6g-119-6545-80",
            "6g-121-6555-20",
            "6g-123-6565-40",
            "6g-125-6575-20",
            "6g-129-6595-20",
            "6g-131-6605-40",
            "6g-133-6615-20",
            "6g-135-6625-80",
            "6g-137-6635-20",
            "6g-139-6645-40",
            "6g-141-6655-20",
            "6g-143-6665-160",
            "6g-145-6675-20",
            "6g-147-6685-40",
            "6g-149-6695-20",
            "6g-151-6705-80",
            "6g-153-6715-20",
            "6g-155-6725-40",
            "6g-157-6735-20",
            "6g-159-6745-320",
            "6g-161-6755-20",
            "6g-163-6765-40",
            "6g-165-6775-20",
            "6g-167-6785-80",
            "6g-169-6795-20",
            "6g-171-6805-40",
            "6g-173-6815-20",
            "6g-175-6825-160",
            "6g-177-6835-20",
            "6g-179-6845-40",
            "6g-181-6855-20",
            "6g-183-6865-80",
            "6g-185-6875-20",
            "6g-187-6885-40",
            "6g-189-6895-20",
            "6g-193-6915-20",
            "6g-195-6925-40",
            "6g-197-6935-20",
            "6g-199-6945-80",
            "6g-201-6955-20",
            "6g-203-6965-40",
            "6g-205-6975-20",
            "6g-207-6985-160",
            "6g-209-6995-20",
            "6g-211-7005-40",
            "6g-213-7015-20",
            "6g-215-7025-80",
            "6g-217-7035-20",
            "6g-219-7045-40",
            "6g-221-7055-20",
            "6g-225-7075-20",
            "6g-227-7085-40",
            "6g-229-7095-20",
            "6g-233-7115-20",
            "60g-1-58320-2160",
            "60g-2-60480-2160",
            "60g-3-62640-2160",
            "60g-4-64800-2160",
            "60g-5-66960-2160",
            "60g-6-69120-2160",
            "60g-9-59400-4320",
            "60g-10-61560-4320",
            "60g-11-63720-4320",
            "60g-12-65880-4320",
            "60g-13-68040-4320",
            "60g-17-60480-6480",
            "60g-18-62640-6480",
            "60g-19-64800-6480",
            "60g-20-66960-6480",
            "60g-25-61560-6480",
            "60g-26-63720-6480",
            "60g-27-65880-6480",
            "",
        ]
        | None
    ]
):
    root: (
        Literal[
            "2.4g-1-2412-22",
            "2.4g-2-2417-22",
            "2.4g-3-2422-22",
            "2.4g-4-2427-22",
            "2.4g-5-2432-22",
            "2.4g-6-2437-22",
            "2.4g-7-2442-22",
            "2.4g-8-2447-22",
            "2.4g-9-2452-22",
            "2.4g-10-2457-22",
            "2.4g-11-2462-22",
            "2.4g-12-2467-22",
            "2.4g-13-2472-22",
            "5g-32-5160-20",
            "5g-34-5170-40",
            "5g-36-5180-20",
            "5g-38-5190-40",
            "5g-40-5200-20",
            "5g-42-5210-80",
            "5g-44-5220-20",
            "5g-46-5230-40",
            "5g-48-5240-20",
            "5g-50-5250-160",
            "5g-52-5260-20",
            "5g-54-5270-40",
            "5g-56-5280-20",
            "5g-58-5290-80",
            "5g-60-5300-20",
            "5g-62-5310-40",
            "5g-64-5320-20",
            "5g-100-5500-20",
            "5g-102-5510-40",
            "5g-104-5520-20",
            "5g-106-5530-80",
            "5g-108-5540-20",
            "5g-110-5550-40",
            "5g-112-5560-20",
            "5g-114-5570-160",
            "5g-116-5580-20",
            "5g-118-5590-40",
            "5g-120-5600-20",
            "5g-122-5610-80",
            "5g-124-5620-20",
            "5g-126-5630-40",
            "5g-128-5640-20",
            "5g-132-5660-20",
            "5g-134-5670-40",
            "5g-136-5680-20",
            "5g-138-5690-80",
            "5g-140-5700-20",
            "5g-142-5710-40",
            "5g-144-5720-20",
            "5g-149-5745-20",
            "5g-151-5755-40",
            "5g-153-5765-20",
            "5g-155-5775-80",
            "5g-157-5785-20",
            "5g-159-5795-40",
            "5g-161-5805-20",
            "5g-163-5815-160",
            "5g-165-5825-20",
            "5g-167-5835-40",
            "5g-169-5845-20",
            "5g-171-5855-80",
            "5g-173-5865-20",
            "5g-175-5875-40",
            "5g-177-5885-20",
            "6g-1-5955-20",
            "6g-3-5965-40",
            "6g-5-5975-20",
            "6g-7-5985-80",
            "6g-9-5995-20",
            "6g-11-6005-40",
            "6g-13-6015-20",
            "6g-15-6025-160",
            "6g-17-6035-20",
            "6g-19-6045-40",
            "6g-21-6055-20",
            "6g-23-6065-80",
            "6g-25-6075-20",
            "6g-27-6085-40",
            "6g-29-6095-20",
            "6g-31-6105-320",
            "6g-33-6115-20",
            "6g-35-6125-40",
            "6g-37-6135-20",
            "6g-39-6145-80",
            "6g-41-6155-20",
            "6g-43-6165-40",
            "6g-45-6175-20",
            "6g-47-6185-160",
            "6g-49-6195-20",
            "6g-51-6205-40",
            "6g-53-6215-20",
            "6g-55-6225-80",
            "6g-57-6235-20",
            "6g-59-6245-40",
            "6g-61-6255-20",
            "6g-65-6275-20",
            "6g-67-6285-40",
            "6g-69-6295-20",
            "6g-71-6305-80",
            "6g-73-6315-20",
            "6g-75-6325-40",
            "6g-77-6335-20",
            "6g-79-6345-160",
            "6g-81-6355-20",
            "6g-83-6365-40",
            "6g-85-6375-20",
            "6g-87-6385-80",
            "6g-89-6395-20",
            "6g-91-6405-40",
            "6g-93-6415-20",
            "6g-95-6425-320",
            "6g-97-6435-20",
            "6g-99-6445-40",
            "6g-101-6455-20",
            "6g-103-6465-80",
            "6g-105-6475-20",
            "6g-107-6485-40",
            "6g-109-6495-20",
            "6g-111-6505-160",
            "6g-113-6515-20",
            "6g-115-6525-40",
            "6g-117-6535-20",
            "6g-119-6545-80",
            "6g-121-6555-20",
            "6g-123-6565-40",
            "6g-125-6575-20",
            "6g-129-6595-20",
            "6g-131-6605-40",
            "6g-133-6615-20",
            "6g-135-6625-80",
            "6g-137-6635-20",
            "6g-139-6645-40",
            "6g-141-6655-20",
            "6g-143-6665-160",
            "6g-145-6675-20",
            "6g-147-6685-40",
            "6g-149-6695-20",
            "6g-151-6705-80",
            "6g-153-6715-20",
            "6g-155-6725-40",
            "6g-157-6735-20",
            "6g-159-6745-320",
            "6g-161-6755-20",
            "6g-163-6765-40",
            "6g-165-6775-20",
            "6g-167-6785-80",
            "6g-169-6795-20",
            "6g-171-6805-40",
            "6g-173-6815-20",
            "6g-175-6825-160",
            "6g-177-6835-20",
            "6g-179-6845-40",
            "6g-181-6855-20",
            "6g-183-6865-80",
            "6g-185-6875-20",
            "6g-187-6885-40",
            "6g-189-6895-20",
            "6g-193-6915-20",
            "6g-195-6925-40",
            "6g-197-6935-20",
            "6g-199-6945-80",
            "6g-201-6955-20",
            "6g-203-6965-40",
            "6g-205-6975-20",
            "6g-207-6985-160",
            "6g-209-6995-20",
            "6g-211-7005-40",
            "6g-213-7015-20",
            "6g-215-7025-80",
            "6g-217-7035-20",
            "6g-219-7045-40",
            "6g-221-7055-20",
            "6g-225-7075-20",
            "6g-227-7085-40",
            "6g-229-7095-20",
            "6g-233-7115-20",
            "60g-1-58320-2160",
            "60g-2-60480-2160",
            "60g-3-62640-2160",
            "60g-4-64800-2160",
            "60g-5-66960-2160",
            "60g-6-69120-2160",
            "60g-9-59400-4320",
            "60g-10-61560-4320",
            "60g-11-63720-4320",
            "60g-12-65880-4320",
            "60g-13-68040-4320",
            "60g-17-60480-6480",
            "60g-18-62640-6480",
            "60g-19-64800-6480",
            "60g-20-66960-6480",
            "60g-25-61560-6480",
            "60g-26-63720-6480",
            "60g-27-65880-6480",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `2.4g-1-2412-22` - 1 (2412 MHz)\n* `2.4g-2-2417-22` - 2 (2417 MHz)\n* `2.4g-3-2422-22` - 3 (2422 MHz)\n* `2.4g-4-2427-22` - 4 (2427 MHz)\n* `2.4g-5-2432-22` - 5 (2432 MHz)\n* `2.4g-6-2437-22` - 6 (2437 MHz)\n* `2.4g-7-2442-22` - 7 (2442 MHz)\n* `2.4g-8-2447-22` - 8 (2447 MHz)\n* `2.4g-9-2452-22` - 9 (2452 MHz)\n* `2.4g-10-2457-22` - 10 (2457 MHz)\n* `2.4g-11-2462-22` - 11 (2462 MHz)\n* `2.4g-12-2467-22` - 12 (2467 MHz)\n* `2.4g-13-2472-22` - 13 (2472 MHz)\n* `5g-32-5160-20` - 32 (5160/20 MHz)\n* `5g-34-5170-40` - 34 (5170/40 MHz)\n* `5g-36-5180-20` - 36 (5180/20 MHz)\n* `5g-38-5190-40` - 38 (5190/40 MHz)\n* `5g-40-5200-20` - 40 (5200/20 MHz)\n* `5g-42-5210-80` - 42 (5210/80 MHz)\n* `5g-44-5220-20` - 44 (5220/20 MHz)\n* `5g-46-5230-40` - 46 (5230/40 MHz)\n* `5g-48-5240-20` - 48 (5240/20 MHz)\n* `5g-50-5250-160` - 50 (5250/160 MHz)\n* `5g-52-5260-20` - 52 (5260/20 MHz)\n* `5g-54-5270-40` - 54 (5270/40 MHz)\n* `5g-56-5280-20` - 56 (5280/20 MHz)\n* `5g-58-5290-80` - 58 (5290/80 MHz)\n* `5g-60-5300-20` - 60 (5300/20 MHz)\n* `5g-62-5310-40` - 62 (5310/40 MHz)\n* `5g-64-5320-20` - 64 (5320/20 MHz)\n* `5g-100-5500-20` - 100 (5500/20 MHz)\n* `5g-102-5510-40` - 102 (5510/40 MHz)\n* `5g-104-5520-20` - 104 (5520/20 MHz)\n* `5g-106-5530-80` - 106 (5530/80 MHz)\n* `5g-108-5540-20` - 108 (5540/20 MHz)\n* `5g-110-5550-40` - 110 (5550/40 MHz)\n* `5g-112-5560-20` - 112 (5560/20 MHz)\n* `5g-114-5570-160` - 114 (5570/160 MHz)\n* `5g-116-5580-20` - 116 (5580/20 MHz)\n* `5g-118-5590-40` - 118 (5590/40 MHz)\n* `5g-120-5600-20` - 120 (5600/20 MHz)\n* `5g-122-5610-80` - 122 (5610/80 MHz)\n* `5g-124-5620-20` - 124 (5620/20 MHz)\n* `5g-126-5630-40` - 126 (5630/40 MHz)\n* `5g-128-5640-20` - 128 (5640/20 MHz)\n* `5g-132-5660-20` - 132 (5660/20 MHz)\n* `5g-134-5670-40` - 134 (5670/40 MHz)\n* `5g-136-5680-20` - 136 (5680/20 MHz)\n* `5g-138-5690-80` - 138 (5690/80 MHz)\n* `5g-140-5700-20` - 140 (5700/20 MHz)\n* `5g-142-5710-40` - 142 (5710/40 MHz)\n* `5g-144-5720-20` - 144 (5720/20 MHz)\n* `5g-149-5745-20` - 149 (5745/20 MHz)\n* `5g-151-5755-40` - 151 (5755/40 MHz)\n* `5g-153-5765-20` - 153 (5765/20 MHz)\n* `5g-155-5775-80` - 155 (5775/80 MHz)\n* `5g-157-5785-20` - 157 (5785/20 MHz)\n* `5g-159-5795-40` - 159 (5795/40 MHz)\n* `5g-161-5805-20` - 161 (5805/20 MHz)\n* `5g-163-5815-160` - 163 (5815/160 MHz)\n* `5g-165-5825-20` - 165 (5825/20 MHz)\n* `5g-167-5835-40` - 167 (5835/40 MHz)\n* `5g-169-5845-20` - 169 (5845/20 MHz)\n* `5g-171-5855-80` - 171 (5855/80 MHz)\n* `5g-173-5865-20` - 173 (5865/20 MHz)\n* `5g-175-5875-40` - 175 (5875/40 MHz)\n* `5g-177-5885-20` - 177 (5885/20 MHz)\n* `6g-1-5955-20` - 1 (5955/20 MHz)\n* `6g-3-5965-40` - 3 (5965/40 MHz)\n* `6g-5-5975-20` - 5 (5975/20 MHz)\n* `6g-7-5985-80` - 7 (5985/80 MHz)\n* `6g-9-5995-20` - 9 (5995/20 MHz)\n* `6g-11-6005-40` - 11 (6005/40 MHz)\n* `6g-13-6015-20` - 13 (6015/20 MHz)\n* `6g-15-6025-160` - 15 (6025/160 MHz)\n* `6g-17-6035-20` - 17 (6035/20 MHz)\n* `6g-19-6045-40` - 19 (6045/40 MHz)\n* `6g-21-6055-20` - 21 (6055/20 MHz)\n* `6g-23-6065-80` - 23 (6065/80 MHz)\n* `6g-25-6075-20` - 25 (6075/20 MHz)\n* `6g-27-6085-40` - 27 (6085/40 MHz)\n* `6g-29-6095-20` - 29 (6095/20 MHz)\n* `6g-31-6105-320` - 31 (6105/320 MHz)\n* `6g-33-6115-20` - 33 (6115/20 MHz)\n* `6g-35-6125-40` - 35 (6125/40 MHz)\n* `6g-37-6135-20` - 37 (6135/20 MHz)\n* `6g-39-6145-80` - 39 (6145/80 MHz)\n* `6g-41-6155-20` - 41 (6155/20 MHz)\n* `6g-43-6165-40` - 43 (6165/40 MHz)\n* `6g-45-6175-20` - 45 (6175/20 MHz)\n* `6g-47-6185-160` - 47 (6185/160 MHz)\n* `6g-49-6195-20` - 49 (6195/20 MHz)\n* `6g-51-6205-40` - 51 (6205/40 MHz)\n* `6g-53-6215-20` - 53 (6215/20 MHz)\n* `6g-55-6225-80` - 55 (6225/80 MHz)\n* `6g-57-6235-20` - 57 (6235/20 MHz)\n* `6g-59-6245-40` - 59 (6245/40 MHz)\n* `6g-61-6255-20` - 61 (6255/20 MHz)\n* `6g-65-6275-20` - 65 (6275/20 MHz)\n* `6g-67-6285-40` - 67 (6285/40 MHz)\n* `6g-69-6295-20` - 69 (6295/20 MHz)\n* `6g-71-6305-80` - 71 (6305/80 MHz)\n* `6g-73-6315-20` - 73 (6315/20 MHz)\n* `6g-75-6325-40` - 75 (6325/40 MHz)\n* `6g-77-6335-20` - 77 (6335/20 MHz)\n* `6g-79-6345-160` - 79 (6345/160 MHz)\n* `6g-81-6355-20` - 81 (6355/20 MHz)\n* `6g-83-6365-40` - 83 (6365/40 MHz)\n* `6g-85-6375-20` - 85 (6375/20 MHz)\n* `6g-87-6385-80` - 87 (6385/80 MHz)\n* `6g-89-6395-20` - 89 (6395/20 MHz)\n* `6g-91-6405-40` - 91 (6405/40 MHz)\n* `6g-93-6415-20` - 93 (6415/20 MHz)\n* `6g-95-6425-320` - 95 (6425/320 MHz)\n* `6g-97-6435-20` - 97 (6435/20 MHz)\n* `6g-99-6445-40` - 99 (6445/40 MHz)\n* `6g-101-6455-20` - 101 (6455/20 MHz)\n* `6g-103-6465-80` - 103 (6465/80 MHz)\n* `6g-105-6475-20` - 105 (6475/20 MHz)\n* `6g-107-6485-40` - 107 (6485/40 MHz)\n* `6g-109-6495-20` - 109 (6495/20 MHz)\n* `6g-111-6505-160` - 111 (6505/160 MHz)\n* `6g-113-6515-20` - 113 (6515/20 MHz)\n* `6g-115-6525-40` - 115 (6525/40 MHz)\n* `6g-117-6535-20` - 117 (6535/20 MHz)\n* `6g-119-6545-80` - 119 (6545/80 MHz)\n* `6g-121-6555-20` - 121 (6555/20 MHz)\n* `6g-123-6565-40` - 123 (6565/40 MHz)\n* `6g-125-6575-20` - 125 (6575/20 MHz)\n* `6g-129-6595-20` - 129 (6595/20 MHz)\n* `6g-131-6605-40` - 131 (6605/40 MHz)\n* `6g-133-6615-20` - 133 (6615/20 MHz)\n* `6g-135-6625-80` - 135 (6625/80 MHz)\n* `6g-137-6635-20` - 137 (6635/20 MHz)\n* `6g-139-6645-40` - 139 (6645/40 MHz)\n* `6g-141-6655-20` - 141 (6655/20 MHz)\n* `6g-143-6665-160` - 143 (6665/160 MHz)\n* `6g-145-6675-20` - 145 (6675/20 MHz)\n* `6g-147-6685-40` - 147 (6685/40 MHz)\n* `6g-149-6695-20` - 149 (6695/20 MHz)\n* `6g-151-6705-80` - 151 (6705/80 MHz)\n* `6g-153-6715-20` - 153 (6715/20 MHz)\n* `6g-155-6725-40` - 155 (6725/40 MHz)\n* `6g-157-6735-20` - 157 (6735/20 MHz)\n* `6g-159-6745-320` - 159 (6745/320 MHz)\n* `6g-161-6755-20` - 161 (6755/20 MHz)\n* `6g-163-6765-40` - 163 (6765/40 MHz)\n* `6g-165-6775-20` - 165 (6775/20 MHz)\n* `6g-167-6785-80` - 167 (6785/80 MHz)\n* `6g-169-6795-20` - 169 (6795/20 MHz)\n* `6g-171-6805-40` - 171 (6805/40 MHz)\n* `6g-173-6815-20` - 173 (6815/20 MHz)\n* `6g-175-6825-160` - 175 (6825/160 MHz)\n* `6g-177-6835-20` - 177 (6835/20 MHz)\n* `6g-179-6845-40` - 179 (6845/40 MHz)\n* `6g-181-6855-20` - 181 (6855/20 MHz)\n* `6g-183-6865-80` - 183 (6865/80 MHz)\n* `6g-185-6875-20` - 185 (6875/20 MHz)\n* `6g-187-6885-40` - 187 (6885/40 MHz)\n* `6g-189-6895-20` - 189 (6895/20 MHz)\n* `6g-193-6915-20` - 193 (6915/20 MHz)\n* `6g-195-6925-40` - 195 (6925/40 MHz)\n* `6g-197-6935-20` - 197 (6935/20 MHz)\n* `6g-199-6945-80` - 199 (6945/80 MHz)\n* `6g-201-6955-20` - 201 (6955/20 MHz)\n* `6g-203-6965-40` - 203 (6965/40 MHz)\n* `6g-205-6975-20` - 205 (6975/20 MHz)\n* `6g-207-6985-160` - 207 (6985/160 MHz)\n* `6g-209-6995-20` - 209 (6995/20 MHz)\n* `6g-211-7005-40` - 211 (7005/40 MHz)\n* `6g-213-7015-20` - 213 (7015/20 MHz)\n* `6g-215-7025-80` - 215 (7025/80 MHz)\n* `6g-217-7035-20` - 217 (7035/20 MHz)\n* `6g-219-7045-40` - 219 (7045/40 MHz)\n* `6g-221-7055-20` - 221 (7055/20 MHz)\n* `6g-225-7075-20` - 225 (7075/20 MHz)\n* `6g-227-7085-40` - 227 (7085/40 MHz)\n* `6g-229-7095-20` - 229 (7095/20 MHz)\n* `6g-233-7115-20` - 233 (7115/20 MHz)\n* `60g-1-58320-2160` - 1 (58.32/2.16 GHz)\n* `60g-2-60480-2160` - 2 (60.48/2.16 GHz)\n* `60g-3-62640-2160` - 3 (62.64/2.16 GHz)\n* `60g-4-64800-2160` - 4 (64.80/2.16 GHz)\n* `60g-5-66960-2160` - 5 (66.96/2.16 GHz)\n* `60g-6-69120-2160` - 6 (69.12/2.16 GHz)\n* `60g-9-59400-4320` - 9 (59.40/4.32 GHz)\n* `60g-10-61560-4320` - 10 (61.56/4.32 GHz)\n* `60g-11-63720-4320` - 11 (63.72/4.32 GHz)\n* `60g-12-65880-4320` - 12 (65.88/4.32 GHz)\n* `60g-13-68040-4320` - 13 (68.04/4.32 GHz)\n* `60g-17-60480-6480` - 17 (60.48/6.48 GHz)\n* `60g-18-62640-6480` - 18 (62.64/6.48 GHz)\n* `60g-19-64800-6480` - 19 (64.80/6.48 GHz)\n* `60g-20-66960-6480` - 20 (66.96/6.48 GHz)\n* `60g-25-61560-6480` - 25 (61.56/8.64 GHz)\n* `60g-26-63720-6480` - 26 (63.72/8.64 GHz)\n* `60g-27-65880-6480` - 27 (65.88/8.64 GHz)",
        title="Wireless channel",
    )


class ManagementOnly5(ManagementOnly2):
    pass


class SerialNumber8(SerialNumber3):
    pass


class PatchedWritableInventoryItemRequest(BaseModel):
    device: int | BriefDeviceRequest | None = None
    parent: int | None = None
    name: constr(min_length=1, max_length=64) | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    status: (
        Literal["offline", "active", "planned", "staged", "failed", "decommissioning"] | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning",
    )
    role: int | BriefInventoryItemRoleRequest | None = None
    manufacturer: int | BriefManufacturerRequest | None = None
    part_id: constr(max_length=50) | None = Field(
        None, description="Manufacturer-assigned part identifier"
    )
    serial: SerialNumber8 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this item"
    )
    discovered: bool | None = Field(None, description="This item was automatically discovered")
    description: constr(max_length=200) | None = None
    component_type: str | None = None
    component_id: conint(ge=0, le=9223372036854775807) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableJournalEntryRequest(BaseModel):
    assigned_object_type: str | None = None
    assigned_object_id: conint(ge=0, le=9223372036854775807) | None = None
    created_by: int | None = None
    kind: Literal["info", "success", "warning", "danger"] | None = Field(
        None,
        description="* `info` - Info\n* `success` - Success\n* `warning` - Warning\n* `danger` - Danger",
    )
    comments: constr(min_length=1) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableL2VPNRequest(BaseModel):
    identifier: conint(ge=-9223372036854775808, le=9223372036854775807) | None = None
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    type: (
        Literal[
            "vpws",
            "vpls",
            "vxlan",
            "vxlan-evpn",
            "mpls-evpn",
            "pbb-evpn",
            "evpn-vpws",
            "epl",
            "evpl",
            "ep-lan",
            "evp-lan",
            "ep-tree",
            "evp-tree",
            "spb",
        ]
        | None
    ) = Field(
        None,
        description="* `vpws` - VPWS\n* `vpls` - VPLS\n* `vxlan` - VXLAN\n* `vxlan-evpn` - VXLAN-EVPN\n* `mpls-evpn` - MPLS EVPN\n* `pbb-evpn` - PBB EVPN\n* `evpn-vpws` - EVPN VPWS\n* `epl` - EPL\n* `evpl` - EVPL\n* `ep-lan` - Ethernet Private LAN\n* `evp-lan` - Ethernet Virtual Private LAN\n* `ep-tree` - Ethernet Private Tree\n* `evp-tree` - Ethernet Virtual Private Tree\n* `spb` - SPB",
    )
    status: Literal["active", "planned", "decommissioning"] | None = Field(
        None,
        description="* `active` - Active\n* `planned` - Planned\n* `decommissioning` - Decommissioning",
    )
    import_targets: list[int] | None = None
    export_targets: list[int] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tenant: int | BriefTenantRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableLocationRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    site: int | BriefSiteRequest | None = None
    parent: int | None = None
    status: Literal["planned", "staging", "active", "decommissioning", "retired"] | None = Field(
        None,
        description="* `planned` - Planned\n* `staging` - Staging\n* `active` - Active\n* `decommissioning` - Decommissioning\n* `retired` - Retired",
    )
    tenant: int | BriefTenantRequest | None = None
    facility: constr(max_length=50) | None = Field(
        None, description="Local facility ID or description"
    )
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class PatchedWritableModuleRequest(BaseModel):
    device: int | BriefDeviceRequest | None = None
    module_bay: int | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    status: (
        Literal["offline", "active", "planned", "staged", "failed", "decommissioning"] | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning",
    )
    serial: SerialNumber8 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this device"
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableModuleTypeRequest(BaseModel):
    profile: int | BriefModuleTypeProfileRequest | None = None
    manufacturer: int | BriefManufacturerRequest | None = None
    model: constr(min_length=1, max_length=100) | None = None
    part_number: constr(max_length=50) | None = Field(
        None, description="Discrete part number (optional)"
    )
    airflow: (
        Literal[
            "front-to-rear",
            "rear-to-front",
            "left-to-right",
            "right-to-left",
            "side-to-rear",
            "passive",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front\n* `left-to-right` - Left to right\n* `right-to-left` - Right to left\n* `side-to-rear` - Side to rear\n* `passive` - Passive",
    )
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    description: constr(max_length=200) | None = None
    attributes: Any | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritablePowerFeedRequest(BaseModel):
    power_panel: int | BriefPowerPanelRequest | None = None
    rack: int | BriefRackRequest | None = None
    name: constr(min_length=1, max_length=100) | None = None
    status: Literal["offline", "active", "planned", "failed"] | None = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `failed` - Failed",
    )
    type: Literal["primary", "redundant"] | None = Field(
        None, description="* `primary` - Primary\n* `redundant` - Redundant"
    )
    supply: Literal["ac", "dc"] | None = Field(None, description="* `ac` - AC\n* `dc` - DC")
    phase: Literal["single-phase", "three-phase"] | None = Field(
        None,
        description="* `single-phase` - Single phase\n* `three-phase` - Three-phase",
    )
    voltage: conint(ge=-32768, le=32767) | None = None
    amperage: conint(ge=1, le=32767) | None = None
    max_utilization: conint(ge=1, le=100) | None = Field(
        None, description="Maximum permissible draw (percentage)"
    )
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    description: constr(max_length=200) | None = None
    tenant: int | BriefTenantRequest | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class IsAPool(RootModel[bool]):
    root: bool = Field(
        ...,
        description="All IP addresses within this prefix are considered usable",
        title="Is a pool",
    )


class PatchedWritablePrefixRequest(BaseModel):
    prefix: constr(min_length=1) | None = None
    vrf: int | BriefVRFRequest | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    tenant: int | BriefTenantRequest | None = None
    vlan: int | BriefVLANRequest | None = None
    status: Literal["container", "active", "reserved", "deprecated"] | None = Field(
        None,
        description="Operational status of this prefix\n\n* `container` - Container\n* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    role: int | BriefRoleRequest | None = None
    is_pool: IsAPool | None = Field(
        None,
        description="All IP addresses within this prefix are considered usable",
        title="Is a pool",
    )
    mark_utilized: bool | None = Field(None, description="Treat as fully utilized")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class HeightU(RootModel[conint(ge=1, le=100)]):
    root: conint(ge=1, le=100) = Field(..., description="Height in rack units", title="Height (U)")


class DescendingUnits(RootModel[bool]):
    root: bool = Field(
        ..., description="Units are numbered top-to-bottom", title="Descending units"
    )


class PatchedWritableRackRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    facility_id: constr(max_length=50) | None = None
    site: int | BriefSiteRequest | None = None
    location: int | BriefLocationRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    status: Literal["reserved", "available", "planned", "active", "deprecated"] | None = Field(
        None,
        description="* `reserved` - Reserved\n* `available` - Available\n* `planned` - Planned\n* `active` - Active\n* `deprecated` - Deprecated",
    )
    role: int | BriefRackRoleRequest | None = None
    serial: SerialNumber8 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this rack"
    )
    rack_type: int | BriefRackTypeRequest | None = None
    form_factor: (
        Literal[
            "2-post-frame",
            "4-post-frame",
            "4-post-cabinet",
            "wall-frame",
            "wall-frame-vertical",
            "wall-cabinet",
            "wall-cabinet-vertical",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `2-post-frame` - 2-post frame\n* `4-post-frame` - 4-post frame\n* `4-post-cabinet` - 4-post cabinet\n* `wall-frame` - Wall-mounted frame\n* `wall-frame-vertical` - Wall-mounted frame (vertical)\n* `wall-cabinet` - Wall-mounted cabinet\n* `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)",
    )
    width: Literal[10, 19, 21, 23] | None = Field(
        None,
        description="Rail-to-rail width\n\n* `10` - 10 inches\n* `19` - 19 inches\n* `21` - 21 inches\n* `23` - 23 inches",
    )
    u_height: HeightU | None = Field(None, description="Height in rack units", title="Height (U)")
    starting_unit: conint(ge=1, le=32767) | None = Field(None, description="Starting unit for rack")
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    max_weight: conint(ge=0, le=2147483647) | None = Field(
        None, description="Maximum load capacity for the rack"
    )
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    desc_units: DescendingUnits | None = Field(
        None, description="Units are numbered top-to-bottom", title="Descending units"
    )
    outer_width: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (width)"
    )
    outer_height: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (height)"
    )
    outer_depth: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (depth)"
    )
    outer_unit: Literal["mm", "in", ""] | None = Field(
        None, description="* `mm` - Millimeters\n* `in` - Inches"
    )
    mounting_depth: conint(ge=0, le=32767) | None = Field(
        None,
        description="Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.",
    )
    airflow: Literal["front-to-rear", "rear-to-front", ""] | None = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableRackTypeRequest(BaseModel):
    manufacturer: int | BriefManufacturerRequest | None = None
    model: constr(min_length=1, max_length=100) | None = None
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    description: constr(max_length=200) | None = None
    form_factor: (
        Literal[
            "2-post-frame",
            "4-post-frame",
            "4-post-cabinet",
            "wall-frame",
            "wall-frame-vertical",
            "wall-cabinet",
            "wall-cabinet-vertical",
        ]
        | None
    ) = Field(
        None,
        description="* `2-post-frame` - 2-post frame\n* `4-post-frame` - 4-post frame\n* `4-post-cabinet` - 4-post cabinet\n* `wall-frame` - Wall-mounted frame\n* `wall-frame-vertical` - Wall-mounted frame (vertical)\n* `wall-cabinet` - Wall-mounted cabinet\n* `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)",
    )
    width: Literal[10, 19, 21, 23] | None = Field(
        None,
        description="Rail-to-rail width\n\n* `10` - 10 inches\n* `19` - 19 inches\n* `21` - 21 inches\n* `23` - 23 inches",
    )
    u_height: HeightU | None = Field(None, description="Height in rack units", title="Height (U)")
    starting_unit: conint(ge=1, le=32767) | None = Field(None, description="Starting unit for rack")
    desc_units: DescendingUnits | None = Field(
        None, description="Units are numbered top-to-bottom", title="Descending units"
    )
    outer_width: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (width)"
    )
    outer_height: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (height)"
    )
    outer_depth: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (depth)"
    )
    outer_unit: Literal["mm", "in", ""] | None = Field(
        None, description="* `mm` - Millimeters\n* `in` - Inches"
    )
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    max_weight: conint(ge=0, le=2147483647) | None = Field(
        None, description="Maximum load capacity for the rack"
    )
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    mounting_depth: conint(ge=0, le=32767) | None = Field(
        None,
        description="Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableRegionRequest(PatchedWritableContactGroupRequest):
    pass


class PortNumbers(RootModel[list[conint(ge=1, le=65535)]]):
    root: list[conint(ge=1, le=65535)] = Field(..., title="Port numbers")


class PatchedWritableServiceRequest(BaseModel):
    parent_object_type: str | None = None
    parent_object_id: conint(ge=0, le=9223372036854775807) | None = None
    name: constr(min_length=1, max_length=100) | None = None
    protocol: Literal["tcp", "udp", "sctp"] | None = Field(
        None, description="* `tcp` - TCP\n* `udp` - UDP\n* `sctp` - SCTP"
    )
    ports: PortNumbers | None = Field(None, title="Port numbers")
    ipaddresses: list[int] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableServiceTemplateRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    protocol: Literal["tcp", "udp", "sctp"] | None = Field(
        None, description="* `tcp` - TCP\n* `udp` - UDP\n* `sctp` - SCTP"
    )
    ports: PortNumbers | None = Field(None, title="Port numbers")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableSiteGroupRequest(PatchedWritableContactGroupRequest):
    pass


class PatchedWritableSiteRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = Field(
        None, description="Full name of the site"
    )
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100) | None = None
    status: Literal["planned", "staging", "active", "decommissioning", "retired"] | None = Field(
        None,
        description="* `planned` - Planned\n* `staging` - Staging\n* `active` - Active\n* `decommissioning` - Decommissioning\n* `retired` - Retired",
    )
    region: int | BriefRegionRequest | None = None
    group: int | BriefSiteGroupRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    facility: constr(max_length=50) | None = Field(
        None, description="Local facility ID or description"
    )
    time_zone: constr(min_length=1) | None = None
    description: constr(max_length=200) | None = None
    physical_address: constr(max_length=200) | None = Field(
        None, description="Physical location of the building"
    )
    shipping_address: constr(max_length=200) | None = Field(
        None, description="If different from the physical address"
    )
    latitude: confloat(lt=100.0, gt=-100.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    longitude: confloat(lt=1000.0, gt=-1000.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    comments: str | None = None
    asns: list[int] | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableTenantGroupRequest(PatchedWritableContactGroupRequest):
    pass


class PatchedWritableTunnelRequest(BaseModel):
    name: constr(min_length=1, max_length=100) | None = None
    status: Literal["planned", "active", "disabled"] | None = Field(
        None,
        description="* `planned` - Planned\n* `active` - Active\n* `disabled` - Disabled",
    )
    group: int | BriefTunnelGroupRequest | None = None
    encapsulation: (
        Literal[
            "ipsec-transport",
            "ipsec-tunnel",
            "ip-ip",
            "gre",
            "wireguard",
            "openvpn",
            "l2tp",
            "pptp",
        ]
        | None
    ) = Field(
        None,
        description="* `ipsec-transport` - IPsec - Transport\n* `ipsec-tunnel` - IPsec - Tunnel\n* `ip-ip` - IP-in-IP\n* `gre` - GRE\n* `wireguard` - WireGuard\n* `openvpn` - OpenVPN\n* `l2tp` - L2TP\n* `pptp` - PPTP",
    )
    ipsec_profile: int | BriefIPSecProfileRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    tunnel_id: conint(ge=0, le=9223372036854775807) | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableTunnelTerminationRequest(BaseModel):
    tunnel: int | BriefTunnelRequest | None = None
    role: Literal["peer", "hub", "spoke"] | None = Field(
        None, description="* `peer` - Peer\n* `hub` - Hub\n* `spoke` - Spoke"
    )
    termination_type: str | None = None
    termination_id: conint(ge=0, le=9223372036854775807) | None = None
    outside_ip: int | BriefIPAddressRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class QInQRole(RootModel[Literal["svlan", "cvlan", ""] | None]):
    root: Literal["svlan", "cvlan", ""] | None = Field(
        None,
        description="Customer/service VLAN designation (for Q-in-Q/IEEE 802.1ad)\n\n* `svlan` - Service\n* `cvlan` - Customer",
        title="Q-in-Q role",
    )


class PatchedWritableVLANRequest(BaseModel):
    site: int | BriefSiteRequest | None = None
    group: int | BriefVLANGroupRequest | None = None
    vid: VLANID | None = Field(None, description="Numeric VLAN ID (1-4094)", title="VLAN ID")
    name: constr(min_length=1, max_length=64) | None = None
    tenant: int | BriefTenantRequest | None = None
    status: Literal["active", "reserved", "deprecated"] | None = Field(
        None,
        description="Operational status of this VLAN\n\n* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    role: int | BriefRoleRequest | None = None
    description: constr(max_length=200) | None = None
    qinq_role: QInQRole | None = Field(
        None,
        description="Customer/service VLAN designation (for Q-in-Q/IEEE 802.1ad)\n\n* `svlan` - Service\n* `cvlan` - Customer",
        title="Q-in-Q role",
    )
    qinq_svlan: int | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableVMInterfaceRequest(BaseModel):
    virtual_machine: int | BriefVirtualMachineRequest | None = None
    name: constr(min_length=1, max_length=64) | None = None
    enabled: bool | None = None
    parent: ParentInterface | None = Field(None, title="Parent interface")
    bridge: BridgeInterface | None = Field(None, title="Bridge interface")
    mtu: conint(ge=1, le=65536) | None = None
    primary_mac_address: int | BriefMACAddressRequest | None = None
    description: constr(max_length=200) | None = None
    mode: Literal["access", "tagged", "tagged-all", "q-in-q", ""] | None = Field(
        None,
        description="IEEE 802.1Q tagging strategy\n\n* `access` - Access\n* `tagged` - Tagged\n* `tagged-all` - Tagged (All)\n* `q-in-q` - Q-in-Q (802.1ad)",
    )
    untagged_vlan: int | BriefVLANRequest | None = None
    tagged_vlans: list[int] | None = None
    qinq_svlan: int | BriefVLANRequest | None = None
    vlan_translation_policy: int | BriefVLANTranslationPolicyRequest | None = None
    vrf: int | BriefVRFRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableVirtualChassisRequest(BaseModel):
    name: constr(min_length=1, max_length=64) | None = None
    domain: constr(max_length=30) | None = None
    master: int | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableVirtualCircuitRequest(BaseModel):
    cid: CircuitID5 | None = Field(None, description="Unique circuit ID", title="Circuit ID")
    provider_network: int | BriefProviderNetworkRequest | None = None
    provider_account: int | BriefProviderAccountRequest | None = None
    type: int | BriefVirtualCircuitTypeRequest | None = None
    status: (
        Literal[
            "planned",
            "provisioning",
            "active",
            "offline",
            "deprovisioning",
            "decommissioned",
        ]
        | None
    ) = Field(
        None,
        description="* `planned` - Planned\n* `provisioning` - Provisioning\n* `active` - Active\n* `offline` - Offline\n* `deprovisioning` - Deprovisioning\n* `decommissioned` - Decommissioned",
    )
    tenant: int | BriefTenantRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableVirtualCircuitTerminationRequest(BaseModel):
    virtual_circuit: int | BriefVirtualCircuitRequest | None = None
    role: Literal["peer", "hub", "spoke"] | None = Field(
        None, description="* `peer` - Peer\n* `hub` - Hub\n* `spoke` - Spoke"
    )
    interface: int | BriefInterfaceRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableVirtualDeviceContextRequest(BaseModel):
    name: constr(min_length=1, max_length=64) | None = None
    device: int | BriefDeviceRequest | None = None
    identifier: conint(ge=0, le=32767) | None = None
    tenant: int | BriefTenantRequest | None = None
    primary_ip4: int | BriefIPAddressRequest | None = None
    primary_ip6: int | BriefIPAddressRequest | None = None
    status: Literal["active", "planned", "offline"] | None = Field(
        None,
        description="* `active` - Active\n* `planned` - Planned\n* `offline` - Offline",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class MemoryMB(RootModel[conint(ge=0, le=2147483647) | None]):
    root: conint(ge=0, le=2147483647) | None = Field(None, title="Memory (MB)")


class DiskMB(RootModel[conint(ge=0, le=2147483647) | None]):
    root: conint(ge=0, le=2147483647) | None = Field(None, title="Disk (MB)")


class PatchedWritableVirtualMachineWithConfigContextRequest(BaseModel):
    name: constr(min_length=1, max_length=64) | None = None
    status: (
        Literal[
            "offline",
            "active",
            "planned",
            "staged",
            "failed",
            "decommissioning",
            "paused",
        ]
        | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning\n* `paused` - Paused",
    )
    site: int | BriefSiteRequest | None = None
    cluster: int | BriefClusterRequest | None = None
    device: int | BriefDeviceRequest | None = None
    serial: SerialNumber8 | None = Field(None, title="Serial number")
    role: int | BriefDeviceRoleRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    platform: int | BriefPlatformRequest | None = None
    primary_ip4: int | BriefIPAddressRequest | None = None
    primary_ip6: int | BriefIPAddressRequest | None = None
    vcpus: confloat(ge=0.01, lt=10000.0) | None = None
    memory: MemoryMB | None = Field(None, title="Memory (MB)")
    disk: DiskMB | None = Field(None, title="Disk (MB)")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    config_template: int | BriefConfigTemplateRequest | None = None
    local_context_data: Any | None = Field(
        None,
        description="Local config context data takes precedence over source contexts in the final rendered config context",
    )
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableWirelessLANGroupRequest(PatchedWritableContactGroupRequest):
    pass


class AuthenticationType3(
    RootModel[Literal["open", "wep", "wpa-personal", "wpa-enterprise", ""] | None]
):
    root: Literal["open", "wep", "wpa-personal", "wpa-enterprise", ""] | None = Field(
        None,
        description="* `open` - Open\n* `wep` - WEP\n* `wpa-personal` - WPA Personal (PSK)\n* `wpa-enterprise` - WPA Enterprise",
        title="Authentication type",
    )


class AuthenticationCipher(RootModel[Literal["auto", "tkip", "aes", ""] | None]):
    root: Literal["auto", "tkip", "aes", ""] | None = Field(
        None,
        description="* `auto` - Auto\n* `tkip` - TKIP\n* `aes` - AES",
        title="Authentication cipher",
    )


class PreSharedKey3(RootModel[constr(max_length=64)]):
    root: constr(max_length=64) = Field(..., title="Pre-shared key")


class PatchedWritableWirelessLANRequest(BaseModel):
    ssid: constr(min_length=1, max_length=32) | None = None
    description: constr(max_length=200) | None = None
    group: int | BriefWirelessLANGroupRequest | None = None
    status: Literal["active", "reserved", "disabled", "deprecated"] | None = Field(
        None,
        description="* `active` - Active\n* `reserved` - Reserved\n* `disabled` - Disabled\n* `deprecated` - Deprecated",
    )
    vlan: int | BriefVLANRequest | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    tenant: int | BriefTenantRequest | None = None
    auth_type: AuthenticationType3 | None = Field(
        None,
        description="* `open` - Open\n* `wep` - WEP\n* `wpa-personal` - WPA Personal (PSK)\n* `wpa-enterprise` - WPA Enterprise",
        title="Authentication type",
    )
    auth_cipher: AuthenticationCipher | None = Field(
        None,
        description="* `auto` - Auto\n* `tkip` - TKIP\n* `aes` - AES",
        title="Authentication cipher",
    )
    auth_psk: PreSharedKey3 | None = Field(None, title="Pre-shared key")
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableWirelessLinkRequest(BaseModel):
    interface_a: int | BriefInterfaceRequest | None = None
    interface_b: int | BriefInterfaceRequest | None = None
    ssid: constr(max_length=32) | None = None
    status: Literal["connected", "planned", "decommissioning"] | None = Field(
        None,
        description="* `connected` - Connected\n* `planned` - Planned\n* `decommissioning` - Decommissioning",
    )
    tenant: int | BriefTenantRequest | None = None
    auth_type: AuthenticationType3 | None = Field(
        None,
        description="* `open` - Open\n* `wep` - WEP\n* `wpa-personal` - WPA Personal (PSK)\n* `wpa-enterprise` - WPA Enterprise",
        title="Authentication type",
    )
    auth_cipher: AuthenticationCipher | None = Field(
        None,
        description="* `auto` - Auto\n* `tkip` - TKIP\n* `aes` - AES",
        title="Authentication cipher",
    )
    auth_psk: PreSharedKey3 | None = Field(None, title="Pre-shared key")
    distance: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    distance_unit: Literal["km", "m", "mi", "ft", ""] | None = Field(
        None,
        description="* `km` - Kilometers\n* `m` - Meters\n* `mi` - Miles\n* `ft` - Feet",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Platform(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    manufacturer: BriefManufacturer | None = None
    config_template: BriefConfigTemplate | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    device_count: int | None = None
    virtualmachine_count: int | None = None


class PlatformRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    manufacturer: int | BriefManufacturerRequest | None = None
    config_template: int | BriefConfigTemplateRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Status14(BaseModel):
    value: Literal["offline", "active", "planned", "failed"] | None = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `failed` - Failed",
    )
    label: Literal["Offline", "Active", "Planned", "Failed"] | None = None


class Type12(BaseModel):
    value: Literal["primary", "redundant"] | None = Field(
        None, description="* `primary` - Primary\n* `redundant` - Redundant"
    )
    label: Literal["Primary", "Redundant"] | None = None


class Supply(BaseModel):
    value: Literal["ac", "dc"] | None = Field(None, description="* `ac` - AC\n* `dc` - DC")
    label: Literal["AC", "DC"] | None = None


class Phase(BaseModel):
    value: Literal["single-phase", "three-phase"] | None = Field(
        None,
        description="* `single-phase` - Single phase\n* `three-phase` - Three-phase",
    )
    label: Literal["Single phase", "Three-phase"] | None = None


class PowerFeed(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    power_panel: BriefPowerPanel
    rack: BriefRack | None = None
    name: constr(max_length=100)
    status: Status14 | None = None
    type: Type12 | None = None
    supply: Supply | None = None
    phase: Phase | None = None
    voltage: conint(ge=-32768, le=32767) | None = None
    amperage: conint(ge=1, le=32767) | None = None
    max_utilization: conint(ge=1, le=100) | None = Field(
        None, description="Maximum permissible draw (percentage)"
    )
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    cable: BriefCable | None = None
    cable_end: str | None = None
    link_peers: list[Any]
    link_peers_type: str | None = Field(
        None, description="Return the type of the peer link terminations, or None."
    )
    connected_endpoints: list[Any] | None = None
    connected_endpoints_type: str | None = None
    connected_endpoints_reachable: bool
    description: constr(max_length=200) | None = None
    tenant: BriefTenant | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    field_occupied: FieldOccupied = Field(..., alias="_occupied", title=" occupied")


class PowerFeedRequest(BaseModel):
    power_panel: int | BriefPowerPanelRequest
    rack: int | BriefRackRequest | None = None
    name: constr(min_length=1, max_length=100)
    status: Literal["offline", "active", "planned", "failed"] | None = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `failed` - Failed",
    )
    type: Literal["primary", "redundant"] | None = Field(
        None, description="* `primary` - Primary\n* `redundant` - Redundant"
    )
    supply: Literal["ac", "dc"] | None = Field(None, description="* `ac` - AC\n* `dc` - DC")
    phase: Literal["single-phase", "three-phase"] | None = Field(
        None,
        description="* `single-phase` - Single phase\n* `three-phase` - Three-phase",
    )
    voltage: conint(ge=-32768, le=32767) | None = None
    amperage: conint(ge=1, le=32767) | None = None
    max_utilization: conint(ge=1, le=100) | None = Field(
        None, description="Maximum permissible draw (percentage)"
    )
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    description: constr(max_length=200) | None = None
    tenant: int | BriefTenantRequest | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Type13(BaseModel):
    value: (
        Literal[
            "iec-60320-c5",
            "iec-60320-c7",
            "iec-60320-c13",
            "iec-60320-c15",
            "iec-60320-c19",
            "iec-60320-c21",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15r",
            "nema-5-15r",
            "nema-5-20r",
            "nema-5-30r",
            "nema-5-50r",
            "nema-6-15r",
            "nema-6-20r",
            "nema-6-30r",
            "nema-6-50r",
            "nema-10-30r",
            "nema-10-50r",
            "nema-14-20r",
            "nema-14-30r",
            "nema-14-50r",
            "nema-14-60r",
            "nema-15-15r",
            "nema-15-20r",
            "nema-15-30r",
            "nema-15-50r",
            "nema-15-60r",
            "nema-l1-15r",
            "nema-l5-15r",
            "nema-l5-20r",
            "nema-l5-30r",
            "nema-l5-50r",
            "nema-l6-15r",
            "nema-l6-20r",
            "nema-l6-30r",
            "nema-l6-50r",
            "nema-l10-30r",
            "nema-l14-20r",
            "nema-l14-30r",
            "nema-l14-50r",
            "nema-l14-60r",
            "nema-l15-20r",
            "nema-l15-30r",
            "nema-l15-50r",
            "nema-l15-60r",
            "nema-l21-20r",
            "nema-l21-30r",
            "nema-l22-20r",
            "nema-l22-30r",
            "CS6360C",
            "CS6364C",
            "CS8164C",
            "CS8264C",
            "CS8364C",
            "CS8464C",
            "ita-e",
            "ita-f",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "ita-multistandard",
            "usb-a",
            "usb-micro-b",
            "usb-c",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "eaton-c39",
            "hdot-cx",
            "saf-d-grid",
            "neutrik-powercon-20a",
            "neutrik-powercon-32a",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `iec-60320-c5` - C5\n* `iec-60320-c7` - C7\n* `iec-60320-c13` - C13\n* `iec-60320-c15` - C15\n* `iec-60320-c19` - C19\n* `iec-60320-c21` - C21\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15r` - NEMA 1-15R\n* `nema-5-15r` - NEMA 5-15R\n* `nema-5-20r` - NEMA 5-20R\n* `nema-5-30r` - NEMA 5-30R\n* `nema-5-50r` - NEMA 5-50R\n* `nema-6-15r` - NEMA 6-15R\n* `nema-6-20r` - NEMA 6-20R\n* `nema-6-30r` - NEMA 6-30R\n* `nema-6-50r` - NEMA 6-50R\n* `nema-10-30r` - NEMA 10-30R\n* `nema-10-50r` - NEMA 10-50R\n* `nema-14-20r` - NEMA 14-20R\n* `nema-14-30r` - NEMA 14-30R\n* `nema-14-50r` - NEMA 14-50R\n* `nema-14-60r` - NEMA 14-60R\n* `nema-15-15r` - NEMA 15-15R\n* `nema-15-20r` - NEMA 15-20R\n* `nema-15-30r` - NEMA 15-30R\n* `nema-15-50r` - NEMA 15-50R\n* `nema-15-60r` - NEMA 15-60R\n* `nema-l1-15r` - NEMA L1-15R\n* `nema-l5-15r` - NEMA L5-15R\n* `nema-l5-20r` - NEMA L5-20R\n* `nema-l5-30r` - NEMA L5-30R\n* `nema-l5-50r` - NEMA L5-50R\n* `nema-l6-15r` - NEMA L6-15R\n* `nema-l6-20r` - NEMA L6-20R\n* `nema-l6-30r` - NEMA L6-30R\n* `nema-l6-50r` - NEMA L6-50R\n* `nema-l10-30r` - NEMA L10-30R\n* `nema-l14-20r` - NEMA L14-20R\n* `nema-l14-30r` - NEMA L14-30R\n* `nema-l14-50r` - NEMA L14-50R\n* `nema-l14-60r` - NEMA L14-60R\n* `nema-l15-20r` - NEMA L15-20R\n* `nema-l15-30r` - NEMA L15-30R\n* `nema-l15-50r` - NEMA L15-50R\n* `nema-l15-60r` - NEMA L15-60R\n* `nema-l21-20r` - NEMA L21-20R\n* `nema-l21-30r` - NEMA L21-30R\n* `nema-l22-20r` - NEMA L22-20R\n* `nema-l22-30r` - NEMA L22-30R\n* `CS6360C` - CS6360C\n* `CS6364C` - CS6364C\n* `CS8164C` - CS8164C\n* `CS8264C` - CS8264C\n* `CS8364C` - CS8364C\n* `CS8464C` - CS8464C\n* `ita-e` - ITA Type E (CEE 7/5)\n* `ita-f` - ITA Type F (CEE 7/3)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `ita-multistandard` - ITA Multistandard\n* `usb-a` - USB Type A\n* `usb-micro-b` - USB Micro B\n* `usb-c` - USB Type C\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `eaton-c39` - Eaton C39\n* `hdot-cx` - HDOT Cx\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20a` - Neutrik powerCON (20A)\n* `neutrik-powercon-32a` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    label: (
        Literal[
            "C5",
            "C7",
            "C13",
            "C15",
            "C19",
            "C21",
            "P+N+E 4H",
            "P+N+E 6H",
            "P+N+E 9H",
            "2P+E 4H",
            "2P+E 6H",
            "2P+E 9H",
            "3P+E 4H",
            "3P+E 6H",
            "3P+E 9H",
            "3P+N+E 4H",
            "3P+N+E 6H",
            "3P+N+E 9H",
            "IEC 60906-1",
            "2P+T 10A (NBR 14136)",
            "2P+T 20A (NBR 14136)",
            "NEMA 1-15R",
            "NEMA 5-15R",
            "NEMA 5-20R",
            "NEMA 5-30R",
            "NEMA 5-50R",
            "NEMA 6-15R",
            "NEMA 6-20R",
            "NEMA 6-30R",
            "NEMA 6-50R",
            "NEMA 10-30R",
            "NEMA 10-50R",
            "NEMA 14-20R",
            "NEMA 14-30R",
            "NEMA 14-50R",
            "NEMA 14-60R",
            "NEMA 15-15R",
            "NEMA 15-20R",
            "NEMA 15-30R",
            "NEMA 15-50R",
            "NEMA 15-60R",
            "NEMA L1-15R",
            "NEMA L5-15R",
            "NEMA L5-20R",
            "NEMA L5-30R",
            "NEMA L5-50R",
            "NEMA L6-15R",
            "NEMA L6-20R",
            "NEMA L6-30R",
            "NEMA L6-50R",
            "NEMA L10-30R",
            "NEMA L14-20R",
            "NEMA L14-30R",
            "NEMA L14-50R",
            "NEMA L14-60R",
            "NEMA L15-20R",
            "NEMA L15-30R",
            "NEMA L15-50R",
            "NEMA L15-60R",
            "NEMA L21-20R",
            "NEMA L21-30R",
            "NEMA L22-20R",
            "NEMA L22-30R",
            "CS6360C",
            "CS6364C",
            "CS8164C",
            "CS8264C",
            "CS8364C",
            "CS8464C",
            "ITA Type E (CEE 7/5)",
            "ITA Type F (CEE 7/3)",
            "ITA Type G (BS 1363)",
            "ITA Type H",
            "ITA Type I",
            "ITA Type J",
            "ITA Type K",
            "ITA Type L (CEI 23-50)",
            "ITA Type M (BS 546)",
            "ITA Type N",
            "ITA Type O",
            "ITA Multistandard",
            "USB Type A",
            "USB Micro B",
            "USB Type C",
            "Molex Micro-Fit 1x2",
            "Molex Micro-Fit 2x2",
            "Molex Micro-Fit 2x4",
            "DC Terminal",
            "Eaton C39",
            "HDOT Cx",
            "Saf-D-Grid",
            "Neutrik powerCON (20A)",
            "Neutrik powerCON (32A)",
            "Neutrik powerCON TRUE1",
            "Neutrik powerCON TRUE1 TOP",
            "Ubiquiti SmartPower",
            "Hardwired",
            "Other",
        ]
        | None
    ) = None


class Status15(BaseModel):
    value: Literal["enabled", "disabled", "faulty"] | None = Field(
        None,
        description="* `enabled` - Enabled\n* `disabled` - Disabled\n* `faulty` - Faulty",
    )
    label: Literal["Enabled", "Disabled", "Faulty"] | None = None


class FeedLeg(BaseModel):
    value: Literal["A", "B", "C", ""] | None = Field(
        None, description="* `A` - A\n* `B` - B\n* `C` - C"
    )
    label: Literal["A", "B", "C"] | None = None


class PowerPanel(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    site: BriefSite
    location: BriefLocation | None = None
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    powerfeed_count: int | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class PowerPanelRequest(BaseModel):
    site: int | BriefSiteRequest
    location: int | BriefLocationRequest | None = None
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Type15(BaseModel):
    value: (
        Literal[
            "iec-60320-c6",
            "iec-60320-c8",
            "iec-60320-c14",
            "iec-60320-c16",
            "iec-60320-c20",
            "iec-60320-c22",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15p",
            "nema-5-15p",
            "nema-5-20p",
            "nema-5-30p",
            "nema-5-50p",
            "nema-6-15p",
            "nema-6-20p",
            "nema-6-30p",
            "nema-6-50p",
            "nema-10-30p",
            "nema-10-50p",
            "nema-14-20p",
            "nema-14-30p",
            "nema-14-50p",
            "nema-14-60p",
            "nema-15-15p",
            "nema-15-20p",
            "nema-15-30p",
            "nema-15-50p",
            "nema-15-60p",
            "nema-l1-15p",
            "nema-l5-15p",
            "nema-l5-20p",
            "nema-l5-30p",
            "nema-l5-50p",
            "nema-l6-15p",
            "nema-l6-20p",
            "nema-l6-30p",
            "nema-l6-50p",
            "nema-l10-30p",
            "nema-l14-20p",
            "nema-l14-30p",
            "nema-l14-50p",
            "nema-l14-60p",
            "nema-l15-20p",
            "nema-l15-30p",
            "nema-l15-50p",
            "nema-l15-60p",
            "nema-l21-20p",
            "nema-l21-30p",
            "nema-l22-20p",
            "nema-l22-30p",
            "cs6361c",
            "cs6365c",
            "cs8165c",
            "cs8265c",
            "cs8365c",
            "cs8465c",
            "ita-c",
            "ita-e",
            "ita-f",
            "ita-ef",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "usb-3-b",
            "usb-3-micro-b",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "saf-d-grid",
            "neutrik-powercon-20",
            "neutrik-powercon-32",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `iec-60320-c6` - C6\n* `iec-60320-c8` - C8\n* `iec-60320-c14` - C14\n* `iec-60320-c16` - C16\n* `iec-60320-c20` - C20\n* `iec-60320-c22` - C22\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15p` - NEMA 1-15P\n* `nema-5-15p` - NEMA 5-15P\n* `nema-5-20p` - NEMA 5-20P\n* `nema-5-30p` - NEMA 5-30P\n* `nema-5-50p` - NEMA 5-50P\n* `nema-6-15p` - NEMA 6-15P\n* `nema-6-20p` - NEMA 6-20P\n* `nema-6-30p` - NEMA 6-30P\n* `nema-6-50p` - NEMA 6-50P\n* `nema-10-30p` - NEMA 10-30P\n* `nema-10-50p` - NEMA 10-50P\n* `nema-14-20p` - NEMA 14-20P\n* `nema-14-30p` - NEMA 14-30P\n* `nema-14-50p` - NEMA 14-50P\n* `nema-14-60p` - NEMA 14-60P\n* `nema-15-15p` - NEMA 15-15P\n* `nema-15-20p` - NEMA 15-20P\n* `nema-15-30p` - NEMA 15-30P\n* `nema-15-50p` - NEMA 15-50P\n* `nema-15-60p` - NEMA 15-60P\n* `nema-l1-15p` - NEMA L1-15P\n* `nema-l5-15p` - NEMA L5-15P\n* `nema-l5-20p` - NEMA L5-20P\n* `nema-l5-30p` - NEMA L5-30P\n* `nema-l5-50p` - NEMA L5-50P\n* `nema-l6-15p` - NEMA L6-15P\n* `nema-l6-20p` - NEMA L6-20P\n* `nema-l6-30p` - NEMA L6-30P\n* `nema-l6-50p` - NEMA L6-50P\n* `nema-l10-30p` - NEMA L10-30P\n* `nema-l14-20p` - NEMA L14-20P\n* `nema-l14-30p` - NEMA L14-30P\n* `nema-l14-50p` - NEMA L14-50P\n* `nema-l14-60p` - NEMA L14-60P\n* `nema-l15-20p` - NEMA L15-20P\n* `nema-l15-30p` - NEMA L15-30P\n* `nema-l15-50p` - NEMA L15-50P\n* `nema-l15-60p` - NEMA L15-60P\n* `nema-l21-20p` - NEMA L21-20P\n* `nema-l21-30p` - NEMA L21-30P\n* `nema-l22-20p` - NEMA L22-20P\n* `nema-l22-30p` - NEMA L22-30P\n* `cs6361c` - CS6361C\n* `cs6365c` - CS6365C\n* `cs8165c` - CS8165C\n* `cs8265c` - CS8265C\n* `cs8365c` - CS8365C\n* `cs8465c` - CS8465C\n* `ita-c` - ITA Type C (CEE 7/16)\n* `ita-e` - ITA Type E (CEE 7/6)\n* `ita-f` - ITA Type F (CEE 7/4)\n* `ita-ef` - ITA Type E/F (CEE 7/7)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `usb-3-b` - USB 3.0 Type B\n* `usb-3-micro-b` - USB 3.0 Micro B\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20` - Neutrik powerCON (20A)\n* `neutrik-powercon-32` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    label: (
        Literal[
            "C6",
            "C8",
            "C14",
            "C16",
            "C20",
            "C22",
            "P+N+E 4H",
            "P+N+E 6H",
            "P+N+E 9H",
            "2P+E 4H",
            "2P+E 6H",
            "2P+E 9H",
            "3P+E 4H",
            "3P+E 6H",
            "3P+E 9H",
            "3P+N+E 4H",
            "3P+N+E 6H",
            "3P+N+E 9H",
            "IEC 60906-1",
            "2P+T 10A (NBR 14136)",
            "2P+T 20A (NBR 14136)",
            "NEMA 1-15P",
            "NEMA 5-15P",
            "NEMA 5-20P",
            "NEMA 5-30P",
            "NEMA 5-50P",
            "NEMA 6-15P",
            "NEMA 6-20P",
            "NEMA 6-30P",
            "NEMA 6-50P",
            "NEMA 10-30P",
            "NEMA 10-50P",
            "NEMA 14-20P",
            "NEMA 14-30P",
            "NEMA 14-50P",
            "NEMA 14-60P",
            "NEMA 15-15P",
            "NEMA 15-20P",
            "NEMA 15-30P",
            "NEMA 15-50P",
            "NEMA 15-60P",
            "NEMA L1-15P",
            "NEMA L5-15P",
            "NEMA L5-20P",
            "NEMA L5-30P",
            "NEMA L5-50P",
            "NEMA L6-15P",
            "NEMA L6-20P",
            "NEMA L6-30P",
            "NEMA L6-50P",
            "NEMA L10-30P",
            "NEMA L14-20P",
            "NEMA L14-30P",
            "NEMA L14-50P",
            "NEMA L14-60P",
            "NEMA L15-20P",
            "NEMA L15-30P",
            "NEMA L15-50P",
            "NEMA L15-60P",
            "NEMA L21-20P",
            "NEMA L21-30P",
            "NEMA L22-20P",
            "NEMA L22-30P",
            "CS6361C",
            "CS6365C",
            "CS8165C",
            "CS8265C",
            "CS8365C",
            "CS8465C",
            "ITA Type C (CEE 7/16)",
            "ITA Type E (CEE 7/6)",
            "ITA Type F (CEE 7/4)",
            "ITA Type E/F (CEE 7/7)",
            "ITA Type G (BS 1363)",
            "ITA Type H",
            "ITA Type I",
            "ITA Type J",
            "ITA Type K",
            "ITA Type L (CEI 23-50)",
            "ITA Type M (BS 546)",
            "ITA Type N",
            "ITA Type O",
            "USB Type A",
            "USB Type B",
            "USB Type C",
            "USB Mini A",
            "USB Mini B",
            "USB Micro A",
            "USB Micro B",
            "USB Micro AB",
            "USB 3.0 Type B",
            "USB 3.0 Micro B",
            "Molex Micro-Fit 1x2",
            "Molex Micro-Fit 2x2",
            "Molex Micro-Fit 2x4",
            "DC Terminal",
            "Saf-D-Grid",
            "Neutrik powerCON (20A)",
            "Neutrik powerCON (32A)",
            "Neutrik powerCON TRUE1",
            "Neutrik powerCON TRUE1 TOP",
            "Ubiquiti SmartPower",
            "Hardwired",
            "Other",
        ]
        | None
    ) = None


class Status16(BaseModel):
    value: Literal["container", "active", "reserved", "deprecated"] | None = Field(
        None,
        description="* `container` - Container\n* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    label: Literal["Container", "Active", "Reserved", "Deprecated"] | None = None


class Prefix(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    family: Family
    prefix: str
    vrf: BriefVRF | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    scope: Any | None = None
    tenant: BriefTenant | None = None
    vlan: BriefVLAN | None = None
    status: Status16 | None = None
    role: BriefRole | None = None
    is_pool: IsAPool | None = Field(
        None,
        description="All IP addresses within this prefix are considered usable",
        title="Is a pool",
    )
    mark_utilized: bool | None = Field(None, description="Treat as fully utilized")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    children: int
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class PrefixRequest(BaseModel):
    prefix: constr(min_length=1)
    vrf: int | BriefVRFRequest | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    tenant: int | BriefTenantRequest | None = None
    vlan: int | BriefVLANRequest | None = None
    status: Literal["container", "active", "reserved", "deprecated"] | None = Field(
        None,
        description="* `container` - Container\n* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    role: int | BriefRoleRequest | None = None
    is_pool: IsAPool | None = Field(
        None,
        description="All IP addresses within this prefix are considered usable",
        title="Is a pool",
    )
    mark_utilized: bool | None = Field(None, description="Treat as fully utilized")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class AccountID4(AccountID):
    pass


class ProviderAccount(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    provider: BriefProvider
    name: constr(max_length=100) | None = ""
    account: AccountID4 = Field(..., title="Account ID")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class AccountID5(AccountID1):
    pass


class ProviderAccountRequest(BaseModel):
    provider: int | BriefProviderRequest
    name: constr(max_length=100) | None = ""
    account: AccountID5 = Field(..., title="Account ID")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ProviderNetwork(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    provider: BriefProvider
    name: constr(max_length=100)
    service_id: constr(max_length=100) | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ProviderNetworkRequest(BaseModel):
    provider: int | BriefProviderRequest
    name: constr(min_length=1, max_length=100)
    service_id: constr(max_length=100) | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ProviderRequest(BaseModel):
    name: constr(min_length=1, max_length=100) = Field(..., description="Full name of the provider")
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    accounts: list[int] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    asns: list[int] | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class RIR(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    is_private: Private | None = Field(
        None,
        description="IP space managed by this RIR is considered private",
        title="Private",
    )
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    aggregate_count: int | None = None


class RIRRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    is_private: Private | None = Field(
        None,
        description="IP space managed by this RIR is considered private",
        title="Private",
    )
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Status17(BaseModel):
    value: Literal["reserved", "available", "planned", "active", "deprecated"] | None = Field(
        None,
        description="* `reserved` - Reserved\n* `available` - Available\n* `planned` - Planned\n* `active` - Active\n* `deprecated` - Deprecated",
    )
    label: Literal["Reserved", "Available", "Planned", "Active", "Deprecated"] | None = None


class FormFactor(BaseModel):
    value: (
        Literal[
            "2-post-frame",
            "4-post-frame",
            "4-post-cabinet",
            "wall-frame",
            "wall-frame-vertical",
            "wall-cabinet",
            "wall-cabinet-vertical",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `2-post-frame` - 2-post frame\n* `4-post-frame` - 4-post frame\n* `4-post-cabinet` - 4-post cabinet\n* `wall-frame` - Wall-mounted frame\n* `wall-frame-vertical` - Wall-mounted frame (vertical)\n* `wall-cabinet` - Wall-mounted cabinet\n* `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)",
    )
    label: (
        Literal[
            "2-post frame",
            "4-post frame",
            "4-post cabinet",
            "Wall-mounted frame",
            "Wall-mounted frame (vertical)",
            "Wall-mounted cabinet",
            "Wall-mounted cabinet (vertical)",
        ]
        | None
    ) = None


class Width(BaseModel):
    value: Literal[10, 19, 21, 23] | None = Field(
        None,
        description="* `10` - 10 inches\n* `19` - 19 inches\n* `21` - 21 inches\n* `23` - 23 inches",
    )
    label: Literal["10 inches", "19 inches", "21 inches", "23 inches"] | None = None


class OuterUnit(BaseModel):
    value: Literal["mm", "in", ""] | None = Field(
        None, description="* `mm` - Millimeters\n* `in` - Inches"
    )
    label: Literal["Millimeters", "Inches"] | None = None


class Airflow4(BaseModel):
    value: Literal["front-to-rear", "rear-to-front", ""] | None = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front",
    )
    label: Literal["Front to rear", "Rear to front"] | None = None


class Rack(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    facility_id: constr(max_length=50) | None = None
    site: BriefSite
    location: BriefLocation | None = None
    tenant: BriefTenant | None = None
    status: Status17 | None = None
    role: BriefRackRole | None = None
    serial: SerialNumber8 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this rack"
    )
    rack_type: BriefRackType | None = None
    form_factor: FormFactor | None = None
    width: Width | None = None
    u_height: HeightU | None = Field(None, description="Height in rack units", title="Height (U)")
    starting_unit: conint(ge=1, le=32767) | None = Field(None, description="Starting unit for rack")
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    max_weight: conint(ge=0, le=2147483647) | None = Field(
        None, description="Maximum load capacity for the rack"
    )
    weight_unit: WeightUnit | None = None
    desc_units: DescendingUnits | None = Field(
        None, description="Units are numbered top-to-bottom", title="Descending units"
    )
    outer_width: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (width)"
    )
    outer_height: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (height)"
    )
    outer_depth: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (depth)"
    )
    outer_unit: OuterUnit | None = None
    mounting_depth: conint(ge=0, le=32767) | None = Field(
        None,
        description="Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.",
    )
    airflow: Airflow4 | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    device_count: int | None = None
    powerfeed_count: int | None = None


class RackRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    facility_id: constr(max_length=50) | None = None
    site: int | BriefSiteRequest
    location: int | BriefLocationRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    status: Literal["reserved", "available", "planned", "active", "deprecated"] | None = Field(
        None,
        description="* `reserved` - Reserved\n* `available` - Available\n* `planned` - Planned\n* `active` - Active\n* `deprecated` - Deprecated",
    )
    role: int | BriefRackRoleRequest | None = None
    serial: SerialNumber8 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this rack"
    )
    rack_type: int | BriefRackTypeRequest | None = None
    form_factor: (
        Literal[
            "2-post-frame",
            "4-post-frame",
            "4-post-cabinet",
            "wall-frame",
            "wall-frame-vertical",
            "wall-cabinet",
            "wall-cabinet-vertical",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `2-post-frame` - 2-post frame\n* `4-post-frame` - 4-post frame\n* `4-post-cabinet` - 4-post cabinet\n* `wall-frame` - Wall-mounted frame\n* `wall-frame-vertical` - Wall-mounted frame (vertical)\n* `wall-cabinet` - Wall-mounted cabinet\n* `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)",
    )
    width: Literal[10, 19, 21, 23] | None = Field(
        None,
        description="* `10` - 10 inches\n* `19` - 19 inches\n* `21` - 21 inches\n* `23` - 23 inches",
    )
    u_height: HeightU | None = Field(None, description="Height in rack units", title="Height (U)")
    starting_unit: conint(ge=1, le=32767) | None = Field(None, description="Starting unit for rack")
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    max_weight: conint(ge=0, le=2147483647) | None = Field(
        None, description="Maximum load capacity for the rack"
    )
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    desc_units: DescendingUnits | None = Field(
        None, description="Units are numbered top-to-bottom", title="Descending units"
    )
    outer_width: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (width)"
    )
    outer_height: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (height)"
    )
    outer_depth: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (depth)"
    )
    outer_unit: Literal["mm", "in", ""] | None = Field(
        None, description="* `mm` - Millimeters\n* `in` - Inches"
    )
    mounting_depth: conint(ge=0, le=32767) | None = Field(
        None,
        description="Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.",
    )
    airflow: Literal["front-to-rear", "rear-to-front", ""] | None = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class RackReservation(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    rack: BriefRack
    units: list[conint(ge=0, le=32767)]
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    user: BriefUser
    tenant: BriefTenant | None = None
    description: constr(max_length=200)
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None


class RackReservationRequest(BaseModel):
    rack: int | BriefRackRequest
    units: list[conint(ge=0, le=32767)]
    user: int | BriefUserRequest
    tenant: int | BriefTenantRequest | None = None
    description: constr(min_length=1, max_length=200)
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class RackRole(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    rack_count: int | None = None


class RackRoleRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", min_length=1, max_length=6) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class RackType(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    manufacturer: BriefManufacturer
    model: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    form_factor: FormFactor | None = None
    width: Width | None = None
    u_height: HeightU | None = Field(None, description="Height in rack units", title="Height (U)")
    starting_unit: conint(ge=1, le=32767) | None = Field(None, description="Starting unit for rack")
    desc_units: DescendingUnits | None = Field(
        None, description="Units are numbered top-to-bottom", title="Descending units"
    )
    outer_width: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (width)"
    )
    outer_height: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (height)"
    )
    outer_depth: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (depth)"
    )
    outer_unit: OuterUnit | None = None
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    max_weight: conint(ge=0, le=2147483647) | None = Field(
        None, description="Maximum load capacity for the rack"
    )
    weight_unit: WeightUnit | None = None
    mounting_depth: conint(ge=0, le=32767) | None = Field(
        None,
        description="Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.",
    )
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class RackTypeRequest(BaseModel):
    manufacturer: int | BriefManufacturerRequest
    model: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    form_factor: (
        Literal[
            "2-post-frame",
            "4-post-frame",
            "4-post-cabinet",
            "wall-frame",
            "wall-frame-vertical",
            "wall-cabinet",
            "wall-cabinet-vertical",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `2-post-frame` - 2-post frame\n* `4-post-frame` - 4-post frame\n* `4-post-cabinet` - 4-post cabinet\n* `wall-frame` - Wall-mounted frame\n* `wall-frame-vertical` - Wall-mounted frame (vertical)\n* `wall-cabinet` - Wall-mounted cabinet\n* `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)",
    )
    width: Literal[10, 19, 21, 23] | None = Field(
        None,
        description="* `10` - 10 inches\n* `19` - 19 inches\n* `21` - 21 inches\n* `23` - 23 inches",
    )
    u_height: HeightU | None = Field(None, description="Height in rack units", title="Height (U)")
    starting_unit: conint(ge=1, le=32767) | None = Field(None, description="Starting unit for rack")
    desc_units: DescendingUnits | None = Field(
        None, description="Units are numbered top-to-bottom", title="Descending units"
    )
    outer_width: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (width)"
    )
    outer_height: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (height)"
    )
    outer_depth: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (depth)"
    )
    outer_unit: Literal["mm", "in", ""] | None = Field(
        None, description="* `mm` - Millimeters\n* `in` - Inches"
    )
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    max_weight: conint(ge=0, le=2147483647) | None = Field(
        None, description="Maximum load capacity for the rack"
    )
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    mounting_depth: conint(ge=0, le=32767) | None = Field(
        None,
        description="Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Face2(BaseModel):
    value: Literal["front", "rear"] | None = Field(
        None, description="* `front` - Front\n* `rear` - Rear"
    )
    label: Literal["Front", "Rear"] | None = None


class RackUnit(BaseModel):
    id: confloat(lt=1000.0, gt=-1000.0)
    name: str
    face: Face2
    device: BriefDevice
    occupied: bool
    display: str


class Type17(Type7):
    pass


class Region(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    parent: NestedRegion | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    site_count: int | None = 0
    prefix_count: int | None = None
    comments: str | None = None
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class RegionRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    parent: NestedRegionRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class RoleModel(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    weight: conint(ge=0, le=32767) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    prefix_count: int | None = None
    vlan_count: int | None = None


class RoleRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    weight: conint(ge=0, le=32767) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class RouteTarget(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=21) = Field(
        ..., description="Route target value (formatted in accordance with RFC 4360)"
    )
    tenant: BriefTenant | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class RouteTargetRequest(BaseModel):
    name: constr(min_length=1, max_length=21) = Field(
        ..., description="Route target value (formatted in accordance with RFC 4360)"
    )
    tenant: int | BriefTenantRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class SavedFilter(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    object_types: list[str]
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    user: int | None = None
    weight: conint(ge=0, le=32767) | None = None
    enabled: bool | None = None
    shared: bool | None = None
    parameters: Any
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class SavedFilterRequest(BaseModel):
    object_types: list[str]
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    user: int | None = None
    weight: conint(ge=0, le=32767) | None = None
    enabled: bool | None = None
    shared: bool | None = None
    parameters: Any


class ScriptInputRequest(BaseModel):
    data: Any
    commit: bool
    schedule_at: AwareDatetime | None = None
    interval: int | None = None


class Protocol(BaseModel):
    value: Literal["tcp", "udp", "sctp"] | None = Field(
        None, description="* `tcp` - TCP\n* `udp` - UDP\n* `sctp` - SCTP"
    )
    label: Literal["TCP", "UDP", "SCTP"] | None = None


class ServiceRequest(BaseModel):
    parent_object_type: str
    parent_object_id: conint(ge=0, le=9223372036854775807)
    name: constr(min_length=1, max_length=100)
    protocol: Literal["tcp", "udp", "sctp"] | None = Field(
        None, description="* `tcp` - TCP\n* `udp` - UDP\n* `sctp` - SCTP"
    )
    ports: PortNumbers = Field(..., title="Port numbers")
    ipaddresses: list[int] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ServiceTemplate(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    protocol: Protocol | None = None
    ports: PortNumbers = Field(..., title="Port numbers")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ServiceTemplateRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    protocol: Literal["tcp", "udp", "sctp"] | None = Field(
        None, description="* `tcp` - TCP\n* `udp` - UDP\n* `sctp` - SCTP"
    )
    ports: PortNumbers = Field(..., title="Port numbers")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Status18(Status12):
    pass


class SiteGroup(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    parent: NestedSiteGroup | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    site_count: int | None = 0
    prefix_count: int | None = None
    comments: str | None = None
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class SiteGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    parent: NestedSiteGroupRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class SiteRequest(BaseModel):
    name: constr(min_length=1, max_length=100) = Field(..., description="Full name of the site")
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    status: Literal["planned", "staging", "active", "decommissioning", "retired"] | None = Field(
        None,
        description="* `planned` - Planned\n* `staging` - Staging\n* `active` - Active\n* `decommissioning` - Decommissioning\n* `retired` - Retired",
    )
    region: int | BriefRegionRequest | None = None
    group: int | BriefSiteGroupRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    facility: constr(max_length=50) | None = Field(
        None, description="Local facility ID or description"
    )
    time_zone: constr(min_length=1) | None = None
    description: constr(max_length=200) | None = None
    physical_address: constr(max_length=200) | None = Field(
        None, description="Physical location of the building"
    )
    shipping_address: constr(max_length=200) | None = Field(
        None, description="If different from the physical address"
    )
    latitude: confloat(lt=100.0, gt=-100.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    longitude: confloat(lt=1000.0, gt=-1000.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    comments: str | None = None
    asns: list[int] | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Subscription(BaseModel):
    id: int
    url: AnyUrl
    display: str
    object_type: str
    object_id: conint(ge=0, le=9223372036854775807)
    object: Any | None = None
    user: BriefUser
    created: AwareDatetime | None = None


class SubscriptionRequest(BaseModel):
    object_type: str
    object_id: conint(ge=0, le=9223372036854775807)
    user: int | BriefUserRequest


class TableConfig(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    object_type: str
    table: constr(max_length=100)
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    user: int | None = None
    weight: conint(ge=0, le=32767) | None = None
    enabled: bool | None = None
    shared: bool | None = None
    columns: list[constr(max_length=100)]
    ordering: list[constr(max_length=100)] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class TableConfigRequest(BaseModel):
    object_type: str
    table: constr(min_length=1, max_length=100)
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    user: int | None = None
    weight: conint(ge=0, le=32767) | None = None
    enabled: bool | None = None
    shared: bool | None = None
    columns: list[constr(min_length=1, max_length=100)]
    ordering: list[constr(min_length=1, max_length=100)] | None = None


class Tag(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-\w]+$", max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    description: constr(max_length=200) | None = None
    weight: conint(ge=0, le=32767) | None = None
    object_types: list[str] | None = None
    tagged_items: int | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class TagRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-\w]+$", min_length=1, max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", min_length=1, max_length=6) | None = None
    description: constr(max_length=200) | None = None
    weight: conint(ge=0, le=32767) | None = None
    object_types: list[str] | None = None


class TaggedItem(BaseModel):
    id: int
    url: AnyUrl
    display: str
    object_type: str
    object_id: conint(ge=-2147483648, le=2147483647)
    object: Any
    tag: BriefTag


class Tenant(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    group: BriefTenantGroup | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    circuit_count: int | None = None
    device_count: int | None = None
    ipaddress_count: int | None = None
    prefix_count: int | None = None
    rack_count: int | None = None
    site_count: int | None = None
    virtualmachine_count: int | None = None
    vlan_count: int | None = None
    vrf_count: int | None = None
    cluster_count: int | None = None


class TenantGroup(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    parent: NestedTenantGroup | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    tenant_count: int | None = 0
    comments: str | None = None
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class TenantGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    parent: NestedTenantGroupRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class TenantRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    group: int | BriefTenantGroupRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Token(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    user: BriefUser
    created: AwareDatetime | None = None
    expires: AwareDatetime | None = None
    last_used: AwareDatetime | None = None
    write_enabled: bool | None = Field(
        None, description="Permit create/update/delete operations using this key"
    )
    description: constr(max_length=200) | None = None


class TokenProvision(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    user: BriefUser
    created: AwareDatetime | None = None
    expires: AwareDatetime | None = None
    last_used: AwareDatetime
    key: str
    write_enabled: bool | None = Field(
        None, description="Permit create/update/delete operations using this key"
    )
    description: constr(max_length=200) | None = None


class TokenProvisionRequest(BaseModel):
    expires: AwareDatetime | None = None
    write_enabled: bool | None = Field(
        None, description="Permit create/update/delete operations using this key"
    )
    description: constr(max_length=200) | None = None
    username: constr(min_length=1)
    password: constr(min_length=1)


class TokenRequest(BaseModel):
    user: int | BriefUserRequest
    expires: AwareDatetime | None = None
    last_used: AwareDatetime | None = None
    key: constr(min_length=40, max_length=40) | None = None
    write_enabled: bool | None = Field(
        None, description="Permit create/update/delete operations using this key"
    )
    description: constr(max_length=200) | None = None


class Status19(BaseModel):
    value: Literal["planned", "active", "disabled"] | None = Field(
        None,
        description="* `planned` - Planned\n* `active` - Active\n* `disabled` - Disabled",
    )
    label: Literal["Planned", "Active", "Disabled"] | None = None


class Encapsulation(BaseModel):
    value: (
        Literal[
            "ipsec-transport",
            "ipsec-tunnel",
            "ip-ip",
            "gre",
            "wireguard",
            "openvpn",
            "l2tp",
            "pptp",
        ]
        | None
    ) = Field(
        None,
        description="* `ipsec-transport` - IPsec - Transport\n* `ipsec-tunnel` - IPsec - Tunnel\n* `ip-ip` - IP-in-IP\n* `gre` - GRE\n* `wireguard` - WireGuard\n* `openvpn` - OpenVPN\n* `l2tp` - L2TP\n* `pptp` - PPTP",
    )
    label: (
        Literal[
            "IPsec - Transport",
            "IPsec - Tunnel",
            "IP-in-IP",
            "GRE",
            "WireGuard",
            "OpenVPN",
            "L2TP",
            "PPTP",
        ]
        | None
    ) = None


class Tunnel(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    status: Status19
    group: BriefTunnelGroup | None = None
    encapsulation: Encapsulation
    ipsec_profile: BriefIPSecProfile | None = None
    tenant: BriefTenant | None = None
    tunnel_id: conint(ge=0, le=9223372036854775807) | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    terminations_count: int | None = None


class TunnelGroup(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    tunnel_count: int | None = None


class TunnelGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class TunnelRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    status: Literal["planned", "active", "disabled"] = Field(
        ...,
        description="* `planned` - Planned\n* `active` - Active\n* `disabled` - Disabled",
    )
    group: int | BriefTunnelGroupRequest | None = None
    encapsulation: Literal[
        "ipsec-transport",
        "ipsec-tunnel",
        "ip-ip",
        "gre",
        "wireguard",
        "openvpn",
        "l2tp",
        "pptp",
    ] = Field(
        ...,
        description="* `ipsec-transport` - IPsec - Transport\n* `ipsec-tunnel` - IPsec - Tunnel\n* `ip-ip` - IP-in-IP\n* `gre` - GRE\n* `wireguard` - WireGuard\n* `openvpn` - OpenVPN\n* `l2tp` - L2TP\n* `pptp` - PPTP",
    )
    ipsec_profile: int | BriefIPSecProfileRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    tunnel_id: conint(ge=0, le=9223372036854775807) | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Role1(BaseModel):
    value: Literal["peer", "hub", "spoke"] | None = Field(
        None, description="* `peer` - Peer\n* `hub` - Hub\n* `spoke` - Spoke"
    )
    label: Literal["Peer", "Hub", "Spoke"] | None = None


class TunnelTermination(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    tunnel: BriefTunnel
    role: Role1
    termination_type: str
    termination_id: conint(ge=0, le=9223372036854775807) | None = None
    termination: Any | None = None
    outside_ip: BriefIPAddress | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class TunnelTerminationRequest(BaseModel):
    tunnel: int | BriefTunnelRequest
    role: Literal["peer", "hub", "spoke"] = Field(
        ..., description="* `peer` - Peer\n* `hub` - Hub\n* `spoke` - Spoke"
    )
    termination_type: str
    termination_id: conint(ge=0, le=9223372036854775807) | None = None
    outside_ip: int | BriefIPAddressRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class UserRequest(BaseModel):
    username: constr(pattern=r"^[\w.@+-]+$", min_length=1, max_length=150) = Field(
        ...,
        description="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
    )
    password: constr(min_length=1, max_length=128)
    first_name: constr(max_length=150) | None = None
    last_name: constr(max_length=150) | None = None
    email: EmailAddress | None = Field(None, title="Email address")
    is_staff: StaffStatus | None = Field(
        None,
        description="Designates whether the user can log into this admin site.",
        title="Staff status",
    )
    is_active: Active | None = Field(
        None,
        description="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
        title="Active",
    )
    date_joined: AwareDatetime | None = None
    last_login: AwareDatetime | None = None
    groups: list[int] | None = None
    permissions: list[int] | None = None


class Status20(Status8):
    pass


class QinqRole(BaseModel):
    value: Literal["svlan", "cvlan"] | None = Field(
        None, description="* `svlan` - Service\n* `cvlan` - Customer"
    )
    label: Literal["Service", "Customer"] | None = None


class VLAN(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    site: BriefSite | None = None
    group: BriefVLANGroup | None = None
    vid: VLANID = Field(..., description="Numeric VLAN ID (1-4094)", title="VLAN ID")
    name: constr(max_length=64)
    tenant: BriefTenant | None = None
    status: Status20 | None = None
    role: BriefRole | None = None
    description: constr(max_length=200) | None = None
    qinq_role: QinqRole | None = None
    qinq_svlan: NestedVLAN | None = None
    comments: str | None = None
    l2vpn_termination: BriefL2VPNTermination | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    prefix_count: int | None = None


class VLANGroup(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    scope_type: str | None = None
    scope_id: int | None = None
    scope: Any | None = None
    vid_ranges: list[IntegerRange] | None = None
    tenant: BriefTenant | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    vlan_count: int | None = None
    utilization: str


class VLANGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    scope_type: str | None = None
    scope_id: int | None = None
    vid_ranges: list[IntegerRangeRequest] | None = None
    tenant: int | BriefTenantRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class VLANRequest(BaseModel):
    site: int | BriefSiteRequest | None = None
    group: int | BriefVLANGroupRequest | None = None
    vid: VLANID = Field(..., description="Numeric VLAN ID (1-4094)", title="VLAN ID")
    name: constr(min_length=1, max_length=64)
    tenant: int | BriefTenantRequest | None = None
    status: Literal["active", "reserved", "deprecated"] | None = Field(
        None,
        description="* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    role: int | BriefRoleRequest | None = None
    description: constr(max_length=200) | None = None
    qinq_role: Literal["svlan", "cvlan"] | None = Field(
        None, description="* `svlan` - Service\n* `cvlan` - Customer"
    )
    qinq_svlan: NestedVLANRequest | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class VLANTranslationPolicyRequest(BriefClusterRequest):
    pass


class VLANTranslationRule(BaseModel):
    id: int
    url: AnyUrl
    display: str
    policy: int
    local_vid: LocalVLANID = Field(
        ..., description="Numeric VLAN ID (1-4094)", title="Local VLAN ID"
    )
    remote_vid: RemoteVLANID = Field(
        ..., description="Numeric VLAN ID (1-4094)", title="Remote VLAN ID"
    )
    description: constr(max_length=200) | None = None


class VLANTranslationRuleRequest(BaseModel):
    policy: int
    local_vid: LocalVLANID = Field(
        ..., description="Numeric VLAN ID (1-4094)", title="Local VLAN ID"
    )
    remote_vid: RemoteVLANID = Field(
        ..., description="Numeric VLAN ID (1-4094)", title="Remote VLAN ID"
    )
    description: constr(max_length=200) | None = None


class VMInterfaceRequest(BaseModel):
    virtual_machine: int | BriefVirtualMachineRequest
    name: constr(min_length=1, max_length=64)
    enabled: bool | None = None
    parent: NestedVMInterfaceRequest | None = None
    bridge: NestedVMInterfaceRequest | None = None
    mtu: conint(ge=1, le=65536) | None = None
    primary_mac_address: int | BriefMACAddressRequest | None = None
    description: constr(max_length=200) | None = None
    mode: Literal["access", "tagged", "tagged-all", "q-in-q", ""] | None = Field(
        None,
        description="* `access` - Access\n* `tagged` - Tagged\n* `tagged-all` - Tagged (All)\n* `q-in-q` - Q-in-Q (802.1ad)",
    )
    untagged_vlan: int | BriefVLANRequest | None = None
    tagged_vlans: list[int] | None = None
    qinq_svlan: int | BriefVLANRequest | None = None
    vlan_translation_policy: int | BriefVLANTranslationPolicyRequest | None = None
    vrf: int | BriefVRFRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class VRF(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    rd: RouteDistinguisher | None = Field(
        None,
        description="Unique route distinguisher (as defined in RFC 4364)",
        title="Route distinguisher",
    )
    tenant: BriefTenant | None = None
    enforce_unique: EnforceUniqueSpace | None = Field(
        None,
        description="Prevent duplicate prefixes/IP addresses within this VRF",
        title="Enforce unique space",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    import_targets: list[RouteTarget] | None = None
    export_targets: list[RouteTarget] | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    ipaddress_count: int | None = None
    prefix_count: int | None = None


class VRFRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    rd: RouteDistinguisher | None = Field(
        None,
        description="Unique route distinguisher (as defined in RFC 4364)",
        title="Route distinguisher",
    )
    tenant: int | BriefTenantRequest | None = None
    enforce_unique: EnforceUniqueSpace | None = Field(
        None,
        description="Prevent duplicate prefixes/IP addresses within this VRF",
        title="Enforce unique space",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    import_targets: list[int] | None = None
    export_targets: list[int] | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class VirtualChassis(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=64)
    domain: constr(max_length=30) | None = None
    master: NestedDevice | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    member_count: int | None = None
    members: list[NestedDevice]


class VirtualChassisRequest(BaseModel):
    name: constr(min_length=1, max_length=64)
    domain: constr(max_length=30) | None = None
    master: NestedDeviceRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class CircuitID8(CircuitID):
    pass


class Status21(Status2):
    pass


class VirtualCircuit(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    cid: CircuitID8 = Field(..., description="Unique circuit ID", title="Circuit ID")
    provider_network: BriefProviderNetwork
    provider_account: BriefProviderAccount | None = None
    type: BriefVirtualCircuitType
    status: Status21 | None = None
    tenant: BriefTenant | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class CircuitID9(CircuitID1):
    pass


class VirtualCircuitRequest(BaseModel):
    cid: CircuitID9 = Field(..., description="Unique circuit ID", title="Circuit ID")
    provider_network: int | BriefProviderNetworkRequest
    provider_account: int | BriefProviderAccountRequest | None = None
    type: int | BriefVirtualCircuitTypeRequest
    status: (
        Literal[
            "planned",
            "provisioning",
            "active",
            "offline",
            "deprovisioning",
            "decommissioned",
        ]
        | None
    ) = Field(
        None,
        description="* `planned` - Planned\n* `provisioning` - Provisioning\n* `active` - Active\n* `offline` - Offline\n* `deprovisioning` - Deprovisioning\n* `decommissioned` - Decommissioned",
    )
    tenant: int | BriefTenantRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class VirtualCircuitTermination(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    virtual_circuit: BriefVirtualCircuit
    role: Role1 | None = None
    interface: BriefInterface
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class VirtualCircuitTerminationRequest(BaseModel):
    virtual_circuit: int | BriefVirtualCircuitRequest
    role: Literal["peer", "hub", "spoke"] | None = Field(
        None, description="* `peer` - Peer\n* `hub` - Hub\n* `spoke` - Spoke"
    )
    interface: int | BriefInterfaceRequest
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class VirtualCircuitType(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    virtual_circuit_count: int


class VirtualCircuitTypeRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Status22(BaseModel):
    value: Literal["active", "planned", "offline"] | None = Field(
        None,
        description="* `active` - Active\n* `planned` - Planned\n* `offline` - Offline",
    )
    label: Literal["Active", "Planned", "Offline"] | None = None


class VirtualDeviceContext(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=64)
    device: BriefDevice
    identifier: conint(ge=0, le=32767) | None = None
    tenant: BriefTenant | None = None
    primary_ip: BriefIPAddress | None = None
    primary_ip4: BriefIPAddress | None = None
    primary_ip6: BriefIPAddress | None = None
    status: Status22
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    interface_count: int | None = None


class VirtualDeviceContextRequest(BaseModel):
    name: constr(min_length=1, max_length=64)
    device: int | BriefDeviceRequest
    identifier: conint(ge=0, le=32767) | None = None
    tenant: int | BriefTenantRequest | None = None
    primary_ip4: int | BriefIPAddressRequest | None = None
    primary_ip6: int | BriefIPAddressRequest | None = None
    status: Literal["active", "planned", "offline"] = Field(
        ...,
        description="* `active` - Active\n* `planned` - Planned\n* `offline` - Offline",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class VirtualDisk(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    virtual_machine: BriefVirtualMachine
    name: constr(max_length=64)
    description: constr(max_length=200) | None = None
    size: SizeMB = Field(..., title="Size (MB)")
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class VirtualDiskRequest(BaseModel):
    virtual_machine: int | BriefVirtualMachineRequest
    name: constr(min_length=1, max_length=64)
    description: constr(max_length=200) | None = None
    size: SizeMB = Field(..., title="Size (MB)")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Status23(BaseModel):
    value: (
        Literal[
            "offline",
            "active",
            "planned",
            "staged",
            "failed",
            "decommissioning",
            "paused",
        ]
        | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning\n* `paused` - Paused",
    )
    label: (
        Literal[
            "Offline",
            "Active",
            "Planned",
            "Staged",
            "Failed",
            "Decommissioning",
            "Paused",
        ]
        | None
    ) = None


class VirtualMachineWithConfigContext(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=64)
    status: Status23 | None = None
    site: BriefSite | None = None
    cluster: BriefCluster | None = None
    device: BriefDevice | None = None
    serial: SerialNumber8 | None = Field(None, title="Serial number")
    role: BriefDeviceRole | None = None
    tenant: BriefTenant | None = None
    platform: BriefPlatform | None = None
    primary_ip: BriefIPAddress | None = None
    primary_ip4: BriefIPAddress | None = None
    primary_ip6: BriefIPAddress | None = None
    vcpus: confloat(ge=0.01, lt=10000.0) | None = None
    memory: MemoryMB | None = Field(None, title="Memory (MB)")
    disk: DiskMB | None = Field(None, title="Disk (MB)")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    config_template: BriefConfigTemplate | None = None
    local_context_data: Any | None = Field(
        None,
        description="Local config context data takes precedence over source contexts in the final rendered config context",
    )
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    config_context: Any | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    interface_count: int | None = None
    virtual_disk_count: int


class VirtualMachineWithConfigContextRequest(BaseModel):
    name: constr(min_length=1, max_length=64)
    status: (
        Literal[
            "offline",
            "active",
            "planned",
            "staged",
            "failed",
            "decommissioning",
            "paused",
        ]
        | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning\n* `paused` - Paused",
    )
    site: int | BriefSiteRequest | None = None
    cluster: int | BriefClusterRequest | None = None
    device: int | BriefDeviceRequest | None = None
    serial: SerialNumber8 | None = Field(None, title="Serial number")
    role: int | BriefDeviceRoleRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    platform: int | BriefPlatformRequest | None = None
    primary_ip4: int | BriefIPAddressRequest | None = None
    primary_ip6: int | BriefIPAddressRequest | None = None
    vcpus: confloat(ge=0.01, lt=10000.0) | None = None
    memory: MemoryMB | None = Field(None, title="Memory (MB)")
    disk: DiskMB | None = Field(None, title="Disk (MB)")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    config_template: int | BriefConfigTemplateRequest | None = None
    local_context_data: Any | None = Field(
        None,
        description="Local config context data takes precedence over source contexts in the final rendered config context",
    )
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class URL4(RootModel[constr(max_length=500)]):
    root: constr(max_length=500) = Field(
        ...,
        description="This URL will be called using the HTTP method defined when the webhook is called. Jinja2 template processing is supported with the same context as the request body.",
        title="URL",
    )


class Webhook(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=150)
    description: constr(max_length=200) | None = None
    payload_url: URL4 = Field(
        ...,
        description="This URL will be called using the HTTP method defined when the webhook is called. Jinja2 template processing is supported with the same context as the request body.",
        title="URL",
    )
    http_method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] | None = Field(
        None,
        description="* `GET` - GET\n* `POST` - POST\n* `PUT` - PUT\n* `PATCH` - PATCH\n* `DELETE` - DELETE",
    )
    http_content_type: constr(max_length=100) | None = Field(
        None,
        description='The complete list of official content types is available <a href="https://www.iana.org/assignments/media-types/media-types.xhtml">here</a>.',
    )
    additional_headers: str | None = Field(
        None,
        description="User-supplied HTTP headers to be sent with the request in addition to the HTTP content type. Headers should be defined in the format <code>Name: Value</code>. Jinja2 template processing is supported with the same context as the request body (below).",
    )
    body_template: str | None = Field(
        None,
        description="Jinja2 template for a custom request body. If blank, a JSON object representing the change will be included. Available context data includes: <code>event</code>, <code>model</code>, <code>timestamp</code>, <code>username</code>, <code>request_id</code>, and <code>data</code>.",
    )
    secret: constr(max_length=255) | None = Field(
        None,
        description="When provided, the request will include a <code>X-Hook-Signature</code> header containing a HMAC hex digest of the payload body using the secret as the key. The secret is not transmitted in the request.",
    )
    ssl_verification: bool | None = Field(
        None, description="Enable SSL certificate verification. Disable with caution!"
    )
    ca_file_path: constr(max_length=4096) | None = Field(
        None,
        description="The specific CA certificate file to use for SSL verification. Leave blank to use the system defaults.",
    )
    custom_fields: dict[str, Any] | None = None
    tags: list[NestedTag] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class URL5(URL2):
    pass


class WebhookRequest(BaseModel):
    name: constr(min_length=1, max_length=150)
    description: constr(max_length=200) | None = None
    payload_url: URL5 = Field(
        ...,
        description="This URL will be called using the HTTP method defined when the webhook is called. Jinja2 template processing is supported with the same context as the request body.",
        title="URL",
    )
    http_method: Literal["GET", "POST", "PUT", "PATCH", "DELETE"] | None = Field(
        None,
        description="* `GET` - GET\n* `POST` - POST\n* `PUT` - PUT\n* `PATCH` - PATCH\n* `DELETE` - DELETE",
    )
    http_content_type: constr(min_length=1, max_length=100) | None = Field(
        None,
        description='The complete list of official content types is available <a href="https://www.iana.org/assignments/media-types/media-types.xhtml">here</a>.',
    )
    additional_headers: str | None = Field(
        None,
        description="User-supplied HTTP headers to be sent with the request in addition to the HTTP content type. Headers should be defined in the format <code>Name: Value</code>. Jinja2 template processing is supported with the same context as the request body (below).",
    )
    body_template: str | None = Field(
        None,
        description="Jinja2 template for a custom request body. If blank, a JSON object representing the change will be included. Available context data includes: <code>event</code>, <code>model</code>, <code>timestamp</code>, <code>username</code>, <code>request_id</code>, and <code>data</code>.",
    )
    secret: constr(max_length=255) | None = Field(
        None,
        description="When provided, the request will include a <code>X-Hook-Signature</code> header containing a HMAC hex digest of the payload body using the secret as the key. The secret is not transmitted in the request.",
    )
    ssl_verification: bool | None = Field(
        None, description="Enable SSL certificate verification. Disable with caution!"
    )
    ca_file_path: constr(max_length=4096) | None = Field(
        None,
        description="The specific CA certificate file to use for SSL verification. Leave blank to use the system defaults.",
    )
    custom_fields: dict[str, Any] | None = None
    tags: list[NestedTagRequest] | None = None


class Status24(BaseModel):
    value: Literal["active", "reserved", "disabled", "deprecated", ""] | None = Field(
        None,
        description="* `active` - Active\n* `reserved` - Reserved\n* `disabled` - Disabled\n* `deprecated` - Deprecated",
    )
    label: Literal["Active", "Reserved", "Disabled", "Deprecated"] | None = None


class AuthType(BaseModel):
    value: Literal["open", "wep", "wpa-personal", "wpa-enterprise", ""] | None = Field(
        None,
        description="* `open` - Open\n* `wep` - WEP\n* `wpa-personal` - WPA Personal (PSK)\n* `wpa-enterprise` - WPA Enterprise",
    )
    label: Literal["Open", "WEP", "WPA Personal (PSK)", "WPA Enterprise"] | None = None


class AuthCipher(BaseModel):
    value: Literal["auto", "tkip", "aes", ""] | None = Field(
        None, description="* `auto` - Auto\n* `tkip` - TKIP\n* `aes` - AES"
    )
    label: Literal["Auto", "TKIP", "AES"] | None = None


class WirelessLAN(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    ssid: constr(max_length=32)
    description: constr(max_length=200) | None = None
    group: BriefWirelessLANGroup | None = None
    status: Status24 | None = None
    vlan: BriefVLAN | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    scope: Any | None = None
    tenant: BriefTenant | None = None
    auth_type: AuthType | None = None
    auth_cipher: AuthCipher | None = None
    auth_psk: PreSharedKey3 | None = Field(None, title="Pre-shared key")
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class WirelessLANGroup(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    parent: NestedWirelessLANGroup | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    wirelesslan_count: int | None = 0
    comments: str | None = None
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class WirelessLANGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    parent: NestedWirelessLANGroupRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class WirelessLANRequest(BaseModel):
    ssid: constr(min_length=1, max_length=32)
    description: constr(max_length=200) | None = None
    group: int | BriefWirelessLANGroupRequest | None = None
    status: Literal["active", "reserved", "disabled", "deprecated", ""] | None = Field(
        None,
        description="* `active` - Active\n* `reserved` - Reserved\n* `disabled` - Disabled\n* `deprecated` - Deprecated",
    )
    vlan: int | BriefVLANRequest | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    tenant: int | BriefTenantRequest | None = None
    auth_type: Literal["open", "wep", "wpa-personal", "wpa-enterprise", ""] | None = Field(
        None,
        description="* `open` - Open\n* `wep` - WEP\n* `wpa-personal` - WPA Personal (PSK)\n* `wpa-enterprise` - WPA Enterprise",
    )
    auth_cipher: Literal["auto", "tkip", "aes", ""] | None = Field(
        None, description="* `auto` - Auto\n* `tkip` - TKIP\n* `aes` - AES"
    )
    auth_psk: PreSharedKey3 | None = Field(None, title="Pre-shared key")
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Status25(Status1):
    pass


class WirelessLink(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    interface_a: BriefInterface
    interface_b: BriefInterface
    ssid: constr(max_length=32) | None = None
    status: Status25 | None = None
    tenant: BriefTenant | None = None
    auth_type: AuthType | None = None
    auth_cipher: AuthCipher | None = None
    auth_psk: PreSharedKey3 | None = Field(None, title="Pre-shared key")
    distance: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    distance_unit: DistanceUnit | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class WirelessLinkRequest(BaseModel):
    interface_a: int | BriefInterfaceRequest
    interface_b: int | BriefInterfaceRequest
    ssid: constr(max_length=32) | None = None
    status: Literal["connected", "planned", "decommissioning"] | None = Field(
        None,
        description="* `connected` - Connected\n* `planned` - Planned\n* `decommissioning` - Decommissioning",
    )
    tenant: int | BriefTenantRequest | None = None
    auth_type: Literal["open", "wep", "wpa-personal", "wpa-enterprise", ""] | None = Field(
        None,
        description="* `open` - Open\n* `wep` - WEP\n* `wpa-personal` - WPA Personal (PSK)\n* `wpa-enterprise` - WPA Enterprise",
    )
    auth_cipher: Literal["auto", "tkip", "aes", ""] | None = Field(
        None, description="* `auto` - Auto\n* `tkip` - TKIP\n* `aes` - AES"
    )
    auth_psk: PreSharedKey3 | None = Field(None, title="Pre-shared key")
    distance: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    distance_unit: Literal["km", "m", "mi", "ft", ""] | None = Field(
        None,
        description="* `km` - Kilometers\n* `m` - Meters\n* `mi` - Miles\n* `ft` - Feet",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableAggregateRequest(BaseModel):
    prefix: constr(min_length=1)
    rir: int | BriefRIRRequest
    tenant: int | BriefTenantRequest | None = None
    date_added: date | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableCableRequest(PatchedWritableCableRequest):
    pass


class WritableCircuitGroupAssignmentRequest(BaseModel):
    group: int | BriefCircuitGroupRequest
    member_type: str
    member_id: conint(ge=0, le=9223372036854775807)
    priority: Literal["primary", "secondary", "tertiary", "inactive", ""] | None = Field(
        None,
        description="* `primary` - Primary\n* `secondary` - Secondary\n* `tertiary` - Tertiary\n* `inactive` - Inactive",
    )
    tags: list[NestedTagRequest] | None = None


class WritableClusterRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    type: int | BriefClusterTypeRequest
    group: int | BriefClusterGroupRequest | None = None
    status: Literal["planned", "staging", "active", "decommissioning", "offline"] | None = Field(
        None,
        description="* `planned` - Planned\n* `staging` - Staging\n* `active` - Active\n* `decommissioning` - Decommissioning\n* `offline` - Offline",
    )
    tenant: int | BriefTenantRequest | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableContactAssignmentRequest(BaseModel):
    object_type: str
    object_id: conint(ge=0, le=9223372036854775807)
    contact: int | BriefContactRequest
    role: int | BriefContactRoleRequest | None = None
    priority: Literal["primary", "secondary", "tertiary", "inactive", ""] | None = Field(
        None,
        description="* `primary` - Primary\n* `secondary` - Secondary\n* `tertiary` - Tertiary\n* `inactive` - Inactive",
    )
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableContactGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    parent: int | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class WritableCustomFieldChoiceSetRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    base_choices: Literal["IATA", "ISO_3166", "UN_LOCODE", ""] | None = Field(
        None,
        description="Base set of predefined choices (optional)\n\n* `IATA` - IATA (Airport codes)\n* `ISO_3166` - ISO 3166 (Country codes)\n* `UN_LOCODE` - UN/LOCODE (Location codes)",
    )
    extra_choices: list[list[Any]]
    order_alphabetically: bool | None = Field(
        None, description="Choices are automatically ordered alphabetically"
    )


class WritableCustomFieldRequest(BaseModel):
    object_types: list[str]
    type: (
        Literal[
            "text",
            "longtext",
            "integer",
            "decimal",
            "boolean",
            "date",
            "datetime",
            "url",
            "json",
            "select",
            "multiselect",
            "object",
            "multiobject",
        ]
        | None
    ) = Field(
        None,
        description="The type of data this custom field holds\n\n* `text` - Text\n* `longtext` - Text (long)\n* `integer` - Integer\n* `decimal` - Decimal\n* `boolean` - Boolean (true/false)\n* `date` - Date\n* `datetime` - Date & time\n* `url` - URL\n* `json` - JSON\n* `select` - Selection\n* `multiselect` - Multiple selection\n* `object` - Object\n* `multiobject` - Multiple objects",
    )
    related_object_type: str | None = None
    name: constr(pattern=r"^[a-z0-9_]+$", min_length=1, max_length=50) = Field(
        ..., description="Internal field name"
    )
    label: constr(max_length=50) | None = Field(
        None,
        description="Name of the field as displayed to users (if not provided, 'the field's name will be used)",
    )
    group_name: constr(max_length=50) | None = Field(
        None,
        description="Custom fields within the same group will be displayed together",
    )
    description: constr(max_length=200) | None = None
    required: bool | None = Field(
        None,
        description="This field is required when creating new objects or editing an existing object.",
    )
    unique: MustBeUnique | None = Field(
        None,
        description="The value of this field must be unique for the assigned object",
        title="Must be unique",
    )
    search_weight: conint(ge=0, le=32767) | None = Field(
        None,
        description="Weighting for search. Lower values are considered more important. Fields with a search weight of zero will be ignored.",
    )
    filter_logic: Literal["disabled", "loose", "exact"] | None = Field(
        None,
        description="Loose matches any instance of a given string; exact matches the entire field.\n\n* `disabled` - Disabled\n* `loose` - Loose\n* `exact` - Exact",
    )
    ui_visible: Literal["always", "if-set", "hidden"] | None = Field(
        None,
        description="Specifies whether the custom field is displayed in the UI\n\n* `always` - Always\n* `if-set` - If set\n* `hidden` - Hidden",
    )
    ui_editable: Literal["yes", "no", "hidden"] | None = Field(
        None,
        description="Specifies whether the custom field value can be edited in the UI\n\n* `yes` - Yes\n* `no` - No\n* `hidden` - Hidden",
    )
    is_cloneable: bool | None = Field(None, description="Replicate this value when cloning objects")
    default: Any | None = Field(
        None,
        description='Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. "Foo").',
    )
    related_object_filter: Any | None = Field(
        None,
        description='Filter the object selection choices using a query_params dict (must be a JSON value).Encapsulate strings with double quotes (e.g. "Foo").',
    )
    weight: DisplayWeight | None = Field(
        None,
        description="Fields with higher weights appear lower in a form.",
        title="Display weight",
    )
    validation_minimum: MinimumValue | None = Field(
        None,
        description="Minimum allowed value (for numeric fields)",
        title="Minimum value",
    )
    validation_maximum: MaximumValue | None = Field(
        None,
        description="Maximum allowed value (for numeric fields)",
        title="Maximum value",
    )
    validation_regex: constr(max_length=500) | None = Field(
        None,
        description="Regular expression to enforce on text field values. Use ^ and $ to force matching of entire string. For example, <code>^[A-Z]{3}$</code> will limit values to exactly three uppercase letters.",
    )
    choice_set: int | BriefCustomFieldChoiceSetRequest | None = None
    comments: str | None = None


class URL6(URL1):
    pass


class WritableDataSourceRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    type: constr(min_length=1, max_length=50)
    source_url: URL6 = Field(..., title="URL")
    enabled: bool | None = None
    description: constr(max_length=200) | None = None
    sync_interval: Literal[1, 60, 720, 1440, 10080, 43200] | None = Field(
        None,
        description="* `1` - Minutely\n* `60` - Hourly\n* `720` - 12 hours\n* `1440` - Daily\n* `10080` - Weekly\n* `43200` - 30 days",
    )
    parameters: Any | None = None
    ignore_rules: str | None = Field(
        None,
        description="Patterns (one per line) matching files to ignore when syncing",
    )
    comments: str | None = None
    custom_fields: dict[str, Any] | None = None


class WritableDeviceRoleRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", min_length=1, max_length=6) | None = None
    vm_role: bool | None = Field(None, description="Virtual machines may be assigned to this role")
    config_template: int | BriefConfigTemplateRequest | None = None
    parent: int | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class PositionU7(PositionU1):
    pass


class WritableDeviceTypeRequest(BaseModel):
    manufacturer: int | BriefManufacturerRequest
    default_platform: int | BriefPlatformRequest | None = None
    model: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    part_number: constr(max_length=50) | None = Field(
        None, description="Discrete part number (optional)"
    )
    u_height: PositionU7 | None = Field(
        default_factory=lambda: PositionU7(1.0), title="Position (U)"
    )
    exclude_from_utilization: bool | None = Field(
        None,
        description="Devices of this type are excluded when calculating rack utilization.",
    )
    is_full_depth: bool | None = Field(
        None, description="Device consumes both front and rear rack faces."
    )
    subdevice_role: ParentChildStatus | None = Field(
        None,
        description="Parent devices house child devices in device bays. Leave blank if this device type is neither a parent nor a child.\n\n* `parent` - Parent\n* `child` - Child",
        title="Parent/child status",
    )
    airflow: (
        Literal[
            "front-to-rear",
            "rear-to-front",
            "left-to-right",
            "right-to-left",
            "side-to-rear",
            "rear-to-side",
            "bottom-to-top",
            "top-to-bottom",
            "passive",
            "mixed",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front\n* `left-to-right` - Left to right\n* `right-to-left` - Right to left\n* `side-to-rear` - Side to rear\n* `rear-to-side` - Rear to side\n* `bottom-to-top` - Bottom to top\n* `top-to-bottom` - Top to bottom\n* `passive` - Passive\n* `mixed` - Mixed",
    )
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    front_image: bytes | None = None
    rear_image: bytes | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class SerialNumber16(SerialNumber):
    pass


class PositionU8(PositionU):
    pass


class WritableEventRuleRequest(BaseModel):
    object_types: list[str]
    name: constr(min_length=1, max_length=150)
    enabled: bool | None = None
    event_types: list[
        Literal[
            "object_created",
            "object_updated",
            "object_deleted",
            "job_started",
            "job_completed",
            "job_failed",
            "job_errored",
        ]
    ] = Field(..., description="The types of event which will trigger this rule.")
    conditions: Any | None = Field(
        None,
        description="A set of conditions which determine whether the event will be generated.",
    )
    action_type: Literal["webhook", "script", "notification"] | None = Field(
        None,
        description="* `webhook` - Webhook\n* `script` - Script\n* `notification` - Notification",
    )
    action_object_type: str
    action_object_id: conint(ge=0, le=9223372036854775807) | None = None
    description: constr(max_length=200) | None = None
    custom_fields: dict[str, Any] | None = None
    tags: list[NestedTagRequest] | None = None


class PreSharedKey9(PreSharedKey):
    pass


class WritableIKEPolicyRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    version: Literal[1, 2] | None = Field(None, description="* `1` - IKEv1\n* `2` - IKEv2")
    mode: Literal["aggressive", "main", ""] | None = Field(
        None, description="* `aggressive` - Aggressive\n* `main` - Main"
    )
    proposals: list[int] | None = None
    preshared_key: PreSharedKey9 | None = Field(None, title="Pre-shared key")
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableIKEProposalRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    authentication_method: Literal[
        "preshared-keys", "certificates", "rsa-signatures", "dsa-signatures"
    ] = Field(
        ...,
        description="* `preshared-keys` - Pre-shared keys\n* `certificates` - Certificates\n* `rsa-signatures` - RSA signatures\n* `dsa-signatures` - DSA signatures",
    )
    encryption_algorithm: Literal[
        "aes-128-cbc",
        "aes-128-gcm",
        "aes-192-cbc",
        "aes-192-gcm",
        "aes-256-cbc",
        "aes-256-gcm",
        "3des-cbc",
        "des-cbc",
    ] = Field(
        ...,
        description="* `aes-128-cbc` - 128-bit AES (CBC)\n* `aes-128-gcm` - 128-bit AES (GCM)\n* `aes-192-cbc` - 192-bit AES (CBC)\n* `aes-192-gcm` - 192-bit AES (GCM)\n* `aes-256-cbc` - 256-bit AES (CBC)\n* `aes-256-gcm` - 256-bit AES (GCM)\n* `3des-cbc` - 3DES\n* `des-cbc` - DES",
    )
    authentication_algorithm: (
        Literal["hmac-sha1", "hmac-sha256", "hmac-sha384", "hmac-sha512", "hmac-md5", ""] | None
    ) = Field(
        None,
        description="* `hmac-sha1` - SHA-1 HMAC\n* `hmac-sha256` - SHA-256 HMAC\n* `hmac-sha384` - SHA-384 HMAC\n* `hmac-sha512` - SHA-512 HMAC\n* `hmac-md5` - MD5 HMAC",
    )
    group: Literal[
        1,
        2,
        5,
        14,
        15,
        16,
        17,
        18,
        19,
        20,
        21,
        22,
        23,
        24,
        25,
        26,
        27,
        28,
        29,
        30,
        31,
        32,
        33,
        34,
    ] = Field(
        ...,
        description="Diffie-Hellman group ID\n\n* `1` - Group 1\n* `2` - Group 2\n* `5` - Group 5\n* `14` - Group 14\n* `15` - Group 15\n* `16` - Group 16\n* `17` - Group 17\n* `18` - Group 18\n* `19` - Group 19\n* `20` - Group 20\n* `21` - Group 21\n* `22` - Group 22\n* `23` - Group 23\n* `24` - Group 24\n* `25` - Group 25\n* `26` - Group 26\n* `27` - Group 27\n* `28` - Group 28\n* `29` - Group 29\n* `30` - Group 30\n* `31` - Group 31\n* `32` - Group 32\n* `33` - Group 33\n* `34` - Group 34",
    )
    sa_lifetime: conint(ge=0, le=2147483647) | None = Field(
        None, description="Security association lifetime (in seconds)"
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableIPAddressRequest(BaseModel):
    address: constr(min_length=1)
    vrf: int | BriefVRFRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    status: Literal["active", "reserved", "deprecated", "dhcp", "slaac"] | None = Field(
        None,
        description="The operational status of this IP\n\n* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated\n* `dhcp` - DHCP\n* `slaac` - SLAAC",
    )
    role: (
        Literal[
            "loopback",
            "secondary",
            "anycast",
            "vip",
            "vrrp",
            "hsrp",
            "glbp",
            "carp",
            "",
        ]
        | None
    ) = Field(
        None,
        description="The functional role of this IP\n\n* `loopback` - Loopback\n* `secondary` - Secondary\n* `anycast` - Anycast\n* `vip` - VIP\n* `vrrp` - VRRP\n* `hsrp` - HSRP\n* `glbp` - GLBP\n* `carp` - CARP",
    )
    assigned_object_type: str | None = None
    assigned_object_id: conint(ge=0, le=9223372036854775807) | None = None
    nat_inside: NATInside | None = Field(
        None,
        description='The IP for which this address is the "outside" IP',
        title="NAT (inside)",
    )
    dns_name: (
        constr(pattern=r"^([0-9A-Za-z_-]+|\*)(\.[0-9A-Za-z_-]+)*\.?$", max_length=255) | None
    ) = Field(None, description="Hostname or FQDN (not case-sensitive)")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableIPRangeRequest(BaseModel):
    start_address: constr(min_length=1)
    end_address: constr(min_length=1)
    vrf: int | BriefVRFRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    status: Literal["active", "reserved", "deprecated"] | None = Field(
        None,
        description="Operational status of this range\n\n* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    role: int | BriefRoleRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    mark_populated: bool | None = Field(
        None, description="Prevent the creation of IP addresses within this range"
    )
    mark_utilized: bool | None = Field(None, description="Report space as 100% utilized")


class WritableIPSecPolicyRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    proposals: list[int] | None = None
    pfs_group: (
        Literal[
            1,
            2,
            5,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            27,
            28,
            29,
            30,
            31,
            32,
            33,
            34,
        ]
        | None
    ) = Field(
        None,
        description="Diffie-Hellman group for Perfect Forward Secrecy\n\n* `1` - Group 1\n* `2` - Group 2\n* `5` - Group 5\n* `14` - Group 14\n* `15` - Group 15\n* `16` - Group 16\n* `17` - Group 17\n* `18` - Group 18\n* `19` - Group 19\n* `20` - Group 20\n* `21` - Group 21\n* `22` - Group 22\n* `23` - Group 23\n* `24` - Group 24\n* `25` - Group 25\n* `26` - Group 26\n* `27` - Group 27\n* `28` - Group 28\n* `29` - Group 29\n* `30` - Group 30\n* `31` - Group 31\n* `32` - Group 32\n* `33` - Group 33\n* `34` - Group 34",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableIPSecProfileRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    mode: Literal["esp", "ah"] = Field(..., description="* `esp` - ESP\n* `ah` - AH")
    ike_policy: int | BriefIKEPolicyRequest
    ipsec_policy: int | BriefIPSecPolicyRequest
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableIPSecProposalRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    encryption_algorithm: Encryption | None = Field(
        None,
        description="* `aes-128-cbc` - 128-bit AES (CBC)\n* `aes-128-gcm` - 128-bit AES (GCM)\n* `aes-192-cbc` - 192-bit AES (CBC)\n* `aes-192-gcm` - 192-bit AES (GCM)\n* `aes-256-cbc` - 256-bit AES (CBC)\n* `aes-256-gcm` - 256-bit AES (GCM)\n* `3des-cbc` - 3DES\n* `des-cbc` - DES",
        title="Encryption",
    )
    authentication_algorithm: Authentication | None = Field(
        None,
        description="* `hmac-sha1` - SHA-1 HMAC\n* `hmac-sha256` - SHA-256 HMAC\n* `hmac-sha384` - SHA-384 HMAC\n* `hmac-sha512` - SHA-512 HMAC\n* `hmac-md5` - MD5 HMAC",
        title="Authentication",
    )
    sa_lifetime_seconds: SALifetimeSeconds | None = Field(
        None,
        description="Security association lifetime (seconds)",
        title="SA lifetime (seconds)",
    )
    sa_lifetime_data: SALifetimeKB | None = Field(
        None,
        description="Security association lifetime (in kilobytes)",
        title="SA lifetime (KB)",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ManagementOnly6(ManagementOnly):
    pass


class ManagementOnly7(ManagementOnly2):
    pass


class SerialNumber17(SerialNumber3):
    pass


class WritableInventoryItemRequest(BaseModel):
    device: int | BriefDeviceRequest
    parent: int | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    status: (
        Literal["offline", "active", "planned", "staged", "failed", "decommissioning"] | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning",
    )
    role: int | BriefInventoryItemRoleRequest | None = None
    manufacturer: int | BriefManufacturerRequest | None = None
    part_id: constr(max_length=50) | None = Field(
        None, description="Manufacturer-assigned part identifier"
    )
    serial: SerialNumber17 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this item"
    )
    discovered: bool | None = Field(None, description="This item was automatically discovered")
    description: constr(max_length=200) | None = None
    component_type: str | None = None
    component_id: conint(ge=0, le=9223372036854775807) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableJournalEntryRequest(BaseModel):
    assigned_object_type: str
    assigned_object_id: conint(ge=0, le=9223372036854775807)
    created_by: int | None = None
    kind: Literal["info", "success", "warning", "danger"] | None = Field(
        None,
        description="* `info` - Info\n* `success` - Success\n* `warning` - Warning\n* `danger` - Danger",
    )
    comments: constr(min_length=1)
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableL2VPNRequest(BaseModel):
    identifier: conint(ge=-9223372036854775808, le=9223372036854775807) | None = None
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    type: Literal[
        "vpws",
        "vpls",
        "vxlan",
        "vxlan-evpn",
        "mpls-evpn",
        "pbb-evpn",
        "evpn-vpws",
        "epl",
        "evpl",
        "ep-lan",
        "evp-lan",
        "ep-tree",
        "evp-tree",
        "spb",
    ] = Field(
        ...,
        description="* `vpws` - VPWS\n* `vpls` - VPLS\n* `vxlan` - VXLAN\n* `vxlan-evpn` - VXLAN-EVPN\n* `mpls-evpn` - MPLS EVPN\n* `pbb-evpn` - PBB EVPN\n* `evpn-vpws` - EVPN VPWS\n* `epl` - EPL\n* `evpl` - EVPL\n* `ep-lan` - Ethernet Private LAN\n* `evp-lan` - Ethernet Virtual Private LAN\n* `ep-tree` - Ethernet Private Tree\n* `evp-tree` - Ethernet Virtual Private Tree\n* `spb` - SPB",
    )
    status: Literal["active", "planned", "decommissioning"] | None = Field(
        None,
        description="* `active` - Active\n* `planned` - Planned\n* `decommissioning` - Decommissioning",
    )
    import_targets: list[int] | None = None
    export_targets: list[int] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tenant: int | BriefTenantRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableLocationRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    site: int | BriefSiteRequest
    parent: int | None = None
    status: Literal["planned", "staging", "active", "decommissioning", "retired"] | None = Field(
        None,
        description="* `planned` - Planned\n* `staging` - Staging\n* `active` - Active\n* `decommissioning` - Decommissioning\n* `retired` - Retired",
    )
    tenant: int | BriefTenantRequest | None = None
    facility: constr(max_length=50) | None = Field(
        None, description="Local facility ID or description"
    )
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class WritableModuleRequest(BaseModel):
    device: int | BriefDeviceRequest
    module_bay: int
    module_type: int | BriefModuleTypeRequest
    status: (
        Literal["offline", "active", "planned", "staged", "failed", "decommissioning"] | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning",
    )
    serial: SerialNumber17 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this device"
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableModuleTypeRequest(BaseModel):
    profile: int | BriefModuleTypeProfileRequest | None = None
    manufacturer: int | BriefManufacturerRequest
    model: constr(min_length=1, max_length=100)
    part_number: constr(max_length=50) | None = Field(
        None, description="Discrete part number (optional)"
    )
    airflow: (
        Literal[
            "front-to-rear",
            "rear-to-front",
            "left-to-right",
            "right-to-left",
            "side-to-rear",
            "passive",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front\n* `left-to-right` - Left to right\n* `right-to-left` - Right to left\n* `side-to-rear` - Side to rear\n* `passive` - Passive",
    )
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    description: constr(max_length=200) | None = None
    attributes: Any | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritablePowerFeedRequest(PowerFeedRequest):
    pass


class WritablePrefixRequest(BaseModel):
    prefix: constr(min_length=1)
    vrf: int | BriefVRFRequest | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    tenant: int | BriefTenantRequest | None = None
    vlan: int | BriefVLANRequest | None = None
    status: Literal["container", "active", "reserved", "deprecated"] | None = Field(
        None,
        description="Operational status of this prefix\n\n* `container` - Container\n* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    role: int | BriefRoleRequest | None = None
    is_pool: IsAPool | None = Field(
        None,
        description="All IP addresses within this prefix are considered usable",
        title="Is a pool",
    )
    mark_utilized: bool | None = Field(None, description="Treat as fully utilized")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableRackRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    facility_id: constr(max_length=50) | None = None
    site: int | BriefSiteRequest
    location: int | BriefLocationRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    status: Literal["reserved", "available", "planned", "active", "deprecated"] | None = Field(
        None,
        description="* `reserved` - Reserved\n* `available` - Available\n* `planned` - Planned\n* `active` - Active\n* `deprecated` - Deprecated",
    )
    role: int | BriefRackRoleRequest | None = None
    serial: SerialNumber17 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this rack"
    )
    rack_type: int | BriefRackTypeRequest | None = None
    form_factor: (
        Literal[
            "2-post-frame",
            "4-post-frame",
            "4-post-cabinet",
            "wall-frame",
            "wall-frame-vertical",
            "wall-cabinet",
            "wall-cabinet-vertical",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `2-post-frame` - 2-post frame\n* `4-post-frame` - 4-post frame\n* `4-post-cabinet` - 4-post cabinet\n* `wall-frame` - Wall-mounted frame\n* `wall-frame-vertical` - Wall-mounted frame (vertical)\n* `wall-cabinet` - Wall-mounted cabinet\n* `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)",
    )
    width: Literal[10, 19, 21, 23] | None = Field(
        None,
        description="Rail-to-rail width\n\n* `10` - 10 inches\n* `19` - 19 inches\n* `21` - 21 inches\n* `23` - 23 inches",
    )
    u_height: HeightU | None = Field(None, description="Height in rack units", title="Height (U)")
    starting_unit: conint(ge=1, le=32767) | None = Field(None, description="Starting unit for rack")
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    max_weight: conint(ge=0, le=2147483647) | None = Field(
        None, description="Maximum load capacity for the rack"
    )
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    desc_units: DescendingUnits | None = Field(
        None, description="Units are numbered top-to-bottom", title="Descending units"
    )
    outer_width: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (width)"
    )
    outer_height: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (height)"
    )
    outer_depth: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (depth)"
    )
    outer_unit: Literal["mm", "in", ""] | None = Field(
        None, description="* `mm` - Millimeters\n* `in` - Inches"
    )
    mounting_depth: conint(ge=0, le=32767) | None = Field(
        None,
        description="Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.",
    )
    airflow: Literal["front-to-rear", "rear-to-front", ""] | None = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableRackTypeRequest(BaseModel):
    manufacturer: int | BriefManufacturerRequest
    model: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    form_factor: Literal[
        "2-post-frame",
        "4-post-frame",
        "4-post-cabinet",
        "wall-frame",
        "wall-frame-vertical",
        "wall-cabinet",
        "wall-cabinet-vertical",
    ] = Field(
        ...,
        description="* `2-post-frame` - 2-post frame\n* `4-post-frame` - 4-post frame\n* `4-post-cabinet` - 4-post cabinet\n* `wall-frame` - Wall-mounted frame\n* `wall-frame-vertical` - Wall-mounted frame (vertical)\n* `wall-cabinet` - Wall-mounted cabinet\n* `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)",
    )
    width: Literal[10, 19, 21, 23] | None = Field(
        None,
        description="Rail-to-rail width\n\n* `10` - 10 inches\n* `19` - 19 inches\n* `21` - 21 inches\n* `23` - 23 inches",
    )
    u_height: HeightU | None = Field(None, description="Height in rack units", title="Height (U)")
    starting_unit: conint(ge=1, le=32767) | None = Field(None, description="Starting unit for rack")
    desc_units: DescendingUnits | None = Field(
        None, description="Units are numbered top-to-bottom", title="Descending units"
    )
    outer_width: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (width)"
    )
    outer_height: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (height)"
    )
    outer_depth: conint(ge=0, le=32767) | None = Field(
        None, description="Outer dimension of rack (depth)"
    )
    outer_unit: Literal["mm", "in", ""] | None = Field(
        None, description="* `mm` - Millimeters\n* `in` - Inches"
    )
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    max_weight: conint(ge=0, le=2147483647) | None = Field(
        None, description="Maximum load capacity for the rack"
    )
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    mounting_depth: conint(ge=0, le=32767) | None = Field(
        None,
        description="Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableRegionRequest(WritableContactGroupRequest):
    pass


class WritableServiceRequest(BaseModel):
    parent_object_type: str
    parent_object_id: conint(ge=0, le=9223372036854775807)
    name: constr(min_length=1, max_length=100)
    protocol: Literal["tcp", "udp", "sctp"] = Field(
        ..., description="* `tcp` - TCP\n* `udp` - UDP\n* `sctp` - SCTP"
    )
    ports: PortNumbers = Field(..., title="Port numbers")
    ipaddresses: list[int] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableServiceTemplateRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    protocol: Literal["tcp", "udp", "sctp"] = Field(
        ..., description="* `tcp` - TCP\n* `udp` - UDP\n* `sctp` - SCTP"
    )
    ports: PortNumbers = Field(..., title="Port numbers")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableSiteGroupRequest(WritableContactGroupRequest):
    pass


class WritableSiteRequest(SiteRequest):
    pass


class WritableTenantGroupRequest(WritableContactGroupRequest):
    pass


class WritableTunnelRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    status: Literal["planned", "active", "disabled"] | None = Field(
        None,
        description="* `planned` - Planned\n* `active` - Active\n* `disabled` - Disabled",
    )
    group: int | BriefTunnelGroupRequest | None = None
    encapsulation: Literal[
        "ipsec-transport",
        "ipsec-tunnel",
        "ip-ip",
        "gre",
        "wireguard",
        "openvpn",
        "l2tp",
        "pptp",
    ] = Field(
        ...,
        description="* `ipsec-transport` - IPsec - Transport\n* `ipsec-tunnel` - IPsec - Tunnel\n* `ip-ip` - IP-in-IP\n* `gre` - GRE\n* `wireguard` - WireGuard\n* `openvpn` - OpenVPN\n* `l2tp` - L2TP\n* `pptp` - PPTP",
    )
    ipsec_profile: int | BriefIPSecProfileRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    tunnel_id: conint(ge=0, le=9223372036854775807) | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableTunnelTerminationRequest(BaseModel):
    tunnel: int | BriefTunnelRequest
    role: Literal["peer", "hub", "spoke"] | None = Field(
        None, description="* `peer` - Peer\n* `hub` - Hub\n* `spoke` - Spoke"
    )
    termination_type: str
    termination_id: conint(ge=0, le=9223372036854775807) | None = None
    outside_ip: int | BriefIPAddressRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableVLANRequest(BaseModel):
    site: int | BriefSiteRequest | None = None
    group: int | BriefVLANGroupRequest | None = None
    vid: VLANID = Field(..., description="Numeric VLAN ID (1-4094)", title="VLAN ID")
    name: constr(min_length=1, max_length=64)
    tenant: int | BriefTenantRequest | None = None
    status: Literal["active", "reserved", "deprecated"] | None = Field(
        None,
        description="Operational status of this VLAN\n\n* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    role: int | BriefRoleRequest | None = None
    description: constr(max_length=200) | None = None
    qinq_role: QInQRole | None = Field(
        None,
        description="Customer/service VLAN designation (for Q-in-Q/IEEE 802.1ad)\n\n* `svlan` - Service\n* `cvlan` - Customer",
        title="Q-in-Q role",
    )
    qinq_svlan: int | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableVMInterfaceRequest(BaseModel):
    virtual_machine: int | BriefVirtualMachineRequest
    name: constr(min_length=1, max_length=64)
    enabled: bool | None = None
    parent: ParentInterface | None = Field(None, title="Parent interface")
    bridge: BridgeInterface | None = Field(None, title="Bridge interface")
    mtu: conint(ge=1, le=65536) | None = None
    primary_mac_address: int | BriefMACAddressRequest | None = None
    description: constr(max_length=200) | None = None
    mode: Literal["access", "tagged", "tagged-all", "q-in-q", ""] | None = Field(
        None,
        description="IEEE 802.1Q tagging strategy\n\n* `access` - Access\n* `tagged` - Tagged\n* `tagged-all` - Tagged (All)\n* `q-in-q` - Q-in-Q (802.1ad)",
    )
    untagged_vlan: int | BriefVLANRequest | None = None
    tagged_vlans: list[int] | None = None
    qinq_svlan: int | BriefVLANRequest | None = None
    vlan_translation_policy: int | BriefVLANTranslationPolicyRequest | None = None
    vrf: int | BriefVRFRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableVirtualChassisRequest(BaseModel):
    name: constr(min_length=1, max_length=64)
    domain: constr(max_length=30) | None = None
    master: int | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableVirtualCircuitRequest(VirtualCircuitRequest):
    pass


class WritableVirtualCircuitTerminationRequest(VirtualCircuitTerminationRequest):
    pass


class WritableVirtualDeviceContextRequest(VirtualDeviceContextRequest):
    pass


class WritableVirtualMachineWithConfigContextRequest(BaseModel):
    name: constr(min_length=1, max_length=64)
    status: (
        Literal[
            "offline",
            "active",
            "planned",
            "staged",
            "failed",
            "decommissioning",
            "paused",
        ]
        | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning\n* `paused` - Paused",
    )
    site: int | BriefSiteRequest | None = None
    cluster: int | BriefClusterRequest | None = None
    device: int | BriefDeviceRequest | None = None
    serial: SerialNumber17 | None = Field(None, title="Serial number")
    role: int | BriefDeviceRoleRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    platform: int | BriefPlatformRequest | None = None
    primary_ip4: int | BriefIPAddressRequest | None = None
    primary_ip6: int | BriefIPAddressRequest | None = None
    vcpus: confloat(ge=0.01, lt=10000.0) | None = None
    memory: MemoryMB | None = Field(None, title="Memory (MB)")
    disk: DiskMB | None = Field(None, title="Disk (MB)")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    config_template: int | BriefConfigTemplateRequest | None = None
    local_context_data: Any | None = Field(
        None,
        description="Local config context data takes precedence over source contexts in the final rendered config context",
    )
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableWirelessLANGroupRequest(WritableContactGroupRequest):
    pass


class PreSharedKey10(PreSharedKey3):
    pass


class WritableWirelessLANRequest(BaseModel):
    ssid: constr(min_length=1, max_length=32)
    description: constr(max_length=200) | None = None
    group: int | BriefWirelessLANGroupRequest | None = None
    status: Literal["active", "reserved", "disabled", "deprecated"] | None = Field(
        None,
        description="* `active` - Active\n* `reserved` - Reserved\n* `disabled` - Disabled\n* `deprecated` - Deprecated",
    )
    vlan: int | BriefVLANRequest | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    tenant: int | BriefTenantRequest | None = None
    auth_type: AuthenticationType3 | None = Field(
        None,
        description="* `open` - Open\n* `wep` - WEP\n* `wpa-personal` - WPA Personal (PSK)\n* `wpa-enterprise` - WPA Enterprise",
        title="Authentication type",
    )
    auth_cipher: AuthenticationCipher | None = Field(
        None,
        description="* `auto` - Auto\n* `tkip` - TKIP\n* `aes` - AES",
        title="Authentication cipher",
    )
    auth_psk: PreSharedKey10 | None = Field(None, title="Pre-shared key")
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableWirelessLinkRequest(BaseModel):
    interface_a: int | BriefInterfaceRequest
    interface_b: int | BriefInterfaceRequest
    ssid: constr(max_length=32) | None = None
    status: Literal["connected", "planned", "decommissioning"] | None = Field(
        None,
        description="* `connected` - Connected\n* `planned` - Planned\n* `decommissioning` - Decommissioning",
    )
    tenant: int | BriefTenantRequest | None = None
    auth_type: AuthenticationType3 | None = Field(
        None,
        description="* `open` - Open\n* `wep` - WEP\n* `wpa-personal` - WPA Personal (PSK)\n* `wpa-enterprise` - WPA Enterprise",
        title="Authentication type",
    )
    auth_cipher: AuthenticationCipher | None = Field(
        None,
        description="* `auto` - Auto\n* `tkip` - TKIP\n* `aes` - AES",
        title="Authentication cipher",
    )
    auth_psk: PreSharedKey10 | None = Field(None, title="Pre-shared key")
    distance: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    distance_unit: Literal["km", "m", "mi", "ft", ""] | None = Field(
        None,
        description="* `km` - Kilometers\n* `m` - Meters\n* `mi` - Miles\n* `ft` - Feet",
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ASN(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    asn: conint(ge=1, le=4294967295) = Field(
        ..., description="16- or 32-bit autonomous system number"
    )
    rir: BriefRIR | None = None
    tenant: BriefTenant | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    site_count: int | None = None
    provider_count: int | None = None


class ASNRange(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    rir: BriefRIR
    start: conint(ge=1, le=4294967295)
    end: conint(ge=1, le=4294967295)
    tenant: BriefTenant | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    asn_count: int | None = None


class ASNRangeRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    rir: int | BriefRIRRequest
    start: conint(ge=1, le=4294967295)
    end: conint(ge=1, le=4294967295)
    tenant: int | BriefTenantRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ASNRequest(BaseModel):
    asn: conint(ge=1, le=4294967295) = Field(
        ..., description="16- or 32-bit autonomous system number"
    )
    rir: int | BriefRIRRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Aggregate(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    family: Family
    prefix: str
    rir: BriefRIR
    tenant: BriefTenant | None = None
    date_added: date | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class AggregateRequest(WritableAggregateRequest):
    pass


class AvailableIP(BaseModel):
    family: int
    address: str
    vrf: BriefVRF | None = None
    description: str | None = None


class AvailablePrefix(BaseModel):
    family: int
    prefix: str
    vrf: BriefVRF | None = None


class AvailableVLAN(BaseModel):
    vid: int
    group: BriefVLANGroup | None = None


class Bookmark(Subscription):
    pass


class BookmarkRequest(SubscriptionRequest):
    pass


class BriefCircuit(BaseModel):
    id: int
    url: AnyUrl
    display: str
    cid: CircuitID = Field(..., description="Unique circuit ID", title="Circuit ID")
    provider: BriefProvider
    description: constr(max_length=200) | None = None


class BriefCircuitGroupAssignmentSerializerRequest(BaseModel):
    group: int | BriefCircuitGroupRequest
    priority: Literal["primary", "secondary", "tertiary", "inactive", ""] | None = Field(
        None,
        description="* `primary` - Primary\n* `secondary` - Secondary\n* `tertiary` - Tertiary\n* `inactive` - Inactive",
    )


class BriefCircuitRequest(BaseModel):
    cid: CircuitID1 = Field(..., description="Unique circuit ID", title="Circuit ID")
    provider: int | BriefProviderRequest
    description: constr(max_length=200) | None = None


class BriefDeviceType(BaseModel):
    id: int
    url: AnyUrl
    display: str
    manufacturer: BriefManufacturer
    model: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    device_count: int | None = None


class BriefDeviceTypeRequest(BriefRackTypeRequest):
    pass


class BriefJob(BaseModel):
    url: AnyUrl
    status: Status
    created: AwareDatetime | None = None
    completed: AwareDatetime | None = None
    user: BriefUser


class BriefModule(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device: BriefDevice
    module_bay: NestedModuleBay


class BriefModuleRequest(BaseModel):
    device: int | BriefDeviceRequest
    module_bay: NestedModuleBayRequest


class BriefModuleType(BaseModel):
    id: int
    url: AnyUrl
    display: str
    profile: BriefModuleTypeProfile | None = None
    manufacturer: BriefManufacturer
    model: constr(max_length=100)
    description: constr(max_length=200) | None = None


class BriefVirtualChassis(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=64)
    master: NestedDevice | None = None
    description: constr(max_length=200) | None = None
    member_count: int | None = None


class BriefVirtualChassisRequest(BaseModel):
    name: constr(min_length=1, max_length=64)
    master: NestedDeviceRequest | None = None
    description: constr(max_length=200) | None = None


class Cable(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    type: (
        Literal[
            "cat3",
            "cat5",
            "cat5e",
            "cat6",
            "cat6a",
            "cat7",
            "cat7a",
            "cat8",
            "dac-active",
            "dac-passive",
            "mrj21-trunk",
            "coaxial",
            "mmf",
            "mmf-om1",
            "mmf-om2",
            "mmf-om3",
            "mmf-om4",
            "mmf-om5",
            "smf",
            "smf-os1",
            "smf-os2",
            "aoc",
            "usb",
            "power",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `cat3` - CAT3\n* `cat5` - CAT5\n* `cat5e` - CAT5e\n* `cat6` - CAT6\n* `cat6a` - CAT6a\n* `cat7` - CAT7\n* `cat7a` - CAT7a\n* `cat8` - CAT8\n* `dac-active` - Direct Attach Copper (Active)\n* `dac-passive` - Direct Attach Copper (Passive)\n* `mrj21-trunk` - MRJ21 Trunk\n* `coaxial` - Coaxial\n* `mmf` - Multimode Fiber\n* `mmf-om1` - Multimode Fiber (OM1)\n* `mmf-om2` - Multimode Fiber (OM2)\n* `mmf-om3` - Multimode Fiber (OM3)\n* `mmf-om4` - Multimode Fiber (OM4)\n* `mmf-om5` - Multimode Fiber (OM5)\n* `smf` - Singlemode Fiber\n* `smf-os1` - Singlemode Fiber (OS1)\n* `smf-os2` - Singlemode Fiber (OS2)\n* `aoc` - Active Optical Cabling (AOC)\n* `usb` - USB\n* `power` - Power",
    )
    a_terminations: list[GenericObject] | None = None
    b_terminations: list[GenericObject] | None = None
    status: Status1 | None = None
    tenant: BriefTenant | None = None
    label: constr(max_length=100) | None = None
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    length: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    length_unit: LengthUnit | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class CableRequest(PatchedWritableCableRequest):
    pass


class Circuit(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    cid: CircuitID4 = Field(..., description="Unique circuit ID", title="Circuit ID")
    provider: BriefProvider
    provider_account: BriefProviderAccount | None = None
    type: BriefCircuitType
    status: Status2 | None = None
    tenant: BriefTenant | None = None
    install_date: Installed | None = Field(None, title="Installed")
    termination_date: Terminates | None = Field(None, title="Terminates")
    commit_rate: CommitRateKbps | None = Field(
        None, description="Committed rate", title="Commit rate (Kbps)"
    )
    description: constr(max_length=200) | None = None
    distance: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    distance_unit: DistanceUnit | None = None
    termination_a: CircuitCircuitTermination | None = None
    termination_z: CircuitCircuitTermination | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    assignments: list[BriefCircuitGroupAssignmentSerializer] | None = None


class CircuitGroup(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    tenant: BriefTenant | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    circuit_count: int | None = None


class CircuitGroupAssignment(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    group: BriefCircuitGroup
    member_type: str
    member_id: conint(ge=0, le=9223372036854775807)
    member: Any | None = None
    priority: Priority | None = None
    tags: list[NestedTag] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class CircuitGroupAssignmentRequest(WritableCircuitGroupAssignmentRequest):
    pass


class CircuitGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    tenant: int | BriefTenantRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class CircuitRequest(BaseModel):
    cid: CircuitID5 = Field(..., description="Unique circuit ID", title="Circuit ID")
    provider: int | BriefProviderRequest
    provider_account: int | BriefProviderAccountRequest | None = None
    type: int | BriefCircuitTypeRequest
    status: (
        Literal[
            "planned",
            "provisioning",
            "active",
            "offline",
            "deprovisioning",
            "decommissioned",
        ]
        | None
    ) = Field(
        None,
        description="* `planned` - Planned\n* `provisioning` - Provisioning\n* `active` - Active\n* `offline` - Offline\n* `deprovisioning` - Deprovisioning\n* `decommissioned` - Decommissioned",
    )
    tenant: int | BriefTenantRequest | None = None
    install_date: Installed | None = Field(None, title="Installed")
    termination_date: Terminates | None = Field(None, title="Terminates")
    commit_rate: CommitRateKbps | None = Field(
        None, description="Committed rate", title="Commit rate (Kbps)"
    )
    description: constr(max_length=200) | None = None
    distance: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    distance_unit: Literal["km", "m", "mi", "ft", ""] | None = Field(
        None,
        description="* `km` - Kilometers\n* `m` - Meters\n* `mi` - Miles\n* `ft` - Feet",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    assignments: list[BriefCircuitGroupAssignmentSerializerRequest] | None = None


class CircuitTermination(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    circuit: BriefCircuit
    term_side: TerminationSide = Field(
        ..., description="* `A` - A\n* `Z` - Z", title="Termination side"
    )
    termination_type: str | None = None
    termination_id: int | None = None
    termination: Any | None = None
    port_speed: PortSpeedKbps | None = Field(
        None, description="Physical circuit speed", title="Port speed (Kbps)"
    )
    upstream_speed: UpstreamSpeedKbps | None = Field(
        None,
        description="Upstream speed, if different from port speed",
        title="Upstream speed (Kbps)",
    )
    xconnect_id: CrossConnectID | None = Field(
        None, description="ID of the local cross-connect", title="Cross-connect ID"
    )
    pp_info: PatchPanelPortS | None = Field(
        None,
        description="Patch panel ID and port number(s)",
        title="Patch panel/port(s)",
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    cable: BriefCable | None = None
    cable_end: str | None = None
    link_peers: list[Any]
    link_peers_type: str | None = Field(
        None, description="Return the type of the peer link terminations, or None."
    )
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    field_occupied: FieldOccupied = Field(..., alias="_occupied", title=" occupied")


class CircuitTerminationRequest(BaseModel):
    circuit: int | BriefCircuitRequest
    term_side: TerminationSide = Field(
        ..., description="* `A` - A\n* `Z` - Z", title="Termination side"
    )
    termination_type: str | None = None
    termination_id: int | None = None
    port_speed: PortSpeedKbps | None = Field(
        None, description="Physical circuit speed", title="Port speed (Kbps)"
    )
    upstream_speed: UpstreamSpeedKbps | None = Field(
        None,
        description="Upstream speed, if different from port speed",
        title="Upstream speed (Kbps)",
    )
    xconnect_id: CrossConnectID | None = Field(
        None, description="ID of the local cross-connect", title="Cross-connect ID"
    )
    pp_info: PatchPanelPortS | None = Field(
        None,
        description="Patch panel ID and port number(s)",
        title="Patch panel/port(s)",
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class CircuitType(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    circuit_count: int | None = None


class CircuitTypeRequest(VirtualCircuitTypeRequest):
    pass


class Cluster(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    type: BriefClusterType
    group: BriefClusterGroup | None = None
    status: Status3 | None = None
    tenant: BriefTenant | None = None
    scope_type: str | None = None
    scope_id: int | None = None
    scope: Any | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    device_count: int | None = None
    virtualmachine_count: int | None = None
    allocated_vcpus: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    allocated_memory: int | None = None
    allocated_disk: int | None = None


class ClusterGroup(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    cluster_count: int | None = None


class ClusterGroupRequest(TunnelGroupRequest):
    pass


class ClusterRequest(WritableClusterRequest):
    pass


class ClusterType(ClusterGroup):
    pass


class ClusterTypeRequest(TunnelGroupRequest):
    pass


class ConfigTemplate(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    environment_params: Any | None = Field(
        None,
        description='Any <a href="https://jinja.palletsprojects.com/en/stable/api/#jinja2.Environment">additional parameters</a> to pass when constructing the Jinja environment',
        title="Environment parameters",
    )
    template_code: str = Field(..., description="Jinja template code.")
    mime_type: constr(max_length=50) | None = Field(
        None, description="Defaults to <code>text/plain; charset=utf-8</code>"
    )
    file_name: constr(max_length=200) | None = Field(
        None, description="Filename to give to the rendered export file"
    )
    file_extension: constr(max_length=15) | None = Field(
        None, description="Extension to append to the rendered filename"
    )
    as_attachment: bool | None = Field(None, description="Download file as attachment")
    data_source: BriefDataSource | None = None
    data_path: str = Field(..., description="Path to remote file (relative to data source root)")
    data_file: BriefDataFile | None = None
    data_synced: DateSynced | None = Field(None, title="Date synced")
    tags: list[NestedTag] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ConfigTemplateRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    environment_params: Any | None = Field(
        None,
        description='Any <a href="https://jinja.palletsprojects.com/en/stable/api/#jinja2.Environment">additional parameters</a> to pass when constructing the Jinja environment',
        title="Environment parameters",
    )
    template_code: constr(min_length=1) = Field(..., description="Jinja template code.")
    mime_type: constr(max_length=50) | None = Field(
        None, description="Defaults to <code>text/plain; charset=utf-8</code>"
    )
    file_name: constr(max_length=200) | None = Field(
        None, description="Filename to give to the rendered export file"
    )
    file_extension: constr(max_length=15) | None = Field(
        None, description="Extension to append to the rendered filename"
    )
    as_attachment: bool | None = Field(None, description="Download file as attachment")
    data_source: int | BriefDataSourceRequest | None = None
    tags: list[NestedTagRequest] | None = None


class ConsolePort(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: BriefDevice
    module: BriefModule | None = None
    name: constr(max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type1 | None = None
    speed: Speed | None = None
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    cable: BriefCable | None = None
    cable_end: str | None = None
    link_peers: list[Any]
    link_peers_type: str | None = Field(
        None, description="Return the type of the peer link terminations, or None."
    )
    connected_endpoints: list[Any] | None = None
    connected_endpoints_type: str | None = None
    connected_endpoints_reachable: bool
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    field_occupied: FieldOccupied = Field(..., alias="_occupied", title=" occupied")


class ConsolePortRequest(BaseModel):
    device: int | BriefDeviceRequest
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "de-9",
            "db-25",
            "rj-11",
            "rj-12",
            "rj-45",
            "mini-din-8",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `de-9` - DE-9\n* `db-25` - DB-25\n* `rj-11` - RJ-11\n* `rj-12` - RJ-12\n* `rj-45` - RJ-45\n* `mini-din-8` - Mini-DIN 8\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    speed: Literal[1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200] | None = Field(
        None,
        description="* `1200` - 1200 bps\n* `2400` - 2400 bps\n* `4800` - 4800 bps\n* `9600` - 9600 bps\n* `19200` - 19.2 kbps\n* `38400` - 38.4 kbps\n* `57600` - 57.6 kbps\n* `115200` - 115.2 kbps",
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ConsolePortTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device_type: BriefDeviceType | None = None
    module_type: BriefModuleType | None = None
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type1 | None = None
    description: constr(max_length=200) | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ConsolePortTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "de-9",
            "db-25",
            "rj-11",
            "rj-12",
            "rj-45",
            "mini-din-8",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `de-9` - DE-9\n* `db-25` - DB-25\n* `rj-11` - RJ-11\n* `rj-12` - RJ-12\n* `rj-45` - RJ-45\n* `mini-din-8` - Mini-DIN 8\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    description: constr(max_length=200) | None = None


class ConsoleServerPort(ConsolePort):
    pass


class ConsoleServerPortRequest(ConsolePortRequest):
    pass


class ConsoleServerPortTemplate(ConsolePortTemplate):
    pass


class ConsoleServerPortTemplateRequest(ConsolePortTemplateRequest):
    pass


class ContactAssignment(BaseModel):
    id: int
    url: AnyUrl
    display: str
    object_type: str
    object_id: conint(ge=0, le=9223372036854775807)
    object: dict[str, Any]
    contact: BriefContact
    role: BriefContactRole | None = None
    priority: Priority | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ContactAssignmentRequest(WritableContactAssignmentRequest):
    pass


class ContactGroup(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    parent: NestedContactGroup | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    contact_count: int | None = 0
    comments: str | None = None
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class ContactGroupRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    parent: NestedContactGroupRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class ContactRequest(BaseModel):
    groups: list[int] | None = None
    name: constr(min_length=1, max_length=100)
    title: constr(max_length=100) | None = None
    phone: constr(max_length=50) | None = None
    email: EmailStr | None = None
    address: constr(max_length=200) | None = None
    link: AnyUrl | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ContactRole(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ContactRoleRequest(TunnelGroupRequest):
    pass


class Device(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=64)
    device_type: BriefDeviceType | None = None
    role: BriefDeviceRole | None = None
    tenant: BriefTenant | None = None
    platform: BriefPlatform | None = None
    serial: SerialNumber | None = Field(
        None,
        description="Chassis serial number, assigned by the manufacturer",
        title="Serial number",
    )
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this device"
    )
    site: BriefSite | None = None
    location: BriefLocation | None = None
    rack: BriefRack | None = None
    position: PositionU | None = Field(None, title="Position (U)")
    face: Face | None = None
    latitude: confloat(lt=100.0, gt=-100.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    longitude: confloat(lt=1000.0, gt=-1000.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    parent_device: NestedDevice | None = None
    status: Status5 | None = None
    airflow: Airflow | None = None
    primary_ip: BriefIPAddress | None = None
    primary_ip4: BriefIPAddress | None = None
    primary_ip6: BriefIPAddress | None = None
    oob_ip: BriefIPAddress | None = None
    cluster: BriefCluster | None = None
    virtual_chassis: BriefVirtualChassis | None = None
    vc_position: conint(ge=0, le=255) | None = None
    vc_priority: conint(ge=0, le=255) | None = Field(
        None, description="Virtual chassis master election priority"
    )
    description: constr(max_length=200)
    comments: str | None = None
    config_template: BriefConfigTemplate | None = None
    local_context_data: Any | None = Field(
        None,
        description="Local config context data takes precedence over source contexts in the final rendered config context",
    )
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    console_port_count: int | None = None
    console_server_port_count: int | None = None
    power_port_count: int | None = None
    power_outlet_count: int | None = None
    interface_count: int | None = None
    front_port_count: int | None = None
    rear_port_count: int | None = None
    device_bay_count: int | None = None
    module_bay_count: int | None = None
    inventory_item_count: int | None = None


class DeviceBay(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: BriefDevice
    name: constr(max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    description: constr(max_length=200) | None = None
    installed_device: BriefDevice | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class DeviceBayRequest(BaseModel):
    device: int | BriefDeviceRequest
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    description: constr(max_length=200) | None = None
    installed_device: int | BriefDeviceRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class DeviceBayTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device_type: BriefDeviceType
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    description: constr(max_length=200) | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class DeviceBayTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    description: constr(max_length=200) | None = None


class DeviceRole(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    vm_role: bool | None = Field(None, description="Virtual machines may be assigned to this role")
    config_template: BriefConfigTemplate | None = None
    parent: NestedDeviceRole | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    device_count: int | None = None
    virtualmachine_count: int | None = None
    comments: str | None = None
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class DeviceRoleRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", min_length=1, max_length=6) | None = None
    vm_role: bool | None = Field(None, description="Virtual machines may be assigned to this role")
    config_template: int | BriefConfigTemplateRequest | None = None
    parent: NestedDeviceRoleRequest | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class DeviceType(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    manufacturer: BriefManufacturer
    default_platform: BriefPlatform | None = None
    model: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    part_number: constr(max_length=50) | None = Field(
        None, description="Discrete part number (optional)"
    )
    u_height: PositionU1 | None = Field(
        default_factory=lambda: PositionU1(1.0), title="Position (U)"
    )
    exclude_from_utilization: bool | None = Field(
        None,
        description="Devices of this type are excluded when calculating rack utilization.",
    )
    is_full_depth: bool | None = Field(
        None, description="Device consumes both front and rear rack faces."
    )
    subdevice_role: SubdeviceRole | None = None
    airflow: Airflow | None = None
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    weight_unit: WeightUnit | None = None
    front_image: AnyUrl | None = None
    rear_image: AnyUrl | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    device_count: int | None = None
    console_port_template_count: int
    console_server_port_template_count: int
    power_port_template_count: int
    power_outlet_template_count: int
    interface_template_count: int
    front_port_template_count: int
    rear_port_template_count: int
    device_bay_template_count: int
    module_bay_template_count: int
    inventory_item_template_count: int


class DeviceTypeRequest(BaseModel):
    manufacturer: int | BriefManufacturerRequest
    default_platform: int | BriefPlatformRequest | None = None
    model: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    part_number: constr(max_length=50) | None = Field(
        None, description="Discrete part number (optional)"
    )
    u_height: PositionU1 | None = Field(
        default_factory=lambda: PositionU1(1.0), title="Position (U)"
    )
    exclude_from_utilization: bool | None = Field(
        None,
        description="Devices of this type are excluded when calculating rack utilization.",
    )
    is_full_depth: bool | None = Field(
        None, description="Device consumes both front and rear rack faces."
    )
    subdevice_role: Literal["parent", "child", ""] | None = Field(
        None, description="* `parent` - Parent\n* `child` - Child"
    )
    airflow: (
        Literal[
            "front-to-rear",
            "rear-to-front",
            "left-to-right",
            "right-to-left",
            "side-to-rear",
            "rear-to-side",
            "bottom-to-top",
            "top-to-bottom",
            "passive",
            "mixed",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front\n* `left-to-right` - Left to right\n* `right-to-left` - Right to left\n* `side-to-rear` - Side to rear\n* `rear-to-side` - Rear to side\n* `bottom-to-top` - Bottom to top\n* `top-to-bottom` - Top to bottom\n* `passive` - Passive\n* `mixed` - Mixed",
    )
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    weight_unit: Literal["kg", "g", "lb", "oz", ""] | None = Field(
        None,
        description="* `kg` - Kilograms\n* `g` - Grams\n* `lb` - Pounds\n* `oz` - Ounces",
    )
    front_image: bytes | None = None
    rear_image: bytes | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class DeviceWithConfigContext(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=64) | None = None
    device_type: BriefDeviceType
    role: BriefDeviceRole
    tenant: BriefTenant | None = None
    platform: BriefPlatform | None = None
    serial: SerialNumber | None = Field(
        None,
        description="Chassis serial number, assigned by the manufacturer",
        title="Serial number",
    )
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this device"
    )
    site: BriefSite
    location: BriefLocation | None = None
    rack: BriefRack | None = None
    position: PositionU3 | None = Field(None, title="Position (U)")
    face: Face | None = None
    latitude: confloat(lt=100.0, gt=-100.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    longitude: confloat(lt=1000.0, gt=-1000.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    parent_device: NestedDevice | None = None
    status: Status5 | None = None
    airflow: Airflow | None = None
    primary_ip: BriefIPAddress | None = None
    primary_ip4: BriefIPAddress | None = None
    primary_ip6: BriefIPAddress | None = None
    oob_ip: BriefIPAddress | None = None
    cluster: BriefCluster | None = None
    virtual_chassis: BriefVirtualChassis | None = None
    vc_position: conint(ge=0, le=255) | None = None
    vc_priority: conint(ge=0, le=255) | None = Field(
        None, description="Virtual chassis master election priority"
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    config_template: BriefConfigTemplate | None = None
    config_context: Any | None = None
    local_context_data: Any | None = Field(
        None,
        description="Local config context data takes precedence over source contexts in the final rendered config context",
    )
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    console_port_count: int
    console_server_port_count: int
    power_port_count: int
    power_outlet_count: int
    interface_count: int | None = None
    front_port_count: int
    rear_port_count: int
    device_bay_count: int
    module_bay_count: int
    inventory_item_count: int


class DeviceWithConfigContextRequest(BaseModel):
    name: constr(max_length=64) | None = None
    device_type: int | BriefDeviceTypeRequest
    role: int | BriefDeviceRoleRequest
    tenant: int | BriefTenantRequest | None = None
    platform: int | BriefPlatformRequest | None = None
    serial: SerialNumber | None = Field(
        None,
        description="Chassis serial number, assigned by the manufacturer",
        title="Serial number",
    )
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this device"
    )
    site: int | BriefSiteRequest
    location: int | BriefLocationRequest | None = None
    rack: int | BriefRackRequest | None = None
    position: PositionU3 | None = Field(None, title="Position (U)")
    face: Literal["front", "rear", ""] | None = Field(
        None, description="* `front` - Front\n* `rear` - Rear"
    )
    latitude: confloat(lt=100.0, gt=-100.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    longitude: confloat(lt=1000.0, gt=-1000.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    status: (
        Literal[
            "offline",
            "active",
            "planned",
            "staged",
            "failed",
            "inventory",
            "decommissioning",
        ]
        | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `inventory` - Inventory\n* `decommissioning` - Decommissioning",
    )
    airflow: (
        Literal[
            "front-to-rear",
            "rear-to-front",
            "left-to-right",
            "right-to-left",
            "side-to-rear",
            "rear-to-side",
            "bottom-to-top",
            "top-to-bottom",
            "passive",
            "mixed",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front\n* `left-to-right` - Left to right\n* `right-to-left` - Right to left\n* `side-to-rear` - Side to rear\n* `rear-to-side` - Rear to side\n* `bottom-to-top` - Bottom to top\n* `top-to-bottom` - Top to bottom\n* `passive` - Passive\n* `mixed` - Mixed",
    )
    primary_ip4: int | BriefIPAddressRequest | None = None
    primary_ip6: int | BriefIPAddressRequest | None = None
    oob_ip: int | BriefIPAddressRequest | None = None
    cluster: int | BriefClusterRequest | None = None
    virtual_chassis: int | BriefVirtualChassisRequest | None = None
    vc_position: conint(ge=0, le=255) | None = None
    vc_priority: conint(ge=0, le=255) | None = Field(
        None, description="Virtual chassis master election priority"
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    config_template: int | BriefConfigTemplateRequest | None = None
    local_context_data: Any | None = Field(
        None,
        description="Local config context data takes precedence over source contexts in the final rendered config context",
    )
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class EventRule(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    object_types: list[str]
    name: constr(max_length=150)
    enabled: bool | None = None
    event_types: list[
        Literal[
            "object_created",
            "object_updated",
            "object_deleted",
            "job_started",
            "job_completed",
            "job_failed",
            "job_errored",
        ]
    ] = Field(..., description="The types of event which will trigger this rule.")
    conditions: Any | None = Field(
        None,
        description="A set of conditions which determine whether the event will be generated.",
    )
    action_type: ActionType
    action_object_type: str
    action_object_id: conint(ge=0, le=9223372036854775807) | None = None
    action_object: dict[str, Any]
    description: constr(max_length=200) | None = None
    custom_fields: dict[str, Any] | None = None
    tags: list[NestedTag] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class EventRuleRequest(BaseModel):
    object_types: list[str]
    name: constr(min_length=1, max_length=150)
    enabled: bool | None = None
    event_types: list[
        Literal[
            "object_created",
            "object_updated",
            "object_deleted",
            "job_started",
            "job_completed",
            "job_failed",
            "job_errored",
        ]
    ] = Field(..., description="The types of event which will trigger this rule.")
    conditions: Any | None = Field(
        None,
        description="A set of conditions which determine whether the event will be generated.",
    )
    action_type: Literal["webhook", "script", "notification"] = Field(
        ...,
        description="* `webhook` - Webhook\n* `script` - Script\n* `notification` - Notification",
    )
    action_object_type: str
    action_object_id: conint(ge=0, le=9223372036854775807) | None = None
    description: constr(max_length=200) | None = None
    custom_fields: dict[str, Any] | None = None
    tags: list[NestedTagRequest] | None = None


class FHRPGroup(BaseModel):
    id: int
    name: constr(max_length=100) | None = None
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    protocol: Literal["vrrp2", "vrrp3", "carp", "clusterxl", "hsrp", "glbp", "other"] = Field(
        ...,
        description="* `vrrp2` - VRRPv2\n* `vrrp3` - VRRPv3\n* `carp` - CARP\n* `clusterxl` - ClusterXL\n* `hsrp` - HSRP\n* `glbp` - GLBP\n* `other` - Other",
    )
    group_id: conint(ge=0, le=32767)
    auth_type: AuthenticationType | None = Field(
        None,
        description="* `plaintext` - Plaintext\n* `md5` - MD5",
        title="Authentication type",
    )
    auth_key: AuthenticationKey | None = Field(None, title="Authentication key")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    ip_addresses: list[BriefIPAddress]


class FHRPGroupRequest(BaseModel):
    name: constr(max_length=100) | None = None
    protocol: Literal["vrrp2", "vrrp3", "carp", "clusterxl", "hsrp", "glbp", "other"] = Field(
        ...,
        description="* `vrrp2` - VRRPv2\n* `vrrp3` - VRRPv3\n* `carp` - CARP\n* `clusterxl` - ClusterXL\n* `hsrp` - HSRP\n* `glbp` - GLBP\n* `other` - Other",
    )
    group_id: conint(ge=0, le=32767)
    auth_type: AuthenticationType | None = Field(
        None,
        description="* `plaintext` - Plaintext\n* `md5` - MD5",
        title="Authentication type",
    )
    auth_key: AuthenticationKey | None = Field(None, title="Authentication key")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class FrontPort(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: BriefDevice
    module: BriefModule | None = None
    name: constr(max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type7
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    rear_port: FrontPortRearPort
    rear_port_position: conint(ge=1, le=1024) | None = Field(
        None, description="Mapped position on corresponding rear port"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    cable: BriefCable | None = None
    cable_end: str | None = None
    link_peers: list[Any]
    link_peers_type: str | None = Field(
        None, description="Return the type of the peer link terminations, or None."
    )
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    field_occupied: FieldOccupied = Field(..., alias="_occupied", title=" occupied")


class FrontPortRequest(BaseModel):
    device: int | BriefDeviceRequest
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Literal[
        "8p8c",
        "8p6c",
        "8p4c",
        "8p2c",
        "6p6c",
        "6p4c",
        "6p2c",
        "4p4c",
        "4p2c",
        "gg45",
        "tera-4p",
        "tera-2p",
        "tera-1p",
        "110-punch",
        "bnc",
        "f",
        "n",
        "mrj21",
        "fc",
        "fc-pc",
        "fc-upc",
        "fc-apc",
        "lc",
        "lc-pc",
        "lc-upc",
        "lc-apc",
        "lsh",
        "lsh-pc",
        "lsh-upc",
        "lsh-apc",
        "lx5",
        "lx5-pc",
        "lx5-upc",
        "lx5-apc",
        "mpo",
        "mtrj",
        "sc",
        "sc-pc",
        "sc-upc",
        "sc-apc",
        "st",
        "cs",
        "sn",
        "sma-905",
        "sma-906",
        "urm-p2",
        "urm-p4",
        "urm-p8",
        "splice",
        "usb-a",
        "usb-b",
        "usb-c",
        "usb-mini-a",
        "usb-mini-b",
        "usb-micro-a",
        "usb-micro-b",
        "usb-micro-ab",
        "other",
    ] = Field(
        ...,
        description="* `8p8c` - 8P8C\n* `8p6c` - 8P6C\n* `8p4c` - 8P4C\n* `8p2c` - 8P2C\n* `6p6c` - 6P6C\n* `6p4c` - 6P4C\n* `6p2c` - 6P2C\n* `4p4c` - 4P4C\n* `4p2c` - 4P2C\n* `gg45` - GG45\n* `tera-4p` - TERA 4P\n* `tera-2p` - TERA 2P\n* `tera-1p` - TERA 1P\n* `110-punch` - 110 Punch\n* `bnc` - BNC\n* `f` - F Connector\n* `n` - N Connector\n* `mrj21` - MRJ21\n* `fc` - FC\n* `fc-pc` - FC/PC\n* `fc-upc` - FC/UPC\n* `fc-apc` - FC/APC\n* `lc` - LC\n* `lc-pc` - LC/PC\n* `lc-upc` - LC/UPC\n* `lc-apc` - LC/APC\n* `lsh` - LSH\n* `lsh-pc` - LSH/PC\n* `lsh-upc` - LSH/UPC\n* `lsh-apc` - LSH/APC\n* `lx5` - LX.5\n* `lx5-pc` - LX.5/PC\n* `lx5-upc` - LX.5/UPC\n* `lx5-apc` - LX.5/APC\n* `mpo` - MPO\n* `mtrj` - MTRJ\n* `sc` - SC\n* `sc-pc` - SC/PC\n* `sc-upc` - SC/UPC\n* `sc-apc` - SC/APC\n* `st` - ST\n* `cs` - CS\n* `sn` - SN\n* `sma-905` - SMA 905\n* `sma-906` - SMA 906\n* `urm-p2` - URM-P2\n* `urm-p4` - URM-P4\n* `urm-p8` - URM-P8\n* `splice` - Splice\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    rear_port: FrontPortRearPortRequest
    rear_port_position: conint(ge=1, le=1024) | None = Field(
        None, description="Mapped position on corresponding rear port"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class FrontPortTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device_type: BriefDeviceType | None = None
    module_type: BriefModuleType | None = None
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type7
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    rear_port: BriefRearPortTemplate
    rear_port_position: conint(ge=1, le=1024) | None = None
    description: constr(max_length=200) | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class FrontPortTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Literal[
        "8p8c",
        "8p6c",
        "8p4c",
        "8p2c",
        "6p6c",
        "6p4c",
        "6p2c",
        "4p4c",
        "4p2c",
        "gg45",
        "tera-4p",
        "tera-2p",
        "tera-1p",
        "110-punch",
        "bnc",
        "f",
        "n",
        "mrj21",
        "fc",
        "fc-pc",
        "fc-upc",
        "fc-apc",
        "lc",
        "lc-pc",
        "lc-upc",
        "lc-apc",
        "lsh",
        "lsh-pc",
        "lsh-upc",
        "lsh-apc",
        "lx5",
        "lx5-pc",
        "lx5-upc",
        "lx5-apc",
        "mpo",
        "mtrj",
        "sc",
        "sc-pc",
        "sc-upc",
        "sc-apc",
        "st",
        "cs",
        "sn",
        "sma-905",
        "sma-906",
        "urm-p2",
        "urm-p4",
        "urm-p8",
        "splice",
        "usb-a",
        "usb-b",
        "usb-c",
        "usb-mini-a",
        "usb-mini-b",
        "usb-micro-a",
        "usb-micro-b",
        "usb-micro-ab",
        "other",
    ] = Field(
        ...,
        description="* `8p8c` - 8P8C\n* `8p6c` - 8P6C\n* `8p4c` - 8P4C\n* `8p2c` - 8P2C\n* `6p6c` - 6P6C\n* `6p4c` - 6P4C\n* `6p2c` - 6P2C\n* `4p4c` - 4P4C\n* `4p2c` - 4P2C\n* `gg45` - GG45\n* `tera-4p` - TERA 4P\n* `tera-2p` - TERA 2P\n* `tera-1p` - TERA 1P\n* `110-punch` - 110 Punch\n* `bnc` - BNC\n* `f` - F Connector\n* `n` - N Connector\n* `mrj21` - MRJ21\n* `fc` - FC\n* `fc-pc` - FC/PC\n* `fc-upc` - FC/UPC\n* `fc-apc` - FC/APC\n* `lc` - LC\n* `lc-pc` - LC/PC\n* `lc-upc` - LC/UPC\n* `lc-apc` - LC/APC\n* `lsh` - LSH\n* `lsh-pc` - LSH/PC\n* `lsh-upc` - LSH/UPC\n* `lsh-apc` - LSH/APC\n* `lx5` - LX.5\n* `lx5-pc` - LX.5/PC\n* `lx5-upc` - LX.5/UPC\n* `lx5-apc` - LX.5/APC\n* `mpo` - MPO\n* `mtrj` - MTRJ\n* `sc` - SC\n* `sc-pc` - SC/PC\n* `sc-upc` - SC/UPC\n* `sc-apc` - SC/APC\n* `st` - ST\n* `cs` - CS\n* `sn` - SN\n* `sma-905` - SMA 905\n* `sma-906` - SMA 906\n* `urm-p2` - URM-P2\n* `urm-p4` - URM-P4\n* `urm-p8` - URM-P8\n* `splice` - Splice\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    rear_port: int | BriefRearPortTemplateRequest
    rear_port_position: conint(ge=1, le=1024) | None = None
    description: constr(max_length=200) | None = None


class Group(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=150)
    description: constr(max_length=200) | None = None
    permissions: list[ObjectPermission] | None = None
    user_count: int | None = None


class IKEPolicyRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    version: Literal[1, 2] = Field(..., description="* `1` - IKEv1\n* `2` - IKEv2")
    mode: Literal["aggressive", "main"] | None = Field(
        None, description="* `aggressive` - Aggressive\n* `main` - Main"
    )
    proposals: list[int] | None = None
    preshared_key: PreSharedKey | None = Field(None, title="Pre-shared key")
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class IKEProposal(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    authentication_method: AuthenticationMethod
    encryption_algorithm: EncryptionAlgorithm
    authentication_algorithm: AuthenticationAlgorithm | None = None
    group: Group1
    sa_lifetime: conint(ge=0, le=2147483647) | None = Field(
        None, description="Security association lifetime (in seconds)"
    )
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class IKEProposalRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    authentication_method: Literal[
        "preshared-keys", "certificates", "rsa-signatures", "dsa-signatures"
    ] = Field(
        ...,
        description="* `preshared-keys` - Pre-shared keys\n* `certificates` - Certificates\n* `rsa-signatures` - RSA signatures\n* `dsa-signatures` - DSA signatures",
    )
    encryption_algorithm: Literal[
        "aes-128-cbc",
        "aes-128-gcm",
        "aes-192-cbc",
        "aes-192-gcm",
        "aes-256-cbc",
        "aes-256-gcm",
        "3des-cbc",
        "des-cbc",
    ] = Field(
        ...,
        description="* `aes-128-cbc` - 128-bit AES (CBC)\n* `aes-128-gcm` - 128-bit AES (GCM)\n* `aes-192-cbc` - 192-bit AES (CBC)\n* `aes-192-gcm` - 192-bit AES (GCM)\n* `aes-256-cbc` - 256-bit AES (CBC)\n* `aes-256-gcm` - 256-bit AES (GCM)\n* `3des-cbc` - 3DES\n* `des-cbc` - DES",
    )
    authentication_algorithm: (
        Literal["hmac-sha1", "hmac-sha256", "hmac-sha384", "hmac-sha512", "hmac-md5"] | None
    ) = Field(
        None,
        description="* `hmac-sha1` - SHA-1 HMAC\n* `hmac-sha256` - SHA-256 HMAC\n* `hmac-sha384` - SHA-384 HMAC\n* `hmac-sha512` - SHA-512 HMAC\n* `hmac-md5` - MD5 HMAC",
    )
    group: Literal[
        1,
        2,
        5,
        14,
        15,
        16,
        17,
        18,
        19,
        20,
        21,
        22,
        23,
        24,
        25,
        26,
        27,
        28,
        29,
        30,
        31,
        32,
        33,
        34,
    ] = Field(
        ...,
        description="* `1` - Group 1\n* `2` - Group 2\n* `5` - Group 5\n* `14` - Group 14\n* `15` - Group 15\n* `16` - Group 16\n* `17` - Group 17\n* `18` - Group 18\n* `19` - Group 19\n* `20` - Group 20\n* `21` - Group 21\n* `22` - Group 22\n* `23` - Group 23\n* `24` - Group 24\n* `25` - Group 25\n* `26` - Group 26\n* `27` - Group 27\n* `28` - Group 28\n* `29` - Group 29\n* `30` - Group 30\n* `31` - Group 31\n* `32` - Group 32\n* `33` - Group 33\n* `34` - Group 34",
    )
    sa_lifetime: conint(ge=0, le=2147483647) | None = Field(
        None, description="Security association lifetime (in seconds)"
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class IPAddress(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    family: Family
    address: str
    vrf: BriefVRF | None = None
    tenant: BriefTenant | None = None
    status: Status7 | None = None
    role: Role | None = None
    assigned_object_type: str | None = None
    assigned_object_id: conint(ge=0, le=9223372036854775807) | None = None
    assigned_object: Any | None = None
    nat_inside: NestedIPAddress | None = None
    nat_outside: list[NestedIPAddress]
    dns_name: (
        constr(pattern=r"^([0-9A-Za-z_-]+|\*)(\.[0-9A-Za-z_-]+)*\.?$", max_length=255) | None
    ) = Field(None, description="Hostname or FQDN (not case-sensitive)")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class IPAddressRequest(BaseModel):
    address: constr(min_length=1)
    vrf: int | BriefVRFRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    status: Literal["active", "reserved", "deprecated", "dhcp", "slaac"] | None = Field(
        None,
        description="* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated\n* `dhcp` - DHCP\n* `slaac` - SLAAC",
    )
    role: (
        Literal[
            "loopback",
            "secondary",
            "anycast",
            "vip",
            "vrrp",
            "hsrp",
            "glbp",
            "carp",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `loopback` - Loopback\n* `secondary` - Secondary\n* `anycast` - Anycast\n* `vip` - VIP\n* `vrrp` - VRRP\n* `hsrp` - HSRP\n* `glbp` - GLBP\n* `carp` - CARP",
    )
    assigned_object_type: str | None = None
    assigned_object_id: conint(ge=0, le=9223372036854775807) | None = None
    nat_inside: NestedIPAddressRequest | None = None
    dns_name: (
        constr(pattern=r"^([0-9A-Za-z_-]+|\*)(\.[0-9A-Za-z_-]+)*\.?$", max_length=255) | None
    ) = Field(None, description="Hostname or FQDN (not case-sensitive)")
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class IPRange(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    family: Family
    start_address: str
    end_address: str
    size: int
    vrf: BriefVRF | None = None
    tenant: BriefTenant | None = None
    status: Status8 | None = None
    role: BriefRole | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    mark_populated: bool | None = Field(
        None, description="Prevent the creation of IP addresses within this range"
    )
    mark_utilized: bool | None = Field(None, description="Report space as 100% utilized")


class IPRangeRequest(BaseModel):
    start_address: constr(min_length=1)
    end_address: constr(min_length=1)
    vrf: int | BriefVRFRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    status: Literal["active", "reserved", "deprecated"] | None = Field(
        None,
        description="* `active` - Active\n* `reserved` - Reserved\n* `deprecated` - Deprecated",
    )
    role: int | BriefRoleRequest | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    mark_populated: bool | None = Field(
        None, description="Prevent the creation of IP addresses within this range"
    )
    mark_utilized: bool | None = Field(None, description="Report space as 100% utilized")


class IPSecPolicyRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    proposals: list[int] | None = None
    pfs_group: (
        Literal[
            1,
            2,
            5,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            27,
            28,
            29,
            30,
            31,
            32,
            33,
            34,
        ]
        | None
    ) = Field(
        None,
        description="* `1` - Group 1\n* `2` - Group 2\n* `5` - Group 5\n* `14` - Group 14\n* `15` - Group 15\n* `16` - Group 16\n* `17` - Group 17\n* `18` - Group 18\n* `19` - Group 19\n* `20` - Group 20\n* `21` - Group 21\n* `22` - Group 22\n* `23` - Group 23\n* `24` - Group 24\n* `25` - Group 25\n* `26` - Group 26\n* `27` - Group 27\n* `28` - Group 28\n* `29` - Group 29\n* `30` - Group 30\n* `31` - Group 31\n* `32` - Group 32\n* `33` - Group 33\n* `34` - Group 34",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class IPSecProfile(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    mode: Mode1
    ike_policy: BriefIKEPolicy
    ipsec_policy: BriefIPSecPolicy
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class IPSecProfileRequest(WritableIPSecProfileRequest):
    pass


class IPSecProposal(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    encryption_algorithm: EncryptionAlgorithm | None = None
    authentication_algorithm: AuthenticationAlgorithm | None = None
    sa_lifetime_seconds: SALifetimeSeconds | None = Field(
        None,
        description="Security association lifetime (seconds)",
        title="SA lifetime (seconds)",
    )
    sa_lifetime_data: SALifetimeKB | None = Field(
        None,
        description="Security association lifetime (in kilobytes)",
        title="SA lifetime (KB)",
    )
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class IPSecProposalRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    encryption_algorithm: (
        Literal[
            "aes-128-cbc",
            "aes-128-gcm",
            "aes-192-cbc",
            "aes-192-gcm",
            "aes-256-cbc",
            "aes-256-gcm",
            "3des-cbc",
            "des-cbc",
        ]
        | None
    ) = Field(
        None,
        description="* `aes-128-cbc` - 128-bit AES (CBC)\n* `aes-128-gcm` - 128-bit AES (GCM)\n* `aes-192-cbc` - 192-bit AES (CBC)\n* `aes-192-gcm` - 192-bit AES (GCM)\n* `aes-256-cbc` - 256-bit AES (CBC)\n* `aes-256-gcm` - 256-bit AES (GCM)\n* `3des-cbc` - 3DES\n* `des-cbc` - DES",
    )
    authentication_algorithm: (
        Literal["hmac-sha1", "hmac-sha256", "hmac-sha384", "hmac-sha512", "hmac-md5"] | None
    ) = Field(
        None,
        description="* `hmac-sha1` - SHA-1 HMAC\n* `hmac-sha256` - SHA-256 HMAC\n* `hmac-sha384` - SHA-384 HMAC\n* `hmac-sha512` - SHA-512 HMAC\n* `hmac-md5` - MD5 HMAC",
    )
    sa_lifetime_seconds: SALifetimeSeconds | None = Field(
        None,
        description="Security association lifetime (seconds)",
        title="SA lifetime (seconds)",
    )
    sa_lifetime_data: SALifetimeKB | None = Field(
        None,
        description="Security association lifetime (in kilobytes)",
        title="SA lifetime (KB)",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Interface(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: BriefDevice
    vdcs: list[VirtualDeviceContext] | None = None
    module: BriefModule | None = None
    name: constr(max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type9
    enabled: bool | None = None
    parent: NestedInterface | None = None
    bridge: NestedInterface | None = None
    lag: NestedInterface | None = None
    mtu: conint(ge=1, le=65536) | None = None
    mac_address: str | None = None
    primary_mac_address: BriefMACAddress | None = None
    mac_addresses: list[BriefMACAddress] | None = None
    speed: SpeedKbps | None = Field(None, title="Speed (Kbps)")
    duplex: Duplex | None = None
    wwn: str | None = None
    mgmt_only: ManagementOnly | None = Field(
        None,
        description="This interface is used only for out-of-band management",
        title="Management only",
    )
    description: constr(max_length=200) | None = None
    mode: Mode2 | None = None
    rf_role: RfRole | None = None
    rf_channel: RfChannel | None = None
    poe_mode: PoeMode | None = None
    poe_type: PoeType | None = None
    rf_channel_frequency: ChannelFrequencyMHz | None = Field(
        None,
        description="Populated by selected channel (if set)",
        title="Channel frequency (MHz)",
    )
    rf_channel_width: ChannelWidthMHz | None = Field(
        None,
        description="Populated by selected channel (if set)",
        title="Channel width (MHz)",
    )
    tx_power: TransmitPowerDBm | None = Field(None, title="Transmit power (dBm)")
    untagged_vlan: BriefVLAN | None = None
    tagged_vlans: list[VLAN] | None = None
    qinq_svlan: BriefVLAN | None = None
    vlan_translation_policy: BriefVLANTranslationPolicy | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    cable: BriefCable | None = None
    cable_end: str | None = None
    wireless_link: NestedWirelessLink | None = None
    link_peers: list[Any]
    link_peers_type: str | None = Field(
        None, description="Return the type of the peer link terminations, or None."
    )
    wireless_lans: list[WirelessLAN] | None = None
    vrf: BriefVRF | None = None
    l2vpn_termination: BriefL2VPNTermination | None = None
    connected_endpoints: list[Any] | None = None
    connected_endpoints_type: str | None = None
    connected_endpoints_reachable: bool
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    count_ipaddresses: int
    count_fhrp_groups: int
    field_occupied: FieldOccupied = Field(..., alias="_occupied", title=" occupied")


class InterfaceRequest(BaseModel):
    device: int | BriefDeviceRequest
    vdcs: list[int] | None = None
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Literal[
        "virtual",
        "bridge",
        "lag",
        "100base-fx",
        "100base-lfx",
        "100base-tx",
        "100base-t1",
        "1000base-t",
        "1000base-lx",
        "1000base-tx",
        "2.5gbase-t",
        "5gbase-t",
        "10gbase-t",
        "10gbase-cx4",
        "100base-x-sfp",
        "1000base-x-gbic",
        "1000base-x-sfp",
        "10gbase-x-sfpp",
        "10gbase-x-xfp",
        "10gbase-x-xenpak",
        "10gbase-x-x2",
        "25gbase-x-sfp28",
        "50gbase-x-sfp56",
        "40gbase-x-qsfpp",
        "50gbase-x-sfp28",
        "100gbase-x-cfp",
        "100gbase-x-cfp2",
        "200gbase-x-cfp2",
        "400gbase-x-cfp2",
        "100gbase-x-cfp4",
        "100gbase-x-cxp",
        "100gbase-x-cpak",
        "100gbase-x-dsfp",
        "100gbase-x-sfpdd",
        "100gbase-x-qsfp28",
        "100gbase-x-qsfpdd",
        "200gbase-x-qsfp56",
        "200gbase-x-qsfpdd",
        "400gbase-x-qsfp112",
        "400gbase-x-qsfpdd",
        "400gbase-x-osfp",
        "400gbase-x-osfp-rhs",
        "400gbase-x-cdfp",
        "400gbase-x-cfp8",
        "800gbase-x-qsfpdd",
        "800gbase-x-osfp",
        "1000base-kx",
        "2.5gbase-kx",
        "5gbase-kr",
        "10gbase-kr",
        "10gbase-kx4",
        "25gbase-kr",
        "40gbase-kr4",
        "50gbase-kr",
        "100gbase-kp4",
        "100gbase-kr2",
        "100gbase-kr4",
        "ieee802.11a",
        "ieee802.11g",
        "ieee802.11n",
        "ieee802.11ac",
        "ieee802.11ad",
        "ieee802.11ax",
        "ieee802.11ay",
        "ieee802.11be",
        "ieee802.15.1",
        "ieee802.15.4",
        "other-wireless",
        "gsm",
        "cdma",
        "lte",
        "4g",
        "5g",
        "sonet-oc3",
        "sonet-oc12",
        "sonet-oc48",
        "sonet-oc192",
        "sonet-oc768",
        "sonet-oc1920",
        "sonet-oc3840",
        "1gfc-sfp",
        "2gfc-sfp",
        "4gfc-sfp",
        "8gfc-sfpp",
        "16gfc-sfpp",
        "32gfc-sfp28",
        "32gfc-sfpp",
        "64gfc-qsfpp",
        "64gfc-sfpdd",
        "64gfc-sfpp",
        "128gfc-qsfp28",
        "infiniband-sdr",
        "infiniband-ddr",
        "infiniband-qdr",
        "infiniband-fdr10",
        "infiniband-fdr",
        "infiniband-edr",
        "infiniband-hdr",
        "infiniband-ndr",
        "infiniband-xdr",
        "t1",
        "e1",
        "t3",
        "e3",
        "xdsl",
        "docsis",
        "moca",
        "bpon",
        "epon",
        "10g-epon",
        "gpon",
        "xg-pon",
        "xgs-pon",
        "ng-pon2",
        "25g-pon",
        "50g-pon",
        "cisco-stackwise",
        "cisco-stackwise-plus",
        "cisco-flexstack",
        "cisco-flexstack-plus",
        "cisco-stackwise-80",
        "cisco-stackwise-160",
        "cisco-stackwise-320",
        "cisco-stackwise-480",
        "cisco-stackwise-1t",
        "juniper-vcp",
        "extreme-summitstack",
        "extreme-summitstack-128",
        "extreme-summitstack-256",
        "extreme-summitstack-512",
        "other",
    ] = Field(
        ...,
        description="* `virtual` - Virtual\n* `bridge` - Bridge\n* `lag` - Link Aggregation Group (LAG)\n* `100base-fx` - 100BASE-FX (10/100ME FIBER)\n* `100base-lfx` - 100BASE-LFX (10/100ME FIBER)\n* `100base-tx` - 100BASE-TX (10/100ME)\n* `100base-t1` - 100BASE-T1 (10/100ME Single Pair)\n* `1000base-t` - 1000BASE-T (1GE)\n* `1000base-lx` - 1000BASE-LX (1GE)\n* `1000base-tx` - 1000BASE-TX (1GE)\n* `2.5gbase-t` - 2.5GBASE-T (2.5GE)\n* `5gbase-t` - 5GBASE-T (5GE)\n* `10gbase-t` - 10GBASE-T (10GE)\n* `10gbase-cx4` - 10GBASE-CX4 (10GE)\n* `100base-x-sfp` - SFP (100ME)\n* `1000base-x-gbic` - GBIC (1GE)\n* `1000base-x-sfp` - SFP (1GE)\n* `10gbase-x-sfpp` - SFP+ (10GE)\n* `10gbase-x-xfp` - XFP (10GE)\n* `10gbase-x-xenpak` - XENPAK (10GE)\n* `10gbase-x-x2` - X2 (10GE)\n* `25gbase-x-sfp28` - SFP28 (25GE)\n* `50gbase-x-sfp56` - SFP56 (50GE)\n* `40gbase-x-qsfpp` - QSFP+ (40GE)\n* `50gbase-x-sfp28` - QSFP28 (50GE)\n* `100gbase-x-cfp` - CFP (100GE)\n* `100gbase-x-cfp2` - CFP2 (100GE)\n* `200gbase-x-cfp2` - CFP2 (200GE)\n* `400gbase-x-cfp2` - CFP2 (400GE)\n* `100gbase-x-cfp4` - CFP4 (100GE)\n* `100gbase-x-cxp` - CXP (100GE)\n* `100gbase-x-cpak` - Cisco CPAK (100GE)\n* `100gbase-x-dsfp` - DSFP (100GE)\n* `100gbase-x-sfpdd` - SFP-DD (100GE)\n* `100gbase-x-qsfp28` - QSFP28 (100GE)\n* `100gbase-x-qsfpdd` - QSFP-DD (100GE)\n* `200gbase-x-qsfp56` - QSFP56 (200GE)\n* `200gbase-x-qsfpdd` - QSFP-DD (200GE)\n* `400gbase-x-qsfp112` - QSFP112 (400GE)\n* `400gbase-x-qsfpdd` - QSFP-DD (400GE)\n* `400gbase-x-osfp` - OSFP (400GE)\n* `400gbase-x-osfp-rhs` - OSFP-RHS (400GE)\n* `400gbase-x-cdfp` - CDFP (400GE)\n* `400gbase-x-cfp8` - CPF8 (400GE)\n* `800gbase-x-qsfpdd` - QSFP-DD (800GE)\n* `800gbase-x-osfp` - OSFP (800GE)\n* `1000base-kx` - 1000BASE-KX (1GE)\n* `2.5gbase-kx` - 2.5GBASE-KX (2.5GE)\n* `5gbase-kr` - 5GBASE-KR (5GE)\n* `10gbase-kr` - 10GBASE-KR (10GE)\n* `10gbase-kx4` - 10GBASE-KX4 (10GE)\n* `25gbase-kr` - 25GBASE-KR (25GE)\n* `40gbase-kr4` - 40GBASE-KR4 (40GE)\n* `50gbase-kr` - 50GBASE-KR (50GE)\n* `100gbase-kp4` - 100GBASE-KP4 (100GE)\n* `100gbase-kr2` - 100GBASE-KR2 (100GE)\n* `100gbase-kr4` - 100GBASE-KR4 (100GE)\n* `ieee802.11a` - IEEE 802.11a\n* `ieee802.11g` - IEEE 802.11b/g\n* `ieee802.11n` - IEEE 802.11n\n* `ieee802.11ac` - IEEE 802.11ac\n* `ieee802.11ad` - IEEE 802.11ad\n* `ieee802.11ax` - IEEE 802.11ax\n* `ieee802.11ay` - IEEE 802.11ay\n* `ieee802.11be` - IEEE 802.11be\n* `ieee802.15.1` - IEEE 802.15.1 (Bluetooth)\n* `ieee802.15.4` - IEEE 802.15.4 (LR-WPAN)\n* `other-wireless` - Other (Wireless)\n* `gsm` - GSM\n* `cdma` - CDMA\n* `lte` - LTE\n* `4g` - 4G\n* `5g` - 5G\n* `sonet-oc3` - OC-3/STM-1\n* `sonet-oc12` - OC-12/STM-4\n* `sonet-oc48` - OC-48/STM-16\n* `sonet-oc192` - OC-192/STM-64\n* `sonet-oc768` - OC-768/STM-256\n* `sonet-oc1920` - OC-1920/STM-640\n* `sonet-oc3840` - OC-3840/STM-1234\n* `1gfc-sfp` - SFP (1GFC)\n* `2gfc-sfp` - SFP (2GFC)\n* `4gfc-sfp` - SFP (4GFC)\n* `8gfc-sfpp` - SFP+ (8GFC)\n* `16gfc-sfpp` - SFP+ (16GFC)\n* `32gfc-sfp28` - SFP28 (32GFC)\n* `32gfc-sfpp` - SFP+ (32GFC)\n* `64gfc-qsfpp` - QSFP+ (64GFC)\n* `64gfc-sfpdd` - SFP-DD (64GFC)\n* `64gfc-sfpp` - SFP+ (64GFC)\n* `128gfc-qsfp28` - QSFP28 (128GFC)\n* `infiniband-sdr` - SDR (2 Gbps)\n* `infiniband-ddr` - DDR (4 Gbps)\n* `infiniband-qdr` - QDR (8 Gbps)\n* `infiniband-fdr10` - FDR10 (10 Gbps)\n* `infiniband-fdr` - FDR (13.5 Gbps)\n* `infiniband-edr` - EDR (25 Gbps)\n* `infiniband-hdr` - HDR (50 Gbps)\n* `infiniband-ndr` - NDR (100 Gbps)\n* `infiniband-xdr` - XDR (250 Gbps)\n* `t1` - T1 (1.544 Mbps)\n* `e1` - E1 (2.048 Mbps)\n* `t3` - T3 (45 Mbps)\n* `e3` - E3 (34 Mbps)\n* `xdsl` - xDSL\n* `docsis` - DOCSIS\n* `moca` - MoCA\n* `bpon` - BPON (622 Mbps / 155 Mbps)\n* `epon` - EPON (1 Gbps)\n* `10g-epon` - 10G-EPON (10 Gbps)\n* `gpon` - GPON (2.5 Gbps / 1.25 Gbps)\n* `xg-pon` - XG-PON (10 Gbps / 2.5 Gbps)\n* `xgs-pon` - XGS-PON (10 Gbps)\n* `ng-pon2` - NG-PON2 (TWDM-PON) (4x10 Gbps)\n* `25g-pon` - 25G-PON (25 Gbps)\n* `50g-pon` - 50G-PON (50 Gbps)\n* `cisco-stackwise` - Cisco StackWise\n* `cisco-stackwise-plus` - Cisco StackWise Plus\n* `cisco-flexstack` - Cisco FlexStack\n* `cisco-flexstack-plus` - Cisco FlexStack Plus\n* `cisco-stackwise-80` - Cisco StackWise-80\n* `cisco-stackwise-160` - Cisco StackWise-160\n* `cisco-stackwise-320` - Cisco StackWise-320\n* `cisco-stackwise-480` - Cisco StackWise-480\n* `cisco-stackwise-1t` - Cisco StackWise-1T\n* `juniper-vcp` - Juniper VCP\n* `extreme-summitstack` - Extreme SummitStack\n* `extreme-summitstack-128` - Extreme SummitStack-128\n* `extreme-summitstack-256` - Extreme SummitStack-256\n* `extreme-summitstack-512` - Extreme SummitStack-512\n* `other` - Other",
    )
    enabled: bool | None = None
    parent: NestedInterfaceRequest | None = None
    bridge: NestedInterfaceRequest | None = None
    lag: NestedInterfaceRequest | None = None
    mtu: conint(ge=1, le=65536) | None = None
    primary_mac_address: int | BriefMACAddressRequest | None = None
    speed: SpeedKbps | None = Field(None, title="Speed (Kbps)")
    duplex: Literal["half", "full", "auto", ""] | None = Field(
        None, description="* `half` - Half\n* `full` - Full\n* `auto` - Auto"
    )
    wwn: str | None = None
    mgmt_only: ManagementOnly | None = Field(
        None,
        description="This interface is used only for out-of-band management",
        title="Management only",
    )
    description: constr(max_length=200) | None = None
    mode: Literal["access", "tagged", "tagged-all", "q-in-q", ""] | None = Field(
        None,
        description="* `access` - Access\n* `tagged` - Tagged\n* `tagged-all` - Tagged (All)\n* `q-in-q` - Q-in-Q (802.1ad)",
    )
    rf_role: Literal["ap", "station", ""] | None = Field(
        None, description="* `ap` - Access point\n* `station` - Station"
    )
    rf_channel: (
        Literal[
            "2.4g-1-2412-22",
            "2.4g-2-2417-22",
            "2.4g-3-2422-22",
            "2.4g-4-2427-22",
            "2.4g-5-2432-22",
            "2.4g-6-2437-22",
            "2.4g-7-2442-22",
            "2.4g-8-2447-22",
            "2.4g-9-2452-22",
            "2.4g-10-2457-22",
            "2.4g-11-2462-22",
            "2.4g-12-2467-22",
            "2.4g-13-2472-22",
            "5g-32-5160-20",
            "5g-34-5170-40",
            "5g-36-5180-20",
            "5g-38-5190-40",
            "5g-40-5200-20",
            "5g-42-5210-80",
            "5g-44-5220-20",
            "5g-46-5230-40",
            "5g-48-5240-20",
            "5g-50-5250-160",
            "5g-52-5260-20",
            "5g-54-5270-40",
            "5g-56-5280-20",
            "5g-58-5290-80",
            "5g-60-5300-20",
            "5g-62-5310-40",
            "5g-64-5320-20",
            "5g-100-5500-20",
            "5g-102-5510-40",
            "5g-104-5520-20",
            "5g-106-5530-80",
            "5g-108-5540-20",
            "5g-110-5550-40",
            "5g-112-5560-20",
            "5g-114-5570-160",
            "5g-116-5580-20",
            "5g-118-5590-40",
            "5g-120-5600-20",
            "5g-122-5610-80",
            "5g-124-5620-20",
            "5g-126-5630-40",
            "5g-128-5640-20",
            "5g-132-5660-20",
            "5g-134-5670-40",
            "5g-136-5680-20",
            "5g-138-5690-80",
            "5g-140-5700-20",
            "5g-142-5710-40",
            "5g-144-5720-20",
            "5g-149-5745-20",
            "5g-151-5755-40",
            "5g-153-5765-20",
            "5g-155-5775-80",
            "5g-157-5785-20",
            "5g-159-5795-40",
            "5g-161-5805-20",
            "5g-163-5815-160",
            "5g-165-5825-20",
            "5g-167-5835-40",
            "5g-169-5845-20",
            "5g-171-5855-80",
            "5g-173-5865-20",
            "5g-175-5875-40",
            "5g-177-5885-20",
            "6g-1-5955-20",
            "6g-3-5965-40",
            "6g-5-5975-20",
            "6g-7-5985-80",
            "6g-9-5995-20",
            "6g-11-6005-40",
            "6g-13-6015-20",
            "6g-15-6025-160",
            "6g-17-6035-20",
            "6g-19-6045-40",
            "6g-21-6055-20",
            "6g-23-6065-80",
            "6g-25-6075-20",
            "6g-27-6085-40",
            "6g-29-6095-20",
            "6g-31-6105-320",
            "6g-33-6115-20",
            "6g-35-6125-40",
            "6g-37-6135-20",
            "6g-39-6145-80",
            "6g-41-6155-20",
            "6g-43-6165-40",
            "6g-45-6175-20",
            "6g-47-6185-160",
            "6g-49-6195-20",
            "6g-51-6205-40",
            "6g-53-6215-20",
            "6g-55-6225-80",
            "6g-57-6235-20",
            "6g-59-6245-40",
            "6g-61-6255-20",
            "6g-65-6275-20",
            "6g-67-6285-40",
            "6g-69-6295-20",
            "6g-71-6305-80",
            "6g-73-6315-20",
            "6g-75-6325-40",
            "6g-77-6335-20",
            "6g-79-6345-160",
            "6g-81-6355-20",
            "6g-83-6365-40",
            "6g-85-6375-20",
            "6g-87-6385-80",
            "6g-89-6395-20",
            "6g-91-6405-40",
            "6g-93-6415-20",
            "6g-95-6425-320",
            "6g-97-6435-20",
            "6g-99-6445-40",
            "6g-101-6455-20",
            "6g-103-6465-80",
            "6g-105-6475-20",
            "6g-107-6485-40",
            "6g-109-6495-20",
            "6g-111-6505-160",
            "6g-113-6515-20",
            "6g-115-6525-40",
            "6g-117-6535-20",
            "6g-119-6545-80",
            "6g-121-6555-20",
            "6g-123-6565-40",
            "6g-125-6575-20",
            "6g-129-6595-20",
            "6g-131-6605-40",
            "6g-133-6615-20",
            "6g-135-6625-80",
            "6g-137-6635-20",
            "6g-139-6645-40",
            "6g-141-6655-20",
            "6g-143-6665-160",
            "6g-145-6675-20",
            "6g-147-6685-40",
            "6g-149-6695-20",
            "6g-151-6705-80",
            "6g-153-6715-20",
            "6g-155-6725-40",
            "6g-157-6735-20",
            "6g-159-6745-320",
            "6g-161-6755-20",
            "6g-163-6765-40",
            "6g-165-6775-20",
            "6g-167-6785-80",
            "6g-169-6795-20",
            "6g-171-6805-40",
            "6g-173-6815-20",
            "6g-175-6825-160",
            "6g-177-6835-20",
            "6g-179-6845-40",
            "6g-181-6855-20",
            "6g-183-6865-80",
            "6g-185-6875-20",
            "6g-187-6885-40",
            "6g-189-6895-20",
            "6g-193-6915-20",
            "6g-195-6925-40",
            "6g-197-6935-20",
            "6g-199-6945-80",
            "6g-201-6955-20",
            "6g-203-6965-40",
            "6g-205-6975-20",
            "6g-207-6985-160",
            "6g-209-6995-20",
            "6g-211-7005-40",
            "6g-213-7015-20",
            "6g-215-7025-80",
            "6g-217-7035-20",
            "6g-219-7045-40",
            "6g-221-7055-20",
            "6g-225-7075-20",
            "6g-227-7085-40",
            "6g-229-7095-20",
            "6g-233-7115-20",
            "60g-1-58320-2160",
            "60g-2-60480-2160",
            "60g-3-62640-2160",
            "60g-4-64800-2160",
            "60g-5-66960-2160",
            "60g-6-69120-2160",
            "60g-9-59400-4320",
            "60g-10-61560-4320",
            "60g-11-63720-4320",
            "60g-12-65880-4320",
            "60g-13-68040-4320",
            "60g-17-60480-6480",
            "60g-18-62640-6480",
            "60g-19-64800-6480",
            "60g-20-66960-6480",
            "60g-25-61560-6480",
            "60g-26-63720-6480",
            "60g-27-65880-6480",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `2.4g-1-2412-22` - 1 (2412 MHz)\n* `2.4g-2-2417-22` - 2 (2417 MHz)\n* `2.4g-3-2422-22` - 3 (2422 MHz)\n* `2.4g-4-2427-22` - 4 (2427 MHz)\n* `2.4g-5-2432-22` - 5 (2432 MHz)\n* `2.4g-6-2437-22` - 6 (2437 MHz)\n* `2.4g-7-2442-22` - 7 (2442 MHz)\n* `2.4g-8-2447-22` - 8 (2447 MHz)\n* `2.4g-9-2452-22` - 9 (2452 MHz)\n* `2.4g-10-2457-22` - 10 (2457 MHz)\n* `2.4g-11-2462-22` - 11 (2462 MHz)\n* `2.4g-12-2467-22` - 12 (2467 MHz)\n* `2.4g-13-2472-22` - 13 (2472 MHz)\n* `5g-32-5160-20` - 32 (5160/20 MHz)\n* `5g-34-5170-40` - 34 (5170/40 MHz)\n* `5g-36-5180-20` - 36 (5180/20 MHz)\n* `5g-38-5190-40` - 38 (5190/40 MHz)\n* `5g-40-5200-20` - 40 (5200/20 MHz)\n* `5g-42-5210-80` - 42 (5210/80 MHz)\n* `5g-44-5220-20` - 44 (5220/20 MHz)\n* `5g-46-5230-40` - 46 (5230/40 MHz)\n* `5g-48-5240-20` - 48 (5240/20 MHz)\n* `5g-50-5250-160` - 50 (5250/160 MHz)\n* `5g-52-5260-20` - 52 (5260/20 MHz)\n* `5g-54-5270-40` - 54 (5270/40 MHz)\n* `5g-56-5280-20` - 56 (5280/20 MHz)\n* `5g-58-5290-80` - 58 (5290/80 MHz)\n* `5g-60-5300-20` - 60 (5300/20 MHz)\n* `5g-62-5310-40` - 62 (5310/40 MHz)\n* `5g-64-5320-20` - 64 (5320/20 MHz)\n* `5g-100-5500-20` - 100 (5500/20 MHz)\n* `5g-102-5510-40` - 102 (5510/40 MHz)\n* `5g-104-5520-20` - 104 (5520/20 MHz)\n* `5g-106-5530-80` - 106 (5530/80 MHz)\n* `5g-108-5540-20` - 108 (5540/20 MHz)\n* `5g-110-5550-40` - 110 (5550/40 MHz)\n* `5g-112-5560-20` - 112 (5560/20 MHz)\n* `5g-114-5570-160` - 114 (5570/160 MHz)\n* `5g-116-5580-20` - 116 (5580/20 MHz)\n* `5g-118-5590-40` - 118 (5590/40 MHz)\n* `5g-120-5600-20` - 120 (5600/20 MHz)\n* `5g-122-5610-80` - 122 (5610/80 MHz)\n* `5g-124-5620-20` - 124 (5620/20 MHz)\n* `5g-126-5630-40` - 126 (5630/40 MHz)\n* `5g-128-5640-20` - 128 (5640/20 MHz)\n* `5g-132-5660-20` - 132 (5660/20 MHz)\n* `5g-134-5670-40` - 134 (5670/40 MHz)\n* `5g-136-5680-20` - 136 (5680/20 MHz)\n* `5g-138-5690-80` - 138 (5690/80 MHz)\n* `5g-140-5700-20` - 140 (5700/20 MHz)\n* `5g-142-5710-40` - 142 (5710/40 MHz)\n* `5g-144-5720-20` - 144 (5720/20 MHz)\n* `5g-149-5745-20` - 149 (5745/20 MHz)\n* `5g-151-5755-40` - 151 (5755/40 MHz)\n* `5g-153-5765-20` - 153 (5765/20 MHz)\n* `5g-155-5775-80` - 155 (5775/80 MHz)\n* `5g-157-5785-20` - 157 (5785/20 MHz)\n* `5g-159-5795-40` - 159 (5795/40 MHz)\n* `5g-161-5805-20` - 161 (5805/20 MHz)\n* `5g-163-5815-160` - 163 (5815/160 MHz)\n* `5g-165-5825-20` - 165 (5825/20 MHz)\n* `5g-167-5835-40` - 167 (5835/40 MHz)\n* `5g-169-5845-20` - 169 (5845/20 MHz)\n* `5g-171-5855-80` - 171 (5855/80 MHz)\n* `5g-173-5865-20` - 173 (5865/20 MHz)\n* `5g-175-5875-40` - 175 (5875/40 MHz)\n* `5g-177-5885-20` - 177 (5885/20 MHz)\n* `6g-1-5955-20` - 1 (5955/20 MHz)\n* `6g-3-5965-40` - 3 (5965/40 MHz)\n* `6g-5-5975-20` - 5 (5975/20 MHz)\n* `6g-7-5985-80` - 7 (5985/80 MHz)\n* `6g-9-5995-20` - 9 (5995/20 MHz)\n* `6g-11-6005-40` - 11 (6005/40 MHz)\n* `6g-13-6015-20` - 13 (6015/20 MHz)\n* `6g-15-6025-160` - 15 (6025/160 MHz)\n* `6g-17-6035-20` - 17 (6035/20 MHz)\n* `6g-19-6045-40` - 19 (6045/40 MHz)\n* `6g-21-6055-20` - 21 (6055/20 MHz)\n* `6g-23-6065-80` - 23 (6065/80 MHz)\n* `6g-25-6075-20` - 25 (6075/20 MHz)\n* `6g-27-6085-40` - 27 (6085/40 MHz)\n* `6g-29-6095-20` - 29 (6095/20 MHz)\n* `6g-31-6105-320` - 31 (6105/320 MHz)\n* `6g-33-6115-20` - 33 (6115/20 MHz)\n* `6g-35-6125-40` - 35 (6125/40 MHz)\n* `6g-37-6135-20` - 37 (6135/20 MHz)\n* `6g-39-6145-80` - 39 (6145/80 MHz)\n* `6g-41-6155-20` - 41 (6155/20 MHz)\n* `6g-43-6165-40` - 43 (6165/40 MHz)\n* `6g-45-6175-20` - 45 (6175/20 MHz)\n* `6g-47-6185-160` - 47 (6185/160 MHz)\n* `6g-49-6195-20` - 49 (6195/20 MHz)\n* `6g-51-6205-40` - 51 (6205/40 MHz)\n* `6g-53-6215-20` - 53 (6215/20 MHz)\n* `6g-55-6225-80` - 55 (6225/80 MHz)\n* `6g-57-6235-20` - 57 (6235/20 MHz)\n* `6g-59-6245-40` - 59 (6245/40 MHz)\n* `6g-61-6255-20` - 61 (6255/20 MHz)\n* `6g-65-6275-20` - 65 (6275/20 MHz)\n* `6g-67-6285-40` - 67 (6285/40 MHz)\n* `6g-69-6295-20` - 69 (6295/20 MHz)\n* `6g-71-6305-80` - 71 (6305/80 MHz)\n* `6g-73-6315-20` - 73 (6315/20 MHz)\n* `6g-75-6325-40` - 75 (6325/40 MHz)\n* `6g-77-6335-20` - 77 (6335/20 MHz)\n* `6g-79-6345-160` - 79 (6345/160 MHz)\n* `6g-81-6355-20` - 81 (6355/20 MHz)\n* `6g-83-6365-40` - 83 (6365/40 MHz)\n* `6g-85-6375-20` - 85 (6375/20 MHz)\n* `6g-87-6385-80` - 87 (6385/80 MHz)\n* `6g-89-6395-20` - 89 (6395/20 MHz)\n* `6g-91-6405-40` - 91 (6405/40 MHz)\n* `6g-93-6415-20` - 93 (6415/20 MHz)\n* `6g-95-6425-320` - 95 (6425/320 MHz)\n* `6g-97-6435-20` - 97 (6435/20 MHz)\n* `6g-99-6445-40` - 99 (6445/40 MHz)\n* `6g-101-6455-20` - 101 (6455/20 MHz)\n* `6g-103-6465-80` - 103 (6465/80 MHz)\n* `6g-105-6475-20` - 105 (6475/20 MHz)\n* `6g-107-6485-40` - 107 (6485/40 MHz)\n* `6g-109-6495-20` - 109 (6495/20 MHz)\n* `6g-111-6505-160` - 111 (6505/160 MHz)\n* `6g-113-6515-20` - 113 (6515/20 MHz)\n* `6g-115-6525-40` - 115 (6525/40 MHz)\n* `6g-117-6535-20` - 117 (6535/20 MHz)\n* `6g-119-6545-80` - 119 (6545/80 MHz)\n* `6g-121-6555-20` - 121 (6555/20 MHz)\n* `6g-123-6565-40` - 123 (6565/40 MHz)\n* `6g-125-6575-20` - 125 (6575/20 MHz)\n* `6g-129-6595-20` - 129 (6595/20 MHz)\n* `6g-131-6605-40` - 131 (6605/40 MHz)\n* `6g-133-6615-20` - 133 (6615/20 MHz)\n* `6g-135-6625-80` - 135 (6625/80 MHz)\n* `6g-137-6635-20` - 137 (6635/20 MHz)\n* `6g-139-6645-40` - 139 (6645/40 MHz)\n* `6g-141-6655-20` - 141 (6655/20 MHz)\n* `6g-143-6665-160` - 143 (6665/160 MHz)\n* `6g-145-6675-20` - 145 (6675/20 MHz)\n* `6g-147-6685-40` - 147 (6685/40 MHz)\n* `6g-149-6695-20` - 149 (6695/20 MHz)\n* `6g-151-6705-80` - 151 (6705/80 MHz)\n* `6g-153-6715-20` - 153 (6715/20 MHz)\n* `6g-155-6725-40` - 155 (6725/40 MHz)\n* `6g-157-6735-20` - 157 (6735/20 MHz)\n* `6g-159-6745-320` - 159 (6745/320 MHz)\n* `6g-161-6755-20` - 161 (6755/20 MHz)\n* `6g-163-6765-40` - 163 (6765/40 MHz)\n* `6g-165-6775-20` - 165 (6775/20 MHz)\n* `6g-167-6785-80` - 167 (6785/80 MHz)\n* `6g-169-6795-20` - 169 (6795/20 MHz)\n* `6g-171-6805-40` - 171 (6805/40 MHz)\n* `6g-173-6815-20` - 173 (6815/20 MHz)\n* `6g-175-6825-160` - 175 (6825/160 MHz)\n* `6g-177-6835-20` - 177 (6835/20 MHz)\n* `6g-179-6845-40` - 179 (6845/40 MHz)\n* `6g-181-6855-20` - 181 (6855/20 MHz)\n* `6g-183-6865-80` - 183 (6865/80 MHz)\n* `6g-185-6875-20` - 185 (6875/20 MHz)\n* `6g-187-6885-40` - 187 (6885/40 MHz)\n* `6g-189-6895-20` - 189 (6895/20 MHz)\n* `6g-193-6915-20` - 193 (6915/20 MHz)\n* `6g-195-6925-40` - 195 (6925/40 MHz)\n* `6g-197-6935-20` - 197 (6935/20 MHz)\n* `6g-199-6945-80` - 199 (6945/80 MHz)\n* `6g-201-6955-20` - 201 (6955/20 MHz)\n* `6g-203-6965-40` - 203 (6965/40 MHz)\n* `6g-205-6975-20` - 205 (6975/20 MHz)\n* `6g-207-6985-160` - 207 (6985/160 MHz)\n* `6g-209-6995-20` - 209 (6995/20 MHz)\n* `6g-211-7005-40` - 211 (7005/40 MHz)\n* `6g-213-7015-20` - 213 (7015/20 MHz)\n* `6g-215-7025-80` - 215 (7025/80 MHz)\n* `6g-217-7035-20` - 217 (7035/20 MHz)\n* `6g-219-7045-40` - 219 (7045/40 MHz)\n* `6g-221-7055-20` - 221 (7055/20 MHz)\n* `6g-225-7075-20` - 225 (7075/20 MHz)\n* `6g-227-7085-40` - 227 (7085/40 MHz)\n* `6g-229-7095-20` - 229 (7095/20 MHz)\n* `6g-233-7115-20` - 233 (7115/20 MHz)\n* `60g-1-58320-2160` - 1 (58.32/2.16 GHz)\n* `60g-2-60480-2160` - 2 (60.48/2.16 GHz)\n* `60g-3-62640-2160` - 3 (62.64/2.16 GHz)\n* `60g-4-64800-2160` - 4 (64.80/2.16 GHz)\n* `60g-5-66960-2160` - 5 (66.96/2.16 GHz)\n* `60g-6-69120-2160` - 6 (69.12/2.16 GHz)\n* `60g-9-59400-4320` - 9 (59.40/4.32 GHz)\n* `60g-10-61560-4320` - 10 (61.56/4.32 GHz)\n* `60g-11-63720-4320` - 11 (63.72/4.32 GHz)\n* `60g-12-65880-4320` - 12 (65.88/4.32 GHz)\n* `60g-13-68040-4320` - 13 (68.04/4.32 GHz)\n* `60g-17-60480-6480` - 17 (60.48/6.48 GHz)\n* `60g-18-62640-6480` - 18 (62.64/6.48 GHz)\n* `60g-19-64800-6480` - 19 (64.80/6.48 GHz)\n* `60g-20-66960-6480` - 20 (66.96/6.48 GHz)\n* `60g-25-61560-6480` - 25 (61.56/8.64 GHz)\n* `60g-26-63720-6480` - 26 (63.72/8.64 GHz)\n* `60g-27-65880-6480` - 27 (65.88/8.64 GHz)",
    )
    poe_mode: Literal["pd", "pse", ""] | None = Field(
        None, description="* `pd` - PD\n* `pse` - PSE"
    )
    poe_type: (
        Literal[
            "type1-ieee802.3af",
            "type2-ieee802.3at",
            "type3-ieee802.3bt",
            "type4-ieee802.3bt",
            "passive-24v-2pair",
            "passive-24v-4pair",
            "passive-48v-2pair",
            "passive-48v-4pair",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `type1-ieee802.3af` - 802.3af (Type 1)\n* `type2-ieee802.3at` - 802.3at (Type 2)\n* `type3-ieee802.3bt` - 802.3bt (Type 3)\n* `type4-ieee802.3bt` - 802.3bt (Type 4)\n* `passive-24v-2pair` - Passive 24V (2-pair)\n* `passive-24v-4pair` - Passive 24V (4-pair)\n* `passive-48v-2pair` - Passive 48V (2-pair)\n* `passive-48v-4pair` - Passive 48V (4-pair)",
    )
    rf_channel_frequency: ChannelFrequencyMHz | None = Field(
        None,
        description="Populated by selected channel (if set)",
        title="Channel frequency (MHz)",
    )
    rf_channel_width: ChannelWidthMHz | None = Field(
        None,
        description="Populated by selected channel (if set)",
        title="Channel width (MHz)",
    )
    tx_power: TransmitPowerDBm | None = Field(None, title="Transmit power (dBm)")
    untagged_vlan: int | BriefVLANRequest | None = None
    tagged_vlans: list[int] | None = None
    qinq_svlan: int | BriefVLANRequest | None = None
    vlan_translation_policy: int | BriefVLANTranslationPolicyRequest | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    wireless_lans: list[int] | None = None
    vrf: int | BriefVRFRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class InterfaceTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device_type: BriefDeviceType | None = None
    module_type: BriefModuleType | None = None
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type9
    enabled: bool | None = None
    mgmt_only: ManagementOnly2 | None = Field(None, title="Management only")
    description: constr(max_length=200) | None = None
    bridge: NestedInterfaceTemplate | None = None
    poe_mode: PoeMode | None = None
    poe_type: PoeType | None = None
    rf_role: RfRole | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class InterfaceTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Literal[
        "virtual",
        "bridge",
        "lag",
        "100base-fx",
        "100base-lfx",
        "100base-tx",
        "100base-t1",
        "1000base-t",
        "1000base-lx",
        "1000base-tx",
        "2.5gbase-t",
        "5gbase-t",
        "10gbase-t",
        "10gbase-cx4",
        "100base-x-sfp",
        "1000base-x-gbic",
        "1000base-x-sfp",
        "10gbase-x-sfpp",
        "10gbase-x-xfp",
        "10gbase-x-xenpak",
        "10gbase-x-x2",
        "25gbase-x-sfp28",
        "50gbase-x-sfp56",
        "40gbase-x-qsfpp",
        "50gbase-x-sfp28",
        "100gbase-x-cfp",
        "100gbase-x-cfp2",
        "200gbase-x-cfp2",
        "400gbase-x-cfp2",
        "100gbase-x-cfp4",
        "100gbase-x-cxp",
        "100gbase-x-cpak",
        "100gbase-x-dsfp",
        "100gbase-x-sfpdd",
        "100gbase-x-qsfp28",
        "100gbase-x-qsfpdd",
        "200gbase-x-qsfp56",
        "200gbase-x-qsfpdd",
        "400gbase-x-qsfp112",
        "400gbase-x-qsfpdd",
        "400gbase-x-osfp",
        "400gbase-x-osfp-rhs",
        "400gbase-x-cdfp",
        "400gbase-x-cfp8",
        "800gbase-x-qsfpdd",
        "800gbase-x-osfp",
        "1000base-kx",
        "2.5gbase-kx",
        "5gbase-kr",
        "10gbase-kr",
        "10gbase-kx4",
        "25gbase-kr",
        "40gbase-kr4",
        "50gbase-kr",
        "100gbase-kp4",
        "100gbase-kr2",
        "100gbase-kr4",
        "ieee802.11a",
        "ieee802.11g",
        "ieee802.11n",
        "ieee802.11ac",
        "ieee802.11ad",
        "ieee802.11ax",
        "ieee802.11ay",
        "ieee802.11be",
        "ieee802.15.1",
        "ieee802.15.4",
        "other-wireless",
        "gsm",
        "cdma",
        "lte",
        "4g",
        "5g",
        "sonet-oc3",
        "sonet-oc12",
        "sonet-oc48",
        "sonet-oc192",
        "sonet-oc768",
        "sonet-oc1920",
        "sonet-oc3840",
        "1gfc-sfp",
        "2gfc-sfp",
        "4gfc-sfp",
        "8gfc-sfpp",
        "16gfc-sfpp",
        "32gfc-sfp28",
        "32gfc-sfpp",
        "64gfc-qsfpp",
        "64gfc-sfpdd",
        "64gfc-sfpp",
        "128gfc-qsfp28",
        "infiniband-sdr",
        "infiniband-ddr",
        "infiniband-qdr",
        "infiniband-fdr10",
        "infiniband-fdr",
        "infiniband-edr",
        "infiniband-hdr",
        "infiniband-ndr",
        "infiniband-xdr",
        "t1",
        "e1",
        "t3",
        "e3",
        "xdsl",
        "docsis",
        "moca",
        "bpon",
        "epon",
        "10g-epon",
        "gpon",
        "xg-pon",
        "xgs-pon",
        "ng-pon2",
        "25g-pon",
        "50g-pon",
        "cisco-stackwise",
        "cisco-stackwise-plus",
        "cisco-flexstack",
        "cisco-flexstack-plus",
        "cisco-stackwise-80",
        "cisco-stackwise-160",
        "cisco-stackwise-320",
        "cisco-stackwise-480",
        "cisco-stackwise-1t",
        "juniper-vcp",
        "extreme-summitstack",
        "extreme-summitstack-128",
        "extreme-summitstack-256",
        "extreme-summitstack-512",
        "other",
    ] = Field(
        ...,
        description="* `virtual` - Virtual\n* `bridge` - Bridge\n* `lag` - Link Aggregation Group (LAG)\n* `100base-fx` - 100BASE-FX (10/100ME FIBER)\n* `100base-lfx` - 100BASE-LFX (10/100ME FIBER)\n* `100base-tx` - 100BASE-TX (10/100ME)\n* `100base-t1` - 100BASE-T1 (10/100ME Single Pair)\n* `1000base-t` - 1000BASE-T (1GE)\n* `1000base-lx` - 1000BASE-LX (1GE)\n* `1000base-tx` - 1000BASE-TX (1GE)\n* `2.5gbase-t` - 2.5GBASE-T (2.5GE)\n* `5gbase-t` - 5GBASE-T (5GE)\n* `10gbase-t` - 10GBASE-T (10GE)\n* `10gbase-cx4` - 10GBASE-CX4 (10GE)\n* `100base-x-sfp` - SFP (100ME)\n* `1000base-x-gbic` - GBIC (1GE)\n* `1000base-x-sfp` - SFP (1GE)\n* `10gbase-x-sfpp` - SFP+ (10GE)\n* `10gbase-x-xfp` - XFP (10GE)\n* `10gbase-x-xenpak` - XENPAK (10GE)\n* `10gbase-x-x2` - X2 (10GE)\n* `25gbase-x-sfp28` - SFP28 (25GE)\n* `50gbase-x-sfp56` - SFP56 (50GE)\n* `40gbase-x-qsfpp` - QSFP+ (40GE)\n* `50gbase-x-sfp28` - QSFP28 (50GE)\n* `100gbase-x-cfp` - CFP (100GE)\n* `100gbase-x-cfp2` - CFP2 (100GE)\n* `200gbase-x-cfp2` - CFP2 (200GE)\n* `400gbase-x-cfp2` - CFP2 (400GE)\n* `100gbase-x-cfp4` - CFP4 (100GE)\n* `100gbase-x-cxp` - CXP (100GE)\n* `100gbase-x-cpak` - Cisco CPAK (100GE)\n* `100gbase-x-dsfp` - DSFP (100GE)\n* `100gbase-x-sfpdd` - SFP-DD (100GE)\n* `100gbase-x-qsfp28` - QSFP28 (100GE)\n* `100gbase-x-qsfpdd` - QSFP-DD (100GE)\n* `200gbase-x-qsfp56` - QSFP56 (200GE)\n* `200gbase-x-qsfpdd` - QSFP-DD (200GE)\n* `400gbase-x-qsfp112` - QSFP112 (400GE)\n* `400gbase-x-qsfpdd` - QSFP-DD (400GE)\n* `400gbase-x-osfp` - OSFP (400GE)\n* `400gbase-x-osfp-rhs` - OSFP-RHS (400GE)\n* `400gbase-x-cdfp` - CDFP (400GE)\n* `400gbase-x-cfp8` - CPF8 (400GE)\n* `800gbase-x-qsfpdd` - QSFP-DD (800GE)\n* `800gbase-x-osfp` - OSFP (800GE)\n* `1000base-kx` - 1000BASE-KX (1GE)\n* `2.5gbase-kx` - 2.5GBASE-KX (2.5GE)\n* `5gbase-kr` - 5GBASE-KR (5GE)\n* `10gbase-kr` - 10GBASE-KR (10GE)\n* `10gbase-kx4` - 10GBASE-KX4 (10GE)\n* `25gbase-kr` - 25GBASE-KR (25GE)\n* `40gbase-kr4` - 40GBASE-KR4 (40GE)\n* `50gbase-kr` - 50GBASE-KR (50GE)\n* `100gbase-kp4` - 100GBASE-KP4 (100GE)\n* `100gbase-kr2` - 100GBASE-KR2 (100GE)\n* `100gbase-kr4` - 100GBASE-KR4 (100GE)\n* `ieee802.11a` - IEEE 802.11a\n* `ieee802.11g` - IEEE 802.11b/g\n* `ieee802.11n` - IEEE 802.11n\n* `ieee802.11ac` - IEEE 802.11ac\n* `ieee802.11ad` - IEEE 802.11ad\n* `ieee802.11ax` - IEEE 802.11ax\n* `ieee802.11ay` - IEEE 802.11ay\n* `ieee802.11be` - IEEE 802.11be\n* `ieee802.15.1` - IEEE 802.15.1 (Bluetooth)\n* `ieee802.15.4` - IEEE 802.15.4 (LR-WPAN)\n* `other-wireless` - Other (Wireless)\n* `gsm` - GSM\n* `cdma` - CDMA\n* `lte` - LTE\n* `4g` - 4G\n* `5g` - 5G\n* `sonet-oc3` - OC-3/STM-1\n* `sonet-oc12` - OC-12/STM-4\n* `sonet-oc48` - OC-48/STM-16\n* `sonet-oc192` - OC-192/STM-64\n* `sonet-oc768` - OC-768/STM-256\n* `sonet-oc1920` - OC-1920/STM-640\n* `sonet-oc3840` - OC-3840/STM-1234\n* `1gfc-sfp` - SFP (1GFC)\n* `2gfc-sfp` - SFP (2GFC)\n* `4gfc-sfp` - SFP (4GFC)\n* `8gfc-sfpp` - SFP+ (8GFC)\n* `16gfc-sfpp` - SFP+ (16GFC)\n* `32gfc-sfp28` - SFP28 (32GFC)\n* `32gfc-sfpp` - SFP+ (32GFC)\n* `64gfc-qsfpp` - QSFP+ (64GFC)\n* `64gfc-sfpdd` - SFP-DD (64GFC)\n* `64gfc-sfpp` - SFP+ (64GFC)\n* `128gfc-qsfp28` - QSFP28 (128GFC)\n* `infiniband-sdr` - SDR (2 Gbps)\n* `infiniband-ddr` - DDR (4 Gbps)\n* `infiniband-qdr` - QDR (8 Gbps)\n* `infiniband-fdr10` - FDR10 (10 Gbps)\n* `infiniband-fdr` - FDR (13.5 Gbps)\n* `infiniband-edr` - EDR (25 Gbps)\n* `infiniband-hdr` - HDR (50 Gbps)\n* `infiniband-ndr` - NDR (100 Gbps)\n* `infiniband-xdr` - XDR (250 Gbps)\n* `t1` - T1 (1.544 Mbps)\n* `e1` - E1 (2.048 Mbps)\n* `t3` - T3 (45 Mbps)\n* `e3` - E3 (34 Mbps)\n* `xdsl` - xDSL\n* `docsis` - DOCSIS\n* `moca` - MoCA\n* `bpon` - BPON (622 Mbps / 155 Mbps)\n* `epon` - EPON (1 Gbps)\n* `10g-epon` - 10G-EPON (10 Gbps)\n* `gpon` - GPON (2.5 Gbps / 1.25 Gbps)\n* `xg-pon` - XG-PON (10 Gbps / 2.5 Gbps)\n* `xgs-pon` - XGS-PON (10 Gbps)\n* `ng-pon2` - NG-PON2 (TWDM-PON) (4x10 Gbps)\n* `25g-pon` - 25G-PON (25 Gbps)\n* `50g-pon` - 50G-PON (50 Gbps)\n* `cisco-stackwise` - Cisco StackWise\n* `cisco-stackwise-plus` - Cisco StackWise Plus\n* `cisco-flexstack` - Cisco FlexStack\n* `cisco-flexstack-plus` - Cisco FlexStack Plus\n* `cisco-stackwise-80` - Cisco StackWise-80\n* `cisco-stackwise-160` - Cisco StackWise-160\n* `cisco-stackwise-320` - Cisco StackWise-320\n* `cisco-stackwise-480` - Cisco StackWise-480\n* `cisco-stackwise-1t` - Cisco StackWise-1T\n* `juniper-vcp` - Juniper VCP\n* `extreme-summitstack` - Extreme SummitStack\n* `extreme-summitstack-128` - Extreme SummitStack-128\n* `extreme-summitstack-256` - Extreme SummitStack-256\n* `extreme-summitstack-512` - Extreme SummitStack-512\n* `other` - Other",
    )
    enabled: bool | None = None
    mgmt_only: ManagementOnly2 | None = Field(None, title="Management only")
    description: constr(max_length=200) | None = None
    bridge: NestedInterfaceTemplateRequest | None = None
    poe_mode: Literal["pd", "pse", ""] | None = Field(
        None, description="* `pd` - PD\n* `pse` - PSE"
    )
    poe_type: (
        Literal[
            "type1-ieee802.3af",
            "type2-ieee802.3at",
            "type3-ieee802.3bt",
            "type4-ieee802.3bt",
            "passive-24v-2pair",
            "passive-24v-4pair",
            "passive-48v-2pair",
            "passive-48v-4pair",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `type1-ieee802.3af` - 802.3af (Type 1)\n* `type2-ieee802.3at` - 802.3at (Type 2)\n* `type3-ieee802.3bt` - 802.3bt (Type 3)\n* `type4-ieee802.3bt` - 802.3bt (Type 4)\n* `passive-24v-2pair` - Passive 24V (2-pair)\n* `passive-24v-4pair` - Passive 24V (4-pair)\n* `passive-48v-2pair` - Passive 48V (2-pair)\n* `passive-48v-4pair` - Passive 48V (4-pair)",
    )
    rf_role: Literal["ap", "station", ""] | None = Field(
        None, description="* `ap` - Access point\n* `station` - Station"
    )


class InventoryItem(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: BriefDevice
    parent: int | None = None
    name: constr(max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    status: Status9 | None = None
    role: BriefInventoryItemRole | None = None
    manufacturer: BriefManufacturer | None = None
    part_id: constr(max_length=50) | None = Field(
        None, description="Manufacturer-assigned part identifier"
    )
    serial: SerialNumber3 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this item"
    )
    discovered: bool | None = Field(None, description="This item was automatically discovered")
    description: constr(max_length=200) | None = None
    component_type: str | None = None
    component_id: conint(ge=0, le=9223372036854775807) | None = None
    component: Any | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class InventoryItemRequest(BaseModel):
    device: int | BriefDeviceRequest
    parent: int | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    status: (
        Literal["offline", "active", "planned", "staged", "failed", "decommissioning"] | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning",
    )
    role: int | BriefInventoryItemRoleRequest | None = None
    manufacturer: int | BriefManufacturerRequest | None = None
    part_id: constr(max_length=50) | None = Field(
        None, description="Manufacturer-assigned part identifier"
    )
    serial: SerialNumber3 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this item"
    )
    discovered: bool | None = Field(None, description="This item was automatically discovered")
    description: constr(max_length=200) | None = None
    component_type: str | None = None
    component_id: conint(ge=0, le=9223372036854775807) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class InventoryItemRole(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    inventoryitem_count: int | None = None


class InventoryItemRoleRequest(RackRoleRequest):
    pass


class InventoryItemTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device_type: BriefDeviceType
    parent: int | None = None
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    role: BriefInventoryItemRole | None = None
    manufacturer: BriefManufacturer | None = None
    part_id: constr(max_length=50) | None = Field(
        None, description="Manufacturer-assigned part identifier"
    )
    description: constr(max_length=200) | None = None
    component_type: str | None = None
    component_id: conint(ge=0, le=9223372036854775807) | None = None
    component: Any | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class InventoryItemTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest
    parent: int | None = None
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    role: int | BriefInventoryItemRoleRequest | None = None
    manufacturer: int | BriefManufacturerRequest | None = None
    part_id: constr(max_length=50) | None = Field(
        None, description="Manufacturer-assigned part identifier"
    )
    description: constr(max_length=200) | None = None
    component_type: str | None = None
    component_id: conint(ge=0, le=9223372036854775807) | None = None


class JournalEntry(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    assigned_object_type: str
    assigned_object_id: conint(ge=0, le=9223372036854775807)
    assigned_object: Any | None = None
    created: AwareDatetime | None = None
    created_by: int | None = None
    kind: Kind | None = None
    comments: str
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    last_updated: AwareDatetime | None = None


class JournalEntryRequest(WritableJournalEntryRequest):
    pass


class L2VPN(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    identifier: conint(ge=-9223372036854775808, le=9223372036854775807) | None = None
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    type: Type11 | None = None
    status: Status11 | None = None
    import_targets: list[RouteTarget] | None = None
    export_targets: list[RouteTarget] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tenant: BriefTenant | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class L2VPNRequest(BaseModel):
    identifier: conint(ge=-9223372036854775808, le=9223372036854775807) | None = None
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    type: (
        Literal[
            "vpws",
            "vpls",
            "vxlan",
            "vxlan-evpn",
            "mpls-evpn",
            "pbb-evpn",
            "evpn-vpws",
            "epl",
            "evpl",
            "ep-lan",
            "evp-lan",
            "ep-tree",
            "evp-tree",
            "spb",
        ]
        | None
    ) = Field(
        None,
        description="* `vpws` - VPWS\n* `vpls` - VPLS\n* `vxlan` - VXLAN\n* `vxlan-evpn` - VXLAN-EVPN\n* `mpls-evpn` - MPLS EVPN\n* `pbb-evpn` - PBB EVPN\n* `evpn-vpws` - EVPN VPWS\n* `epl` - EPL\n* `evpl` - EVPL\n* `ep-lan` - Ethernet Private LAN\n* `evp-lan` - Ethernet Virtual Private LAN\n* `ep-tree` - Ethernet Private Tree\n* `evp-tree` - Ethernet Virtual Private Tree\n* `spb` - SPB",
    )
    status: Literal["active", "planned", "decommissioning"] | None = Field(
        None,
        description="* `active` - Active\n* `planned` - Planned\n* `decommissioning` - Decommissioning",
    )
    import_targets: list[int] | None = None
    export_targets: list[int] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tenant: int | BriefTenantRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class L2VPNTermination(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    l2vpn: BriefL2VPN
    assigned_object_type: str
    assigned_object_id: conint(ge=0, le=9223372036854775807)
    assigned_object: Any | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class L2VPNTerminationRequest(BaseModel):
    l2vpn: int | BriefL2VPNRequest
    assigned_object_type: str
    assigned_object_id: conint(ge=0, le=9223372036854775807)
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Location(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    site: BriefSite
    parent: NestedLocation | None = None
    status: Status12 | None = None
    tenant: BriefTenant | None = None
    facility: constr(max_length=50) | None = Field(
        None, description="Local facility ID or description"
    )
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    rack_count: int | None = 0
    device_count: int | None = 0
    prefix_count: int | None = None
    comments: str | None = None
    field_depth: FieldDepth = Field(..., alias="_depth", title=" depth")


class LocationRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", min_length=1, max_length=100)
    site: int | BriefSiteRequest
    parent: NestedLocationRequest | None = None
    status: Literal["planned", "staging", "active", "decommissioning", "retired"] | None = Field(
        None,
        description="* `planned` - Planned\n* `staging` - Staging\n* `active` - Active\n* `decommissioning` - Decommissioning\n* `retired` - Retired",
    )
    tenant: int | BriefTenantRequest | None = None
    facility: constr(max_length=50) | None = Field(
        None, description="Local facility ID or description"
    )
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    comments: str | None = None


class MACAddress(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    mac_address: str
    assigned_object_type: str | None = None
    assigned_object_id: conint(ge=0, le=9223372036854775807) | None = None
    assigned_object: Any | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class MACAddressRequest(BaseModel):
    mac_address: str
    assigned_object_type: str | None = None
    assigned_object_id: conint(ge=0, le=9223372036854775807) | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class Manufacturer(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    devicetype_count: int | None = None
    inventoryitem_count: int | None = None
    platform_count: int | None = None


class ManufacturerRequest(TunnelGroupRequest):
    pass


class Module(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: BriefDevice
    module_bay: NestedModuleBay
    module_type: BriefModuleType
    status: Status13 | None = None
    serial: SerialNumber3 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this device"
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ModuleBay(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: BriefDevice
    module: BriefModule | None = None
    name: constr(max_length=64)
    installed_module: BriefModule | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    position: constr(max_length=30) | None = Field(
        None, description="Identifier to reference when renaming installed components"
    )
    description: constr(max_length=200) | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ModuleBayRequest(BaseModel):
    device: int | BriefDeviceRequest
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    installed_module: int | BriefModuleRequest | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    position: constr(max_length=30) | None = Field(
        None, description="Identifier to reference when renaming installed components"
    )
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ModuleBayTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device_type: BriefDeviceType | None = None
    module_type: BriefModuleType | None = None
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    position: constr(max_length=30) | None = Field(
        None, description="Identifier to reference when renaming installed components"
    )
    description: constr(max_length=200) | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ModuleBayTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    position: constr(max_length=30) | None = Field(
        None, description="Identifier to reference when renaming installed components"
    )
    description: constr(max_length=200) | None = None


class ModuleRequest(BaseModel):
    device: int | BriefDeviceRequest
    module_bay: NestedModuleBayRequest
    module_type: int | BriefModuleTypeRequest
    status: (
        Literal["offline", "active", "planned", "staged", "failed", "decommissioning"] | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `decommissioning` - Decommissioning",
    )
    serial: SerialNumber3 | None = Field(None, title="Serial number")
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this device"
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ModuleType(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    profile: BriefModuleTypeProfile | None = None
    manufacturer: BriefManufacturer
    model: constr(max_length=100)
    part_number: constr(max_length=50) | None = Field(
        None, description="Discrete part number (optional)"
    )
    airflow: Airflow3 | None = None
    weight: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    weight_unit: WeightUnit | None = None
    description: constr(max_length=200) | None = None
    attributes: Any | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ModuleTypeProfile(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    schema_: Any | None = Field(None, alias="schema")
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class ModuleTypeProfileRequest(BaseModel):
    name: constr(min_length=1, max_length=100)
    description: constr(max_length=200) | None = None
    schema_: Any | None = Field(None, alias="schema")
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class ModuleTypeRequest(WritableModuleTypeRequest):
    pass


class NestedVMInterface(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    virtual_machine: NestedVirtualMachine
    name: constr(max_length=64)


class PaginatedASNList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ASN]


class PaginatedASNRangeList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ASNRange]


class PaginatedAggregateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Aggregate]


class PaginatedBookmarkList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Bookmark]


class PaginatedCableList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Cable]


class PaginatedCircuitGroupAssignmentList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[CircuitGroupAssignment]


class PaginatedCircuitGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[CircuitGroup]


class PaginatedCircuitList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Circuit]


class PaginatedCircuitTerminationList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[CircuitTermination]


class PaginatedCircuitTypeList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[CircuitType]


class PaginatedClusterGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ClusterGroup]


class PaginatedClusterList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Cluster]


class PaginatedClusterTypeList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ClusterType]


class PaginatedConfigTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ConfigTemplate]


class PaginatedConsolePortList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ConsolePort]


class PaginatedConsolePortTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ConsolePortTemplate]


class PaginatedConsoleServerPortList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ConsoleServerPort]


class PaginatedConsoleServerPortTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ConsoleServerPortTemplate]


class PaginatedContactAssignmentList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ContactAssignment]


class PaginatedContactGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ContactGroup]


class PaginatedContactRoleList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ContactRole]


class PaginatedDeviceBayList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[DeviceBay]


class PaginatedDeviceBayTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[DeviceBayTemplate]


class PaginatedDeviceRoleList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[DeviceRole]


class PaginatedDeviceTypeList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[DeviceType]


class PaginatedDeviceWithConfigContextList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[DeviceWithConfigContext]


class PaginatedEventRuleList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[EventRule]


class PaginatedFHRPGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[FHRPGroup]


class PaginatedFrontPortList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[FrontPort]


class PaginatedFrontPortTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[FrontPortTemplate]


class PaginatedGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Group]


class PaginatedIKEProposalList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[IKEProposal]


class PaginatedIPAddressList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[IPAddress]


class PaginatedIPRangeList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[IPRange]


class PaginatedIPSecProfileList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[IPSecProfile]


class PaginatedIPSecProposalList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[IPSecProposal]


class PaginatedInterfaceList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Interface]


class PaginatedInterfaceTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[InterfaceTemplate]


class PaginatedInventoryItemList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[InventoryItem]


class PaginatedInventoryItemRoleList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[InventoryItemRole]


class PaginatedInventoryItemTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[InventoryItemTemplate]


class PaginatedJournalEntryList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[JournalEntry]


class PaginatedL2VPNList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[L2VPN]


class PaginatedL2VPNTerminationList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[L2VPNTermination]


class PaginatedLocationList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Location]


class PaginatedMACAddressList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[MACAddress]


class PaginatedManufacturerList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Manufacturer]


class PaginatedModuleBayList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ModuleBay]


class PaginatedModuleBayTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ModuleBayTemplate]


class PaginatedModuleList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Module]


class PaginatedModuleTypeList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ModuleType]


class PaginatedModuleTypeProfileList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ModuleTypeProfile]


class PaginatedPlatformList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Platform]


class PaginatedPowerFeedList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[PowerFeed]


class PaginatedPowerPanelList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[PowerPanel]


class PaginatedPrefixList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Prefix]


class PaginatedProviderAccountList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ProviderAccount]


class PaginatedProviderNetworkList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ProviderNetwork]


class PaginatedRIRList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[RIR]


class PaginatedRackList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Rack]


class PaginatedRackReservationList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[RackReservation]


class PaginatedRackRoleList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[RackRole]


class PaginatedRackTypeList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[RackType]


class PaginatedRackUnitList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[RackUnit]


class PaginatedRegionList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Region]


class PaginatedRoleList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[RoleModel]


class PaginatedRouteTargetList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[RouteTarget]


class PaginatedSavedFilterList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[SavedFilter]


class PaginatedServiceTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ServiceTemplate]


class PaginatedSiteGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[SiteGroup]


class PaginatedSubscriptionList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Subscription]


class PaginatedTableConfigList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[TableConfig]


class PaginatedTagList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Tag]


class PaginatedTaggedItemList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[TaggedItem]


class PaginatedTenantGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[TenantGroup]


class PaginatedTenantList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Tenant]


class PaginatedTokenList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Token]


class PaginatedTunnelGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[TunnelGroup]


class PaginatedTunnelList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Tunnel]


class PaginatedTunnelTerminationList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[TunnelTermination]


class PaginatedVLANGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VLANGroup]


class PaginatedVLANList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VLAN]


class PaginatedVLANTranslationRuleList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VLANTranslationRule]


class PaginatedVRFList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VRF]


class PaginatedVirtualChassisList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VirtualChassis]


class PaginatedVirtualCircuitList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VirtualCircuit]


class PaginatedVirtualCircuitTerminationList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VirtualCircuitTermination]


class PaginatedVirtualCircuitTypeList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VirtualCircuitType]


class PaginatedVirtualDeviceContextList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VirtualDeviceContext]


class PaginatedVirtualDiskList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VirtualDisk]


class PaginatedVirtualMachineWithConfigContextList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VirtualMachineWithConfigContext]


class PaginatedWebhookList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Webhook]


class PaginatedWirelessLANGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[WirelessLANGroup]


class PaginatedWirelessLANList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[WirelessLAN]


class PaginatedWirelessLinkList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[WirelessLink]


class PatchedCircuitTerminationRequest(BaseModel):
    circuit: int | BriefCircuitRequest | None = None
    term_side: TerminationSide | None = Field(
        None, description="* `A` - A\n* `Z` - Z", title="Termination side"
    )
    termination_type: str | None = None
    termination_id: int | None = None
    port_speed: PortSpeedKbps | None = Field(
        None, description="Physical circuit speed", title="Port speed (Kbps)"
    )
    upstream_speed: UpstreamSpeedKbps | None = Field(
        None,
        description="Upstream speed, if different from port speed",
        title="Upstream speed (Kbps)",
    )
    xconnect_id: CrossConnectID | None = Field(
        None, description="ID of the local cross-connect", title="Cross-connect ID"
    )
    pp_info: PatchPanelPortS | None = Field(
        None,
        description="Patch panel ID and port number(s)",
        title="Patch panel/port(s)",
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedDeviceBayTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    name: constr(min_length=1, max_length=64) | None = Field(
        None,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    description: constr(max_length=200) | None = None


class PatchedInventoryItemTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    parent: int | None = None
    name: constr(min_length=1, max_length=64) | None = Field(
        None,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    role: int | BriefInventoryItemRoleRequest | None = None
    manufacturer: int | BriefManufacturerRequest | None = None
    part_id: constr(max_length=50) | None = Field(
        None, description="Manufacturer-assigned part identifier"
    )
    description: constr(max_length=200) | None = None
    component_type: str | None = None
    component_id: conint(ge=0, le=9223372036854775807) | None = None


class PatchedModuleBayRequest(BaseModel):
    device: int | BriefDeviceRequest | None = None
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64) | None = None
    installed_module: int | BriefModuleRequest | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    position: constr(max_length=30) | None = Field(
        None, description="Identifier to reference when renaming installed components"
    )
    description: constr(max_length=200) | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedModuleBayTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) | None = Field(
        None,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    position: constr(max_length=30) | None = Field(
        None, description="Identifier to reference when renaming installed components"
    )
    description: constr(max_length=200) | None = None


class PatchedWritableCircuitRequest(BaseModel):
    cid: CircuitID5 | None = Field(None, description="Unique circuit ID", title="Circuit ID")
    provider: int | BriefProviderRequest | None = None
    provider_account: int | BriefProviderAccountRequest | None = None
    type: int | BriefCircuitTypeRequest | None = None
    status: (
        Literal[
            "planned",
            "provisioning",
            "active",
            "offline",
            "deprovisioning",
            "decommissioned",
        ]
        | None
    ) = Field(
        None,
        description="* `planned` - Planned\n* `provisioning` - Provisioning\n* `active` - Active\n* `offline` - Offline\n* `deprovisioning` - Deprovisioning\n* `decommissioned` - Decommissioned",
    )
    tenant: int | BriefTenantRequest | None = None
    install_date: Installed | None = Field(None, title="Installed")
    termination_date: Terminates | None = Field(None, title="Terminates")
    commit_rate: CommitRateKbps | None = Field(
        None, description="Committed rate", title="Commit rate (Kbps)"
    )
    description: constr(max_length=200) | None = None
    distance: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    distance_unit: Literal["km", "m", "mi", "ft", ""] | None = Field(
        None,
        description="* `km` - Kilometers\n* `m` - Meters\n* `mi` - Miles\n* `ft` - Feet",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    assignments: list[BriefCircuitGroupAssignmentSerializerRequest] | None = None


class PatchedWritableConsolePortRequest(BaseModel):
    device: int | BriefDeviceRequest | None = None
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64) | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "de-9",
            "db-25",
            "rj-11",
            "rj-12",
            "rj-45",
            "mini-din-8",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="Physical port type\n\n* `de-9` - DE-9\n* `db-25` - DB-25\n* `rj-11` - RJ-11\n* `rj-12` - RJ-12\n* `rj-45` - RJ-45\n* `mini-din-8` - Mini-DIN 8\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    speed: Literal[1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200] | None = Field(
        None,
        description="Port speed in bits per second\n\n* `1200` - 1200 bps\n* `2400` - 2400 bps\n* `4800` - 4800 bps\n* `9600` - 9600 bps\n* `19200` - 19.2 kbps\n* `38400` - 38.4 kbps\n* `57600` - 57.6 kbps\n* `115200` - 115.2 kbps",
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableConsolePortTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) | None = Field(
        None,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "de-9",
            "db-25",
            "rj-11",
            "rj-12",
            "rj-45",
            "mini-din-8",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `de-9` - DE-9\n* `db-25` - DB-25\n* `rj-11` - RJ-11\n* `rj-12` - RJ-12\n* `rj-45` - RJ-45\n* `mini-din-8` - Mini-DIN 8\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    description: constr(max_length=200) | None = None


class PatchedWritableConsoleServerPortRequest(PatchedWritableConsolePortRequest):
    pass


class PatchedWritableConsoleServerPortTemplateRequest(PatchedWritableConsolePortTemplateRequest):
    pass


class PatchedWritableDeviceWithConfigContextRequest(BaseModel):
    name: constr(max_length=64) | None = None
    device_type: int | BriefDeviceTypeRequest | None = None
    role: int | BriefDeviceRoleRequest | None = None
    tenant: int | BriefTenantRequest | None = None
    platform: int | BriefPlatformRequest | None = None
    serial: SerialNumber7 | None = Field(
        None,
        description="Chassis serial number, assigned by the manufacturer",
        title="Serial number",
    )
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this device"
    )
    site: int | BriefSiteRequest | None = None
    location: int | BriefLocationRequest | None = None
    rack: int | BriefRackRequest | None = None
    position: PositionU6 | None = Field(None, title="Position (U)")
    face: RackFace | None = Field(
        None, description="* `front` - Front\n* `rear` - Rear", title="Rack face"
    )
    latitude: confloat(lt=100.0, gt=-100.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    longitude: confloat(lt=1000.0, gt=-1000.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    status: (
        Literal[
            "offline",
            "active",
            "planned",
            "staged",
            "failed",
            "inventory",
            "decommissioning",
        ]
        | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `inventory` - Inventory\n* `decommissioning` - Decommissioning",
    )
    airflow: (
        Literal[
            "front-to-rear",
            "rear-to-front",
            "left-to-right",
            "right-to-left",
            "side-to-rear",
            "rear-to-side",
            "bottom-to-top",
            "top-to-bottom",
            "passive",
            "mixed",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front\n* `left-to-right` - Left to right\n* `right-to-left` - Right to left\n* `side-to-rear` - Side to rear\n* `rear-to-side` - Rear to side\n* `bottom-to-top` - Bottom to top\n* `top-to-bottom` - Top to bottom\n* `passive` - Passive\n* `mixed` - Mixed",
    )
    primary_ip4: int | BriefIPAddressRequest | None = None
    primary_ip6: int | BriefIPAddressRequest | None = None
    oob_ip: int | BriefIPAddressRequest | None = None
    cluster: int | BriefClusterRequest | None = None
    virtual_chassis: int | BriefVirtualChassisRequest | None = None
    vc_position: conint(ge=0, le=255) | None = None
    vc_priority: conint(ge=0, le=255) | None = Field(
        None, description="Virtual chassis master election priority"
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    config_template: int | BriefConfigTemplateRequest | None = None
    local_context_data: Any | None = Field(
        None,
        description="Local config context data takes precedence over source contexts in the final rendered config context",
    )
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableFrontPortRequest(BaseModel):
    device: int | BriefDeviceRequest | None = None
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64) | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "8p8c",
            "8p6c",
            "8p4c",
            "8p2c",
            "6p6c",
            "6p4c",
            "6p2c",
            "4p4c",
            "4p2c",
            "gg45",
            "tera-4p",
            "tera-2p",
            "tera-1p",
            "110-punch",
            "bnc",
            "f",
            "n",
            "mrj21",
            "fc",
            "fc-pc",
            "fc-upc",
            "fc-apc",
            "lc",
            "lc-pc",
            "lc-upc",
            "lc-apc",
            "lsh",
            "lsh-pc",
            "lsh-upc",
            "lsh-apc",
            "lx5",
            "lx5-pc",
            "lx5-upc",
            "lx5-apc",
            "mpo",
            "mtrj",
            "sc",
            "sc-pc",
            "sc-upc",
            "sc-apc",
            "st",
            "cs",
            "sn",
            "sma-905",
            "sma-906",
            "urm-p2",
            "urm-p4",
            "urm-p8",
            "splice",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
        ]
        | None
    ) = Field(
        None,
        description="* `8p8c` - 8P8C\n* `8p6c` - 8P6C\n* `8p4c` - 8P4C\n* `8p2c` - 8P2C\n* `6p6c` - 6P6C\n* `6p4c` - 6P4C\n* `6p2c` - 6P2C\n* `4p4c` - 4P4C\n* `4p2c` - 4P2C\n* `gg45` - GG45\n* `tera-4p` - TERA 4P\n* `tera-2p` - TERA 2P\n* `tera-1p` - TERA 1P\n* `110-punch` - 110 Punch\n* `bnc` - BNC\n* `f` - F Connector\n* `n` - N Connector\n* `mrj21` - MRJ21\n* `fc` - FC\n* `fc-pc` - FC/PC\n* `fc-upc` - FC/UPC\n* `fc-apc` - FC/APC\n* `lc` - LC\n* `lc-pc` - LC/PC\n* `lc-upc` - LC/UPC\n* `lc-apc` - LC/APC\n* `lsh` - LSH\n* `lsh-pc` - LSH/PC\n* `lsh-upc` - LSH/UPC\n* `lsh-apc` - LSH/APC\n* `lx5` - LX.5\n* `lx5-pc` - LX.5/PC\n* `lx5-upc` - LX.5/UPC\n* `lx5-apc` - LX.5/APC\n* `mpo` - MPO\n* `mtrj` - MTRJ\n* `sc` - SC\n* `sc-pc` - SC/PC\n* `sc-upc` - SC/UPC\n* `sc-apc` - SC/APC\n* `st` - ST\n* `cs` - CS\n* `sn` - SN\n* `sma-905` - SMA 905\n* `sma-906` - SMA 906\n* `urm-p2` - URM-P2\n* `urm-p4` - URM-P4\n* `urm-p8` - URM-P8\n* `splice` - Splice\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    rear_port: int | None = None
    rear_port_position: conint(ge=1, le=1024) | None = Field(
        None, description="Mapped position on corresponding rear port"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableFrontPortTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) | None = Field(
        None,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "8p8c",
            "8p6c",
            "8p4c",
            "8p2c",
            "6p6c",
            "6p4c",
            "6p2c",
            "4p4c",
            "4p2c",
            "gg45",
            "tera-4p",
            "tera-2p",
            "tera-1p",
            "110-punch",
            "bnc",
            "f",
            "n",
            "mrj21",
            "fc",
            "fc-pc",
            "fc-upc",
            "fc-apc",
            "lc",
            "lc-pc",
            "lc-upc",
            "lc-apc",
            "lsh",
            "lsh-pc",
            "lsh-upc",
            "lsh-apc",
            "lx5",
            "lx5-pc",
            "lx5-upc",
            "lx5-apc",
            "mpo",
            "mtrj",
            "sc",
            "sc-pc",
            "sc-upc",
            "sc-apc",
            "st",
            "cs",
            "sn",
            "sma-905",
            "sma-906",
            "urm-p2",
            "urm-p4",
            "urm-p8",
            "splice",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
        ]
        | None
    ) = Field(
        None,
        description="* `8p8c` - 8P8C\n* `8p6c` - 8P6C\n* `8p4c` - 8P4C\n* `8p2c` - 8P2C\n* `6p6c` - 6P6C\n* `6p4c` - 6P4C\n* `6p2c` - 6P2C\n* `4p4c` - 4P4C\n* `4p2c` - 4P2C\n* `gg45` - GG45\n* `tera-4p` - TERA 4P\n* `tera-2p` - TERA 2P\n* `tera-1p` - TERA 1P\n* `110-punch` - 110 Punch\n* `bnc` - BNC\n* `f` - F Connector\n* `n` - N Connector\n* `mrj21` - MRJ21\n* `fc` - FC\n* `fc-pc` - FC/PC\n* `fc-upc` - FC/UPC\n* `fc-apc` - FC/APC\n* `lc` - LC\n* `lc-pc` - LC/PC\n* `lc-upc` - LC/UPC\n* `lc-apc` - LC/APC\n* `lsh` - LSH\n* `lsh-pc` - LSH/PC\n* `lsh-upc` - LSH/UPC\n* `lsh-apc` - LSH/APC\n* `lx5` - LX.5\n* `lx5-pc` - LX.5/PC\n* `lx5-upc` - LX.5/UPC\n* `lx5-apc` - LX.5/APC\n* `mpo` - MPO\n* `mtrj` - MTRJ\n* `sc` - SC\n* `sc-pc` - SC/PC\n* `sc-upc` - SC/UPC\n* `sc-apc` - SC/APC\n* `st` - ST\n* `cs` - CS\n* `sn` - SN\n* `sma-905` - SMA 905\n* `sma-906` - SMA 906\n* `urm-p2` - URM-P2\n* `urm-p4` - URM-P4\n* `urm-p8` - URM-P8\n* `splice` - Splice\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    rear_port: int | BriefRearPortTemplateRequest | None = None
    rear_port_position: conint(ge=1, le=1024) | None = None
    description: constr(max_length=200) | None = None


class PatchedWritableInterfaceRequest(BaseModel):
    device: int | BriefDeviceRequest | None = None
    vdcs: list[int] | None = None
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64) | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "virtual",
            "bridge",
            "lag",
            "100base-fx",
            "100base-lfx",
            "100base-tx",
            "100base-t1",
            "1000base-t",
            "1000base-lx",
            "1000base-tx",
            "2.5gbase-t",
            "5gbase-t",
            "10gbase-t",
            "10gbase-cx4",
            "100base-x-sfp",
            "1000base-x-gbic",
            "1000base-x-sfp",
            "10gbase-x-sfpp",
            "10gbase-x-xfp",
            "10gbase-x-xenpak",
            "10gbase-x-x2",
            "25gbase-x-sfp28",
            "50gbase-x-sfp56",
            "40gbase-x-qsfpp",
            "50gbase-x-sfp28",
            "100gbase-x-cfp",
            "100gbase-x-cfp2",
            "200gbase-x-cfp2",
            "400gbase-x-cfp2",
            "100gbase-x-cfp4",
            "100gbase-x-cxp",
            "100gbase-x-cpak",
            "100gbase-x-dsfp",
            "100gbase-x-sfpdd",
            "100gbase-x-qsfp28",
            "100gbase-x-qsfpdd",
            "200gbase-x-qsfp56",
            "200gbase-x-qsfpdd",
            "400gbase-x-qsfp112",
            "400gbase-x-qsfpdd",
            "400gbase-x-osfp",
            "400gbase-x-osfp-rhs",
            "400gbase-x-cdfp",
            "400gbase-x-cfp8",
            "800gbase-x-qsfpdd",
            "800gbase-x-osfp",
            "1000base-kx",
            "2.5gbase-kx",
            "5gbase-kr",
            "10gbase-kr",
            "10gbase-kx4",
            "25gbase-kr",
            "40gbase-kr4",
            "50gbase-kr",
            "100gbase-kp4",
            "100gbase-kr2",
            "100gbase-kr4",
            "ieee802.11a",
            "ieee802.11g",
            "ieee802.11n",
            "ieee802.11ac",
            "ieee802.11ad",
            "ieee802.11ax",
            "ieee802.11ay",
            "ieee802.11be",
            "ieee802.15.1",
            "ieee802.15.4",
            "other-wireless",
            "gsm",
            "cdma",
            "lte",
            "4g",
            "5g",
            "sonet-oc3",
            "sonet-oc12",
            "sonet-oc48",
            "sonet-oc192",
            "sonet-oc768",
            "sonet-oc1920",
            "sonet-oc3840",
            "1gfc-sfp",
            "2gfc-sfp",
            "4gfc-sfp",
            "8gfc-sfpp",
            "16gfc-sfpp",
            "32gfc-sfp28",
            "32gfc-sfpp",
            "64gfc-qsfpp",
            "64gfc-sfpdd",
            "64gfc-sfpp",
            "128gfc-qsfp28",
            "infiniband-sdr",
            "infiniband-ddr",
            "infiniband-qdr",
            "infiniband-fdr10",
            "infiniband-fdr",
            "infiniband-edr",
            "infiniband-hdr",
            "infiniband-ndr",
            "infiniband-xdr",
            "t1",
            "e1",
            "t3",
            "e3",
            "xdsl",
            "docsis",
            "moca",
            "bpon",
            "epon",
            "10g-epon",
            "gpon",
            "xg-pon",
            "xgs-pon",
            "ng-pon2",
            "25g-pon",
            "50g-pon",
            "cisco-stackwise",
            "cisco-stackwise-plus",
            "cisco-flexstack",
            "cisco-flexstack-plus",
            "cisco-stackwise-80",
            "cisco-stackwise-160",
            "cisco-stackwise-320",
            "cisco-stackwise-480",
            "cisco-stackwise-1t",
            "juniper-vcp",
            "extreme-summitstack",
            "extreme-summitstack-128",
            "extreme-summitstack-256",
            "extreme-summitstack-512",
            "other",
        ]
        | None
    ) = Field(
        None,
        description="* `virtual` - Virtual\n* `bridge` - Bridge\n* `lag` - Link Aggregation Group (LAG)\n* `100base-fx` - 100BASE-FX (10/100ME FIBER)\n* `100base-lfx` - 100BASE-LFX (10/100ME FIBER)\n* `100base-tx` - 100BASE-TX (10/100ME)\n* `100base-t1` - 100BASE-T1 (10/100ME Single Pair)\n* `1000base-t` - 1000BASE-T (1GE)\n* `1000base-lx` - 1000BASE-LX (1GE)\n* `1000base-tx` - 1000BASE-TX (1GE)\n* `2.5gbase-t` - 2.5GBASE-T (2.5GE)\n* `5gbase-t` - 5GBASE-T (5GE)\n* `10gbase-t` - 10GBASE-T (10GE)\n* `10gbase-cx4` - 10GBASE-CX4 (10GE)\n* `100base-x-sfp` - SFP (100ME)\n* `1000base-x-gbic` - GBIC (1GE)\n* `1000base-x-sfp` - SFP (1GE)\n* `10gbase-x-sfpp` - SFP+ (10GE)\n* `10gbase-x-xfp` - XFP (10GE)\n* `10gbase-x-xenpak` - XENPAK (10GE)\n* `10gbase-x-x2` - X2 (10GE)\n* `25gbase-x-sfp28` - SFP28 (25GE)\n* `50gbase-x-sfp56` - SFP56 (50GE)\n* `40gbase-x-qsfpp` - QSFP+ (40GE)\n* `50gbase-x-sfp28` - QSFP28 (50GE)\n* `100gbase-x-cfp` - CFP (100GE)\n* `100gbase-x-cfp2` - CFP2 (100GE)\n* `200gbase-x-cfp2` - CFP2 (200GE)\n* `400gbase-x-cfp2` - CFP2 (400GE)\n* `100gbase-x-cfp4` - CFP4 (100GE)\n* `100gbase-x-cxp` - CXP (100GE)\n* `100gbase-x-cpak` - Cisco CPAK (100GE)\n* `100gbase-x-dsfp` - DSFP (100GE)\n* `100gbase-x-sfpdd` - SFP-DD (100GE)\n* `100gbase-x-qsfp28` - QSFP28 (100GE)\n* `100gbase-x-qsfpdd` - QSFP-DD (100GE)\n* `200gbase-x-qsfp56` - QSFP56 (200GE)\n* `200gbase-x-qsfpdd` - QSFP-DD (200GE)\n* `400gbase-x-qsfp112` - QSFP112 (400GE)\n* `400gbase-x-qsfpdd` - QSFP-DD (400GE)\n* `400gbase-x-osfp` - OSFP (400GE)\n* `400gbase-x-osfp-rhs` - OSFP-RHS (400GE)\n* `400gbase-x-cdfp` - CDFP (400GE)\n* `400gbase-x-cfp8` - CPF8 (400GE)\n* `800gbase-x-qsfpdd` - QSFP-DD (800GE)\n* `800gbase-x-osfp` - OSFP (800GE)\n* `1000base-kx` - 1000BASE-KX (1GE)\n* `2.5gbase-kx` - 2.5GBASE-KX (2.5GE)\n* `5gbase-kr` - 5GBASE-KR (5GE)\n* `10gbase-kr` - 10GBASE-KR (10GE)\n* `10gbase-kx4` - 10GBASE-KX4 (10GE)\n* `25gbase-kr` - 25GBASE-KR (25GE)\n* `40gbase-kr4` - 40GBASE-KR4 (40GE)\n* `50gbase-kr` - 50GBASE-KR (50GE)\n* `100gbase-kp4` - 100GBASE-KP4 (100GE)\n* `100gbase-kr2` - 100GBASE-KR2 (100GE)\n* `100gbase-kr4` - 100GBASE-KR4 (100GE)\n* `ieee802.11a` - IEEE 802.11a\n* `ieee802.11g` - IEEE 802.11b/g\n* `ieee802.11n` - IEEE 802.11n\n* `ieee802.11ac` - IEEE 802.11ac\n* `ieee802.11ad` - IEEE 802.11ad\n* `ieee802.11ax` - IEEE 802.11ax\n* `ieee802.11ay` - IEEE 802.11ay\n* `ieee802.11be` - IEEE 802.11be\n* `ieee802.15.1` - IEEE 802.15.1 (Bluetooth)\n* `ieee802.15.4` - IEEE 802.15.4 (LR-WPAN)\n* `other-wireless` - Other (Wireless)\n* `gsm` - GSM\n* `cdma` - CDMA\n* `lte` - LTE\n* `4g` - 4G\n* `5g` - 5G\n* `sonet-oc3` - OC-3/STM-1\n* `sonet-oc12` - OC-12/STM-4\n* `sonet-oc48` - OC-48/STM-16\n* `sonet-oc192` - OC-192/STM-64\n* `sonet-oc768` - OC-768/STM-256\n* `sonet-oc1920` - OC-1920/STM-640\n* `sonet-oc3840` - OC-3840/STM-1234\n* `1gfc-sfp` - SFP (1GFC)\n* `2gfc-sfp` - SFP (2GFC)\n* `4gfc-sfp` - SFP (4GFC)\n* `8gfc-sfpp` - SFP+ (8GFC)\n* `16gfc-sfpp` - SFP+ (16GFC)\n* `32gfc-sfp28` - SFP28 (32GFC)\n* `32gfc-sfpp` - SFP+ (32GFC)\n* `64gfc-qsfpp` - QSFP+ (64GFC)\n* `64gfc-sfpdd` - SFP-DD (64GFC)\n* `64gfc-sfpp` - SFP+ (64GFC)\n* `128gfc-qsfp28` - QSFP28 (128GFC)\n* `infiniband-sdr` - SDR (2 Gbps)\n* `infiniband-ddr` - DDR (4 Gbps)\n* `infiniband-qdr` - QDR (8 Gbps)\n* `infiniband-fdr10` - FDR10 (10 Gbps)\n* `infiniband-fdr` - FDR (13.5 Gbps)\n* `infiniband-edr` - EDR (25 Gbps)\n* `infiniband-hdr` - HDR (50 Gbps)\n* `infiniband-ndr` - NDR (100 Gbps)\n* `infiniband-xdr` - XDR (250 Gbps)\n* `t1` - T1 (1.544 Mbps)\n* `e1` - E1 (2.048 Mbps)\n* `t3` - T3 (45 Mbps)\n* `e3` - E3 (34 Mbps)\n* `xdsl` - xDSL\n* `docsis` - DOCSIS\n* `moca` - MoCA\n* `bpon` - BPON (622 Mbps / 155 Mbps)\n* `epon` - EPON (1 Gbps)\n* `10g-epon` - 10G-EPON (10 Gbps)\n* `gpon` - GPON (2.5 Gbps / 1.25 Gbps)\n* `xg-pon` - XG-PON (10 Gbps / 2.5 Gbps)\n* `xgs-pon` - XGS-PON (10 Gbps)\n* `ng-pon2` - NG-PON2 (TWDM-PON) (4x10 Gbps)\n* `25g-pon` - 25G-PON (25 Gbps)\n* `50g-pon` - 50G-PON (50 Gbps)\n* `cisco-stackwise` - Cisco StackWise\n* `cisco-stackwise-plus` - Cisco StackWise Plus\n* `cisco-flexstack` - Cisco FlexStack\n* `cisco-flexstack-plus` - Cisco FlexStack Plus\n* `cisco-stackwise-80` - Cisco StackWise-80\n* `cisco-stackwise-160` - Cisco StackWise-160\n* `cisco-stackwise-320` - Cisco StackWise-320\n* `cisco-stackwise-480` - Cisco StackWise-480\n* `cisco-stackwise-1t` - Cisco StackWise-1T\n* `juniper-vcp` - Juniper VCP\n* `extreme-summitstack` - Extreme SummitStack\n* `extreme-summitstack-128` - Extreme SummitStack-128\n* `extreme-summitstack-256` - Extreme SummitStack-256\n* `extreme-summitstack-512` - Extreme SummitStack-512\n* `other` - Other",
    )
    enabled: bool | None = None
    parent: ParentInterface | None = Field(None, title="Parent interface")
    bridge: BridgeInterface | None = Field(None, title="Bridge interface")
    lag: ParentLAG | None = Field(None, title="Parent LAG")
    mtu: conint(ge=1, le=65536) | None = None
    primary_mac_address: int | BriefMACAddressRequest | None = None
    speed: SpeedKbps | None = Field(None, title="Speed (Kbps)")
    duplex: Literal["half", "full", "auto", ""] | None = Field(
        None, description="* `half` - Half\n* `full` - Full\n* `auto` - Auto"
    )
    wwn: str | None = None
    mgmt_only: ManagementOnly4 | None = Field(
        None,
        description="This interface is used only for out-of-band management",
        title="Management only",
    )
    description: constr(max_length=200) | None = None
    mode: Literal["access", "tagged", "tagged-all", "q-in-q", ""] | None = Field(
        None,
        description="IEEE 802.1Q tagging strategy\n\n* `access` - Access\n* `tagged` - Tagged\n* `tagged-all` - Tagged (All)\n* `q-in-q` - Q-in-Q (802.1ad)",
    )
    rf_role: WirelessRole | None = Field(
        None,
        description="* `ap` - Access point\n* `station` - Station",
        title="Wireless role",
    )
    rf_channel: WirelessChannel | None = Field(
        None,
        description="* `2.4g-1-2412-22` - 1 (2412 MHz)\n* `2.4g-2-2417-22` - 2 (2417 MHz)\n* `2.4g-3-2422-22` - 3 (2422 MHz)\n* `2.4g-4-2427-22` - 4 (2427 MHz)\n* `2.4g-5-2432-22` - 5 (2432 MHz)\n* `2.4g-6-2437-22` - 6 (2437 MHz)\n* `2.4g-7-2442-22` - 7 (2442 MHz)\n* `2.4g-8-2447-22` - 8 (2447 MHz)\n* `2.4g-9-2452-22` - 9 (2452 MHz)\n* `2.4g-10-2457-22` - 10 (2457 MHz)\n* `2.4g-11-2462-22` - 11 (2462 MHz)\n* `2.4g-12-2467-22` - 12 (2467 MHz)\n* `2.4g-13-2472-22` - 13 (2472 MHz)\n* `5g-32-5160-20` - 32 (5160/20 MHz)\n* `5g-34-5170-40` - 34 (5170/40 MHz)\n* `5g-36-5180-20` - 36 (5180/20 MHz)\n* `5g-38-5190-40` - 38 (5190/40 MHz)\n* `5g-40-5200-20` - 40 (5200/20 MHz)\n* `5g-42-5210-80` - 42 (5210/80 MHz)\n* `5g-44-5220-20` - 44 (5220/20 MHz)\n* `5g-46-5230-40` - 46 (5230/40 MHz)\n* `5g-48-5240-20` - 48 (5240/20 MHz)\n* `5g-50-5250-160` - 50 (5250/160 MHz)\n* `5g-52-5260-20` - 52 (5260/20 MHz)\n* `5g-54-5270-40` - 54 (5270/40 MHz)\n* `5g-56-5280-20` - 56 (5280/20 MHz)\n* `5g-58-5290-80` - 58 (5290/80 MHz)\n* `5g-60-5300-20` - 60 (5300/20 MHz)\n* `5g-62-5310-40` - 62 (5310/40 MHz)\n* `5g-64-5320-20` - 64 (5320/20 MHz)\n* `5g-100-5500-20` - 100 (5500/20 MHz)\n* `5g-102-5510-40` - 102 (5510/40 MHz)\n* `5g-104-5520-20` - 104 (5520/20 MHz)\n* `5g-106-5530-80` - 106 (5530/80 MHz)\n* `5g-108-5540-20` - 108 (5540/20 MHz)\n* `5g-110-5550-40` - 110 (5550/40 MHz)\n* `5g-112-5560-20` - 112 (5560/20 MHz)\n* `5g-114-5570-160` - 114 (5570/160 MHz)\n* `5g-116-5580-20` - 116 (5580/20 MHz)\n* `5g-118-5590-40` - 118 (5590/40 MHz)\n* `5g-120-5600-20` - 120 (5600/20 MHz)\n* `5g-122-5610-80` - 122 (5610/80 MHz)\n* `5g-124-5620-20` - 124 (5620/20 MHz)\n* `5g-126-5630-40` - 126 (5630/40 MHz)\n* `5g-128-5640-20` - 128 (5640/20 MHz)\n* `5g-132-5660-20` - 132 (5660/20 MHz)\n* `5g-134-5670-40` - 134 (5670/40 MHz)\n* `5g-136-5680-20` - 136 (5680/20 MHz)\n* `5g-138-5690-80` - 138 (5690/80 MHz)\n* `5g-140-5700-20` - 140 (5700/20 MHz)\n* `5g-142-5710-40` - 142 (5710/40 MHz)\n* `5g-144-5720-20` - 144 (5720/20 MHz)\n* `5g-149-5745-20` - 149 (5745/20 MHz)\n* `5g-151-5755-40` - 151 (5755/40 MHz)\n* `5g-153-5765-20` - 153 (5765/20 MHz)\n* `5g-155-5775-80` - 155 (5775/80 MHz)\n* `5g-157-5785-20` - 157 (5785/20 MHz)\n* `5g-159-5795-40` - 159 (5795/40 MHz)\n* `5g-161-5805-20` - 161 (5805/20 MHz)\n* `5g-163-5815-160` - 163 (5815/160 MHz)\n* `5g-165-5825-20` - 165 (5825/20 MHz)\n* `5g-167-5835-40` - 167 (5835/40 MHz)\n* `5g-169-5845-20` - 169 (5845/20 MHz)\n* `5g-171-5855-80` - 171 (5855/80 MHz)\n* `5g-173-5865-20` - 173 (5865/20 MHz)\n* `5g-175-5875-40` - 175 (5875/40 MHz)\n* `5g-177-5885-20` - 177 (5885/20 MHz)\n* `6g-1-5955-20` - 1 (5955/20 MHz)\n* `6g-3-5965-40` - 3 (5965/40 MHz)\n* `6g-5-5975-20` - 5 (5975/20 MHz)\n* `6g-7-5985-80` - 7 (5985/80 MHz)\n* `6g-9-5995-20` - 9 (5995/20 MHz)\n* `6g-11-6005-40` - 11 (6005/40 MHz)\n* `6g-13-6015-20` - 13 (6015/20 MHz)\n* `6g-15-6025-160` - 15 (6025/160 MHz)\n* `6g-17-6035-20` - 17 (6035/20 MHz)\n* `6g-19-6045-40` - 19 (6045/40 MHz)\n* `6g-21-6055-20` - 21 (6055/20 MHz)\n* `6g-23-6065-80` - 23 (6065/80 MHz)\n* `6g-25-6075-20` - 25 (6075/20 MHz)\n* `6g-27-6085-40` - 27 (6085/40 MHz)\n* `6g-29-6095-20` - 29 (6095/20 MHz)\n* `6g-31-6105-320` - 31 (6105/320 MHz)\n* `6g-33-6115-20` - 33 (6115/20 MHz)\n* `6g-35-6125-40` - 35 (6125/40 MHz)\n* `6g-37-6135-20` - 37 (6135/20 MHz)\n* `6g-39-6145-80` - 39 (6145/80 MHz)\n* `6g-41-6155-20` - 41 (6155/20 MHz)\n* `6g-43-6165-40` - 43 (6165/40 MHz)\n* `6g-45-6175-20` - 45 (6175/20 MHz)\n* `6g-47-6185-160` - 47 (6185/160 MHz)\n* `6g-49-6195-20` - 49 (6195/20 MHz)\n* `6g-51-6205-40` - 51 (6205/40 MHz)\n* `6g-53-6215-20` - 53 (6215/20 MHz)\n* `6g-55-6225-80` - 55 (6225/80 MHz)\n* `6g-57-6235-20` - 57 (6235/20 MHz)\n* `6g-59-6245-40` - 59 (6245/40 MHz)\n* `6g-61-6255-20` - 61 (6255/20 MHz)\n* `6g-65-6275-20` - 65 (6275/20 MHz)\n* `6g-67-6285-40` - 67 (6285/40 MHz)\n* `6g-69-6295-20` - 69 (6295/20 MHz)\n* `6g-71-6305-80` - 71 (6305/80 MHz)\n* `6g-73-6315-20` - 73 (6315/20 MHz)\n* `6g-75-6325-40` - 75 (6325/40 MHz)\n* `6g-77-6335-20` - 77 (6335/20 MHz)\n* `6g-79-6345-160` - 79 (6345/160 MHz)\n* `6g-81-6355-20` - 81 (6355/20 MHz)\n* `6g-83-6365-40` - 83 (6365/40 MHz)\n* `6g-85-6375-20` - 85 (6375/20 MHz)\n* `6g-87-6385-80` - 87 (6385/80 MHz)\n* `6g-89-6395-20` - 89 (6395/20 MHz)\n* `6g-91-6405-40` - 91 (6405/40 MHz)\n* `6g-93-6415-20` - 93 (6415/20 MHz)\n* `6g-95-6425-320` - 95 (6425/320 MHz)\n* `6g-97-6435-20` - 97 (6435/20 MHz)\n* `6g-99-6445-40` - 99 (6445/40 MHz)\n* `6g-101-6455-20` - 101 (6455/20 MHz)\n* `6g-103-6465-80` - 103 (6465/80 MHz)\n* `6g-105-6475-20` - 105 (6475/20 MHz)\n* `6g-107-6485-40` - 107 (6485/40 MHz)\n* `6g-109-6495-20` - 109 (6495/20 MHz)\n* `6g-111-6505-160` - 111 (6505/160 MHz)\n* `6g-113-6515-20` - 113 (6515/20 MHz)\n* `6g-115-6525-40` - 115 (6525/40 MHz)\n* `6g-117-6535-20` - 117 (6535/20 MHz)\n* `6g-119-6545-80` - 119 (6545/80 MHz)\n* `6g-121-6555-20` - 121 (6555/20 MHz)\n* `6g-123-6565-40` - 123 (6565/40 MHz)\n* `6g-125-6575-20` - 125 (6575/20 MHz)\n* `6g-129-6595-20` - 129 (6595/20 MHz)\n* `6g-131-6605-40` - 131 (6605/40 MHz)\n* `6g-133-6615-20` - 133 (6615/20 MHz)\n* `6g-135-6625-80` - 135 (6625/80 MHz)\n* `6g-137-6635-20` - 137 (6635/20 MHz)\n* `6g-139-6645-40` - 139 (6645/40 MHz)\n* `6g-141-6655-20` - 141 (6655/20 MHz)\n* `6g-143-6665-160` - 143 (6665/160 MHz)\n* `6g-145-6675-20` - 145 (6675/20 MHz)\n* `6g-147-6685-40` - 147 (6685/40 MHz)\n* `6g-149-6695-20` - 149 (6695/20 MHz)\n* `6g-151-6705-80` - 151 (6705/80 MHz)\n* `6g-153-6715-20` - 153 (6715/20 MHz)\n* `6g-155-6725-40` - 155 (6725/40 MHz)\n* `6g-157-6735-20` - 157 (6735/20 MHz)\n* `6g-159-6745-320` - 159 (6745/320 MHz)\n* `6g-161-6755-20` - 161 (6755/20 MHz)\n* `6g-163-6765-40` - 163 (6765/40 MHz)\n* `6g-165-6775-20` - 165 (6775/20 MHz)\n* `6g-167-6785-80` - 167 (6785/80 MHz)\n* `6g-169-6795-20` - 169 (6795/20 MHz)\n* `6g-171-6805-40` - 171 (6805/40 MHz)\n* `6g-173-6815-20` - 173 (6815/20 MHz)\n* `6g-175-6825-160` - 175 (6825/160 MHz)\n* `6g-177-6835-20` - 177 (6835/20 MHz)\n* `6g-179-6845-40` - 179 (6845/40 MHz)\n* `6g-181-6855-20` - 181 (6855/20 MHz)\n* `6g-183-6865-80` - 183 (6865/80 MHz)\n* `6g-185-6875-20` - 185 (6875/20 MHz)\n* `6g-187-6885-40` - 187 (6885/40 MHz)\n* `6g-189-6895-20` - 189 (6895/20 MHz)\n* `6g-193-6915-20` - 193 (6915/20 MHz)\n* `6g-195-6925-40` - 195 (6925/40 MHz)\n* `6g-197-6935-20` - 197 (6935/20 MHz)\n* `6g-199-6945-80` - 199 (6945/80 MHz)\n* `6g-201-6955-20` - 201 (6955/20 MHz)\n* `6g-203-6965-40` - 203 (6965/40 MHz)\n* `6g-205-6975-20` - 205 (6975/20 MHz)\n* `6g-207-6985-160` - 207 (6985/160 MHz)\n* `6g-209-6995-20` - 209 (6995/20 MHz)\n* `6g-211-7005-40` - 211 (7005/40 MHz)\n* `6g-213-7015-20` - 213 (7015/20 MHz)\n* `6g-215-7025-80` - 215 (7025/80 MHz)\n* `6g-217-7035-20` - 217 (7035/20 MHz)\n* `6g-219-7045-40` - 219 (7045/40 MHz)\n* `6g-221-7055-20` - 221 (7055/20 MHz)\n* `6g-225-7075-20` - 225 (7075/20 MHz)\n* `6g-227-7085-40` - 227 (7085/40 MHz)\n* `6g-229-7095-20` - 229 (7095/20 MHz)\n* `6g-233-7115-20` - 233 (7115/20 MHz)\n* `60g-1-58320-2160` - 1 (58.32/2.16 GHz)\n* `60g-2-60480-2160` - 2 (60.48/2.16 GHz)\n* `60g-3-62640-2160` - 3 (62.64/2.16 GHz)\n* `60g-4-64800-2160` - 4 (64.80/2.16 GHz)\n* `60g-5-66960-2160` - 5 (66.96/2.16 GHz)\n* `60g-6-69120-2160` - 6 (69.12/2.16 GHz)\n* `60g-9-59400-4320` - 9 (59.40/4.32 GHz)\n* `60g-10-61560-4320` - 10 (61.56/4.32 GHz)\n* `60g-11-63720-4320` - 11 (63.72/4.32 GHz)\n* `60g-12-65880-4320` - 12 (65.88/4.32 GHz)\n* `60g-13-68040-4320` - 13 (68.04/4.32 GHz)\n* `60g-17-60480-6480` - 17 (60.48/6.48 GHz)\n* `60g-18-62640-6480` - 18 (62.64/6.48 GHz)\n* `60g-19-64800-6480` - 19 (64.80/6.48 GHz)\n* `60g-20-66960-6480` - 20 (66.96/6.48 GHz)\n* `60g-25-61560-6480` - 25 (61.56/8.64 GHz)\n* `60g-26-63720-6480` - 26 (63.72/8.64 GHz)\n* `60g-27-65880-6480` - 27 (65.88/8.64 GHz)",
        title="Wireless channel",
    )
    poe_mode: Literal["pd", "pse", ""] | None = Field(
        None, description="* `pd` - PD\n* `pse` - PSE"
    )
    poe_type: (
        Literal[
            "type1-ieee802.3af",
            "type2-ieee802.3at",
            "type3-ieee802.3bt",
            "type4-ieee802.3bt",
            "passive-24v-2pair",
            "passive-24v-4pair",
            "passive-48v-2pair",
            "passive-48v-4pair",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `type1-ieee802.3af` - 802.3af (Type 1)\n* `type2-ieee802.3at` - 802.3at (Type 2)\n* `type3-ieee802.3bt` - 802.3bt (Type 3)\n* `type4-ieee802.3bt` - 802.3bt (Type 4)\n* `passive-24v-2pair` - Passive 24V (2-pair)\n* `passive-24v-4pair` - Passive 24V (4-pair)\n* `passive-48v-2pair` - Passive 48V (2-pair)\n* `passive-48v-4pair` - Passive 48V (4-pair)",
    )
    rf_channel_frequency: ChannelFrequencyMHz | None = Field(
        None,
        description="Populated by selected channel (if set)",
        title="Channel frequency (MHz)",
    )
    rf_channel_width: ChannelWidthMHz | None = Field(
        None,
        description="Populated by selected channel (if set)",
        title="Channel width (MHz)",
    )
    tx_power: TransmitPowerDBm | None = Field(None, title="Transmit power (dBm)")
    untagged_vlan: int | BriefVLANRequest | None = None
    tagged_vlans: list[int] | None = None
    qinq_svlan: int | BriefVLANRequest | None = None
    vlan_translation_policy: int | BriefVLANTranslationPolicyRequest | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    wireless_lans: list[int] | None = None
    vrf: int | BriefVRFRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableInterfaceTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) | None = Field(
        None,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "virtual",
            "bridge",
            "lag",
            "100base-fx",
            "100base-lfx",
            "100base-tx",
            "100base-t1",
            "1000base-t",
            "1000base-lx",
            "1000base-tx",
            "2.5gbase-t",
            "5gbase-t",
            "10gbase-t",
            "10gbase-cx4",
            "100base-x-sfp",
            "1000base-x-gbic",
            "1000base-x-sfp",
            "10gbase-x-sfpp",
            "10gbase-x-xfp",
            "10gbase-x-xenpak",
            "10gbase-x-x2",
            "25gbase-x-sfp28",
            "50gbase-x-sfp56",
            "40gbase-x-qsfpp",
            "50gbase-x-sfp28",
            "100gbase-x-cfp",
            "100gbase-x-cfp2",
            "200gbase-x-cfp2",
            "400gbase-x-cfp2",
            "100gbase-x-cfp4",
            "100gbase-x-cxp",
            "100gbase-x-cpak",
            "100gbase-x-dsfp",
            "100gbase-x-sfpdd",
            "100gbase-x-qsfp28",
            "100gbase-x-qsfpdd",
            "200gbase-x-qsfp56",
            "200gbase-x-qsfpdd",
            "400gbase-x-qsfp112",
            "400gbase-x-qsfpdd",
            "400gbase-x-osfp",
            "400gbase-x-osfp-rhs",
            "400gbase-x-cdfp",
            "400gbase-x-cfp8",
            "800gbase-x-qsfpdd",
            "800gbase-x-osfp",
            "1000base-kx",
            "2.5gbase-kx",
            "5gbase-kr",
            "10gbase-kr",
            "10gbase-kx4",
            "25gbase-kr",
            "40gbase-kr4",
            "50gbase-kr",
            "100gbase-kp4",
            "100gbase-kr2",
            "100gbase-kr4",
            "ieee802.11a",
            "ieee802.11g",
            "ieee802.11n",
            "ieee802.11ac",
            "ieee802.11ad",
            "ieee802.11ax",
            "ieee802.11ay",
            "ieee802.11be",
            "ieee802.15.1",
            "ieee802.15.4",
            "other-wireless",
            "gsm",
            "cdma",
            "lte",
            "4g",
            "5g",
            "sonet-oc3",
            "sonet-oc12",
            "sonet-oc48",
            "sonet-oc192",
            "sonet-oc768",
            "sonet-oc1920",
            "sonet-oc3840",
            "1gfc-sfp",
            "2gfc-sfp",
            "4gfc-sfp",
            "8gfc-sfpp",
            "16gfc-sfpp",
            "32gfc-sfp28",
            "32gfc-sfpp",
            "64gfc-qsfpp",
            "64gfc-sfpdd",
            "64gfc-sfpp",
            "128gfc-qsfp28",
            "infiniband-sdr",
            "infiniband-ddr",
            "infiniband-qdr",
            "infiniband-fdr10",
            "infiniband-fdr",
            "infiniband-edr",
            "infiniband-hdr",
            "infiniband-ndr",
            "infiniband-xdr",
            "t1",
            "e1",
            "t3",
            "e3",
            "xdsl",
            "docsis",
            "moca",
            "bpon",
            "epon",
            "10g-epon",
            "gpon",
            "xg-pon",
            "xgs-pon",
            "ng-pon2",
            "25g-pon",
            "50g-pon",
            "cisco-stackwise",
            "cisco-stackwise-plus",
            "cisco-flexstack",
            "cisco-flexstack-plus",
            "cisco-stackwise-80",
            "cisco-stackwise-160",
            "cisco-stackwise-320",
            "cisco-stackwise-480",
            "cisco-stackwise-1t",
            "juniper-vcp",
            "extreme-summitstack",
            "extreme-summitstack-128",
            "extreme-summitstack-256",
            "extreme-summitstack-512",
            "other",
        ]
        | None
    ) = Field(
        None,
        description="* `virtual` - Virtual\n* `bridge` - Bridge\n* `lag` - Link Aggregation Group (LAG)\n* `100base-fx` - 100BASE-FX (10/100ME FIBER)\n* `100base-lfx` - 100BASE-LFX (10/100ME FIBER)\n* `100base-tx` - 100BASE-TX (10/100ME)\n* `100base-t1` - 100BASE-T1 (10/100ME Single Pair)\n* `1000base-t` - 1000BASE-T (1GE)\n* `1000base-lx` - 1000BASE-LX (1GE)\n* `1000base-tx` - 1000BASE-TX (1GE)\n* `2.5gbase-t` - 2.5GBASE-T (2.5GE)\n* `5gbase-t` - 5GBASE-T (5GE)\n* `10gbase-t` - 10GBASE-T (10GE)\n* `10gbase-cx4` - 10GBASE-CX4 (10GE)\n* `100base-x-sfp` - SFP (100ME)\n* `1000base-x-gbic` - GBIC (1GE)\n* `1000base-x-sfp` - SFP (1GE)\n* `10gbase-x-sfpp` - SFP+ (10GE)\n* `10gbase-x-xfp` - XFP (10GE)\n* `10gbase-x-xenpak` - XENPAK (10GE)\n* `10gbase-x-x2` - X2 (10GE)\n* `25gbase-x-sfp28` - SFP28 (25GE)\n* `50gbase-x-sfp56` - SFP56 (50GE)\n* `40gbase-x-qsfpp` - QSFP+ (40GE)\n* `50gbase-x-sfp28` - QSFP28 (50GE)\n* `100gbase-x-cfp` - CFP (100GE)\n* `100gbase-x-cfp2` - CFP2 (100GE)\n* `200gbase-x-cfp2` - CFP2 (200GE)\n* `400gbase-x-cfp2` - CFP2 (400GE)\n* `100gbase-x-cfp4` - CFP4 (100GE)\n* `100gbase-x-cxp` - CXP (100GE)\n* `100gbase-x-cpak` - Cisco CPAK (100GE)\n* `100gbase-x-dsfp` - DSFP (100GE)\n* `100gbase-x-sfpdd` - SFP-DD (100GE)\n* `100gbase-x-qsfp28` - QSFP28 (100GE)\n* `100gbase-x-qsfpdd` - QSFP-DD (100GE)\n* `200gbase-x-qsfp56` - QSFP56 (200GE)\n* `200gbase-x-qsfpdd` - QSFP-DD (200GE)\n* `400gbase-x-qsfp112` - QSFP112 (400GE)\n* `400gbase-x-qsfpdd` - QSFP-DD (400GE)\n* `400gbase-x-osfp` - OSFP (400GE)\n* `400gbase-x-osfp-rhs` - OSFP-RHS (400GE)\n* `400gbase-x-cdfp` - CDFP (400GE)\n* `400gbase-x-cfp8` - CPF8 (400GE)\n* `800gbase-x-qsfpdd` - QSFP-DD (800GE)\n* `800gbase-x-osfp` - OSFP (800GE)\n* `1000base-kx` - 1000BASE-KX (1GE)\n* `2.5gbase-kx` - 2.5GBASE-KX (2.5GE)\n* `5gbase-kr` - 5GBASE-KR (5GE)\n* `10gbase-kr` - 10GBASE-KR (10GE)\n* `10gbase-kx4` - 10GBASE-KX4 (10GE)\n* `25gbase-kr` - 25GBASE-KR (25GE)\n* `40gbase-kr4` - 40GBASE-KR4 (40GE)\n* `50gbase-kr` - 50GBASE-KR (50GE)\n* `100gbase-kp4` - 100GBASE-KP4 (100GE)\n* `100gbase-kr2` - 100GBASE-KR2 (100GE)\n* `100gbase-kr4` - 100GBASE-KR4 (100GE)\n* `ieee802.11a` - IEEE 802.11a\n* `ieee802.11g` - IEEE 802.11b/g\n* `ieee802.11n` - IEEE 802.11n\n* `ieee802.11ac` - IEEE 802.11ac\n* `ieee802.11ad` - IEEE 802.11ad\n* `ieee802.11ax` - IEEE 802.11ax\n* `ieee802.11ay` - IEEE 802.11ay\n* `ieee802.11be` - IEEE 802.11be\n* `ieee802.15.1` - IEEE 802.15.1 (Bluetooth)\n* `ieee802.15.4` - IEEE 802.15.4 (LR-WPAN)\n* `other-wireless` - Other (Wireless)\n* `gsm` - GSM\n* `cdma` - CDMA\n* `lte` - LTE\n* `4g` - 4G\n* `5g` - 5G\n* `sonet-oc3` - OC-3/STM-1\n* `sonet-oc12` - OC-12/STM-4\n* `sonet-oc48` - OC-48/STM-16\n* `sonet-oc192` - OC-192/STM-64\n* `sonet-oc768` - OC-768/STM-256\n* `sonet-oc1920` - OC-1920/STM-640\n* `sonet-oc3840` - OC-3840/STM-1234\n* `1gfc-sfp` - SFP (1GFC)\n* `2gfc-sfp` - SFP (2GFC)\n* `4gfc-sfp` - SFP (4GFC)\n* `8gfc-sfpp` - SFP+ (8GFC)\n* `16gfc-sfpp` - SFP+ (16GFC)\n* `32gfc-sfp28` - SFP28 (32GFC)\n* `32gfc-sfpp` - SFP+ (32GFC)\n* `64gfc-qsfpp` - QSFP+ (64GFC)\n* `64gfc-sfpdd` - SFP-DD (64GFC)\n* `64gfc-sfpp` - SFP+ (64GFC)\n* `128gfc-qsfp28` - QSFP28 (128GFC)\n* `infiniband-sdr` - SDR (2 Gbps)\n* `infiniband-ddr` - DDR (4 Gbps)\n* `infiniband-qdr` - QDR (8 Gbps)\n* `infiniband-fdr10` - FDR10 (10 Gbps)\n* `infiniband-fdr` - FDR (13.5 Gbps)\n* `infiniband-edr` - EDR (25 Gbps)\n* `infiniband-hdr` - HDR (50 Gbps)\n* `infiniband-ndr` - NDR (100 Gbps)\n* `infiniband-xdr` - XDR (250 Gbps)\n* `t1` - T1 (1.544 Mbps)\n* `e1` - E1 (2.048 Mbps)\n* `t3` - T3 (45 Mbps)\n* `e3` - E3 (34 Mbps)\n* `xdsl` - xDSL\n* `docsis` - DOCSIS\n* `moca` - MoCA\n* `bpon` - BPON (622 Mbps / 155 Mbps)\n* `epon` - EPON (1 Gbps)\n* `10g-epon` - 10G-EPON (10 Gbps)\n* `gpon` - GPON (2.5 Gbps / 1.25 Gbps)\n* `xg-pon` - XG-PON (10 Gbps / 2.5 Gbps)\n* `xgs-pon` - XGS-PON (10 Gbps)\n* `ng-pon2` - NG-PON2 (TWDM-PON) (4x10 Gbps)\n* `25g-pon` - 25G-PON (25 Gbps)\n* `50g-pon` - 50G-PON (50 Gbps)\n* `cisco-stackwise` - Cisco StackWise\n* `cisco-stackwise-plus` - Cisco StackWise Plus\n* `cisco-flexstack` - Cisco FlexStack\n* `cisco-flexstack-plus` - Cisco FlexStack Plus\n* `cisco-stackwise-80` - Cisco StackWise-80\n* `cisco-stackwise-160` - Cisco StackWise-160\n* `cisco-stackwise-320` - Cisco StackWise-320\n* `cisco-stackwise-480` - Cisco StackWise-480\n* `cisco-stackwise-1t` - Cisco StackWise-1T\n* `juniper-vcp` - Juniper VCP\n* `extreme-summitstack` - Extreme SummitStack\n* `extreme-summitstack-128` - Extreme SummitStack-128\n* `extreme-summitstack-256` - Extreme SummitStack-256\n* `extreme-summitstack-512` - Extreme SummitStack-512\n* `other` - Other",
    )
    enabled: bool | None = None
    mgmt_only: ManagementOnly5 | None = Field(None, title="Management only")
    description: constr(max_length=200) | None = None
    bridge: BridgeInterface | None = Field(None, title="Bridge interface")
    poe_mode: Literal["pd", "pse", ""] | None = Field(
        None, description="* `pd` - PD\n* `pse` - PSE"
    )
    poe_type: (
        Literal[
            "type1-ieee802.3af",
            "type2-ieee802.3at",
            "type3-ieee802.3bt",
            "type4-ieee802.3bt",
            "passive-24v-2pair",
            "passive-24v-4pair",
            "passive-48v-2pair",
            "passive-48v-4pair",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `type1-ieee802.3af` - 802.3af (Type 1)\n* `type2-ieee802.3at` - 802.3at (Type 2)\n* `type3-ieee802.3bt` - 802.3bt (Type 3)\n* `type4-ieee802.3bt` - 802.3bt (Type 4)\n* `passive-24v-2pair` - Passive 24V (2-pair)\n* `passive-24v-4pair` - Passive 24V (4-pair)\n* `passive-48v-2pair` - Passive 48V (2-pair)\n* `passive-48v-4pair` - Passive 48V (4-pair)",
    )
    rf_role: WirelessRole | None = Field(
        None,
        description="* `ap` - Access point\n* `station` - Station",
        title="Wireless role",
    )


class PatchedWritablePowerOutletRequest(BaseModel):
    device: int | BriefDeviceRequest | None = None
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64) | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c5",
            "iec-60320-c7",
            "iec-60320-c13",
            "iec-60320-c15",
            "iec-60320-c19",
            "iec-60320-c21",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15r",
            "nema-5-15r",
            "nema-5-20r",
            "nema-5-30r",
            "nema-5-50r",
            "nema-6-15r",
            "nema-6-20r",
            "nema-6-30r",
            "nema-6-50r",
            "nema-10-30r",
            "nema-10-50r",
            "nema-14-20r",
            "nema-14-30r",
            "nema-14-50r",
            "nema-14-60r",
            "nema-15-15r",
            "nema-15-20r",
            "nema-15-30r",
            "nema-15-50r",
            "nema-15-60r",
            "nema-l1-15r",
            "nema-l5-15r",
            "nema-l5-20r",
            "nema-l5-30r",
            "nema-l5-50r",
            "nema-l6-15r",
            "nema-l6-20r",
            "nema-l6-30r",
            "nema-l6-50r",
            "nema-l10-30r",
            "nema-l14-20r",
            "nema-l14-30r",
            "nema-l14-50r",
            "nema-l14-60r",
            "nema-l15-20r",
            "nema-l15-30r",
            "nema-l15-50r",
            "nema-l15-60r",
            "nema-l21-20r",
            "nema-l21-30r",
            "nema-l22-20r",
            "nema-l22-30r",
            "CS6360C",
            "CS6364C",
            "CS8164C",
            "CS8264C",
            "CS8364C",
            "CS8464C",
            "ita-e",
            "ita-f",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "ita-multistandard",
            "usb-a",
            "usb-micro-b",
            "usb-c",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "eaton-c39",
            "hdot-cx",
            "saf-d-grid",
            "neutrik-powercon-20a",
            "neutrik-powercon-32a",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="Physical port type\n\n* `iec-60320-c5` - C5\n* `iec-60320-c7` - C7\n* `iec-60320-c13` - C13\n* `iec-60320-c15` - C15\n* `iec-60320-c19` - C19\n* `iec-60320-c21` - C21\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15r` - NEMA 1-15R\n* `nema-5-15r` - NEMA 5-15R\n* `nema-5-20r` - NEMA 5-20R\n* `nema-5-30r` - NEMA 5-30R\n* `nema-5-50r` - NEMA 5-50R\n* `nema-6-15r` - NEMA 6-15R\n* `nema-6-20r` - NEMA 6-20R\n* `nema-6-30r` - NEMA 6-30R\n* `nema-6-50r` - NEMA 6-50R\n* `nema-10-30r` - NEMA 10-30R\n* `nema-10-50r` - NEMA 10-50R\n* `nema-14-20r` - NEMA 14-20R\n* `nema-14-30r` - NEMA 14-30R\n* `nema-14-50r` - NEMA 14-50R\n* `nema-14-60r` - NEMA 14-60R\n* `nema-15-15r` - NEMA 15-15R\n* `nema-15-20r` - NEMA 15-20R\n* `nema-15-30r` - NEMA 15-30R\n* `nema-15-50r` - NEMA 15-50R\n* `nema-15-60r` - NEMA 15-60R\n* `nema-l1-15r` - NEMA L1-15R\n* `nema-l5-15r` - NEMA L5-15R\n* `nema-l5-20r` - NEMA L5-20R\n* `nema-l5-30r` - NEMA L5-30R\n* `nema-l5-50r` - NEMA L5-50R\n* `nema-l6-15r` - NEMA L6-15R\n* `nema-l6-20r` - NEMA L6-20R\n* `nema-l6-30r` - NEMA L6-30R\n* `nema-l6-50r` - NEMA L6-50R\n* `nema-l10-30r` - NEMA L10-30R\n* `nema-l14-20r` - NEMA L14-20R\n* `nema-l14-30r` - NEMA L14-30R\n* `nema-l14-50r` - NEMA L14-50R\n* `nema-l14-60r` - NEMA L14-60R\n* `nema-l15-20r` - NEMA L15-20R\n* `nema-l15-30r` - NEMA L15-30R\n* `nema-l15-50r` - NEMA L15-50R\n* `nema-l15-60r` - NEMA L15-60R\n* `nema-l21-20r` - NEMA L21-20R\n* `nema-l21-30r` - NEMA L21-30R\n* `nema-l22-20r` - NEMA L22-20R\n* `nema-l22-30r` - NEMA L22-30R\n* `CS6360C` - CS6360C\n* `CS6364C` - CS6364C\n* `CS8164C` - CS8164C\n* `CS8264C` - CS8264C\n* `CS8364C` - CS8364C\n* `CS8464C` - CS8464C\n* `ita-e` - ITA Type E (CEE 7/5)\n* `ita-f` - ITA Type F (CEE 7/3)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `ita-multistandard` - ITA Multistandard\n* `usb-a` - USB Type A\n* `usb-micro-b` - USB Micro B\n* `usb-c` - USB Type C\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `eaton-c39` - Eaton C39\n* `hdot-cx` - HDOT Cx\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20a` - Neutrik powerCON (20A)\n* `neutrik-powercon-32a` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    status: Literal["enabled", "disabled", "faulty"] | None = Field(
        None,
        description="* `enabled` - Enabled\n* `disabled` - Disabled\n* `faulty` - Faulty",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    power_port: int | BriefPowerPortRequest | None = None
    feed_leg: Literal["A", "B", "C", ""] | None = Field(
        None,
        description="Phase (for three-phase feeds)\n\n* `A` - A\n* `B` - B\n* `C` - C",
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritablePowerOutletTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) | None = Field(
        None,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c5",
            "iec-60320-c7",
            "iec-60320-c13",
            "iec-60320-c15",
            "iec-60320-c19",
            "iec-60320-c21",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15r",
            "nema-5-15r",
            "nema-5-20r",
            "nema-5-30r",
            "nema-5-50r",
            "nema-6-15r",
            "nema-6-20r",
            "nema-6-30r",
            "nema-6-50r",
            "nema-10-30r",
            "nema-10-50r",
            "nema-14-20r",
            "nema-14-30r",
            "nema-14-50r",
            "nema-14-60r",
            "nema-15-15r",
            "nema-15-20r",
            "nema-15-30r",
            "nema-15-50r",
            "nema-15-60r",
            "nema-l1-15r",
            "nema-l5-15r",
            "nema-l5-20r",
            "nema-l5-30r",
            "nema-l5-50r",
            "nema-l6-15r",
            "nema-l6-20r",
            "nema-l6-30r",
            "nema-l6-50r",
            "nema-l10-30r",
            "nema-l14-20r",
            "nema-l14-30r",
            "nema-l14-50r",
            "nema-l14-60r",
            "nema-l15-20r",
            "nema-l15-30r",
            "nema-l15-50r",
            "nema-l15-60r",
            "nema-l21-20r",
            "nema-l21-30r",
            "nema-l22-20r",
            "nema-l22-30r",
            "CS6360C",
            "CS6364C",
            "CS8164C",
            "CS8264C",
            "CS8364C",
            "CS8464C",
            "ita-e",
            "ita-f",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "ita-multistandard",
            "usb-a",
            "usb-micro-b",
            "usb-c",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "eaton-c39",
            "hdot-cx",
            "saf-d-grid",
            "neutrik-powercon-20a",
            "neutrik-powercon-32a",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `iec-60320-c5` - C5\n* `iec-60320-c7` - C7\n* `iec-60320-c13` - C13\n* `iec-60320-c15` - C15\n* `iec-60320-c19` - C19\n* `iec-60320-c21` - C21\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15r` - NEMA 1-15R\n* `nema-5-15r` - NEMA 5-15R\n* `nema-5-20r` - NEMA 5-20R\n* `nema-5-30r` - NEMA 5-30R\n* `nema-5-50r` - NEMA 5-50R\n* `nema-6-15r` - NEMA 6-15R\n* `nema-6-20r` - NEMA 6-20R\n* `nema-6-30r` - NEMA 6-30R\n* `nema-6-50r` - NEMA 6-50R\n* `nema-10-30r` - NEMA 10-30R\n* `nema-10-50r` - NEMA 10-50R\n* `nema-14-20r` - NEMA 14-20R\n* `nema-14-30r` - NEMA 14-30R\n* `nema-14-50r` - NEMA 14-50R\n* `nema-14-60r` - NEMA 14-60R\n* `nema-15-15r` - NEMA 15-15R\n* `nema-15-20r` - NEMA 15-20R\n* `nema-15-30r` - NEMA 15-30R\n* `nema-15-50r` - NEMA 15-50R\n* `nema-15-60r` - NEMA 15-60R\n* `nema-l1-15r` - NEMA L1-15R\n* `nema-l5-15r` - NEMA L5-15R\n* `nema-l5-20r` - NEMA L5-20R\n* `nema-l5-30r` - NEMA L5-30R\n* `nema-l5-50r` - NEMA L5-50R\n* `nema-l6-15r` - NEMA L6-15R\n* `nema-l6-20r` - NEMA L6-20R\n* `nema-l6-30r` - NEMA L6-30R\n* `nema-l6-50r` - NEMA L6-50R\n* `nema-l10-30r` - NEMA L10-30R\n* `nema-l14-20r` - NEMA L14-20R\n* `nema-l14-30r` - NEMA L14-30R\n* `nema-l14-50r` - NEMA L14-50R\n* `nema-l14-60r` - NEMA L14-60R\n* `nema-l15-20r` - NEMA L15-20R\n* `nema-l15-30r` - NEMA L15-30R\n* `nema-l15-50r` - NEMA L15-50R\n* `nema-l15-60r` - NEMA L15-60R\n* `nema-l21-20r` - NEMA L21-20R\n* `nema-l21-30r` - NEMA L21-30R\n* `nema-l22-20r` - NEMA L22-20R\n* `nema-l22-30r` - NEMA L22-30R\n* `CS6360C` - CS6360C\n* `CS6364C` - CS6364C\n* `CS8164C` - CS8164C\n* `CS8264C` - CS8264C\n* `CS8364C` - CS8364C\n* `CS8464C` - CS8464C\n* `ita-e` - ITA Type E (CEE 7/5)\n* `ita-f` - ITA Type F (CEE 7/3)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `ita-multistandard` - ITA Multistandard\n* `usb-a` - USB Type A\n* `usb-micro-b` - USB Micro B\n* `usb-c` - USB Type C\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `eaton-c39` - Eaton C39\n* `hdot-cx` - HDOT Cx\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20a` - Neutrik powerCON (20A)\n* `neutrik-powercon-32a` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    power_port: int | BriefPowerPortTemplateRequest | None = None
    feed_leg: Literal["A", "B", "C", ""] | None = Field(
        None,
        description="Phase (for three-phase feeds)\n\n* `A` - A\n* `B` - B\n* `C` - C",
    )
    description: constr(max_length=200) | None = None


class PatchedWritablePowerPortRequest(BaseModel):
    device: int | BriefDeviceRequest | None = None
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64) | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c6",
            "iec-60320-c8",
            "iec-60320-c14",
            "iec-60320-c16",
            "iec-60320-c20",
            "iec-60320-c22",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15p",
            "nema-5-15p",
            "nema-5-20p",
            "nema-5-30p",
            "nema-5-50p",
            "nema-6-15p",
            "nema-6-20p",
            "nema-6-30p",
            "nema-6-50p",
            "nema-10-30p",
            "nema-10-50p",
            "nema-14-20p",
            "nema-14-30p",
            "nema-14-50p",
            "nema-14-60p",
            "nema-15-15p",
            "nema-15-20p",
            "nema-15-30p",
            "nema-15-50p",
            "nema-15-60p",
            "nema-l1-15p",
            "nema-l5-15p",
            "nema-l5-20p",
            "nema-l5-30p",
            "nema-l5-50p",
            "nema-l6-15p",
            "nema-l6-20p",
            "nema-l6-30p",
            "nema-l6-50p",
            "nema-l10-30p",
            "nema-l14-20p",
            "nema-l14-30p",
            "nema-l14-50p",
            "nema-l14-60p",
            "nema-l15-20p",
            "nema-l15-30p",
            "nema-l15-50p",
            "nema-l15-60p",
            "nema-l21-20p",
            "nema-l21-30p",
            "nema-l22-20p",
            "nema-l22-30p",
            "cs6361c",
            "cs6365c",
            "cs8165c",
            "cs8265c",
            "cs8365c",
            "cs8465c",
            "ita-c",
            "ita-e",
            "ita-f",
            "ita-ef",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "usb-3-b",
            "usb-3-micro-b",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "saf-d-grid",
            "neutrik-powercon-20",
            "neutrik-powercon-32",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="Physical port type\n\n* `iec-60320-c6` - C6\n* `iec-60320-c8` - C8\n* `iec-60320-c14` - C14\n* `iec-60320-c16` - C16\n* `iec-60320-c20` - C20\n* `iec-60320-c22` - C22\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15p` - NEMA 1-15P\n* `nema-5-15p` - NEMA 5-15P\n* `nema-5-20p` - NEMA 5-20P\n* `nema-5-30p` - NEMA 5-30P\n* `nema-5-50p` - NEMA 5-50P\n* `nema-6-15p` - NEMA 6-15P\n* `nema-6-20p` - NEMA 6-20P\n* `nema-6-30p` - NEMA 6-30P\n* `nema-6-50p` - NEMA 6-50P\n* `nema-10-30p` - NEMA 10-30P\n* `nema-10-50p` - NEMA 10-50P\n* `nema-14-20p` - NEMA 14-20P\n* `nema-14-30p` - NEMA 14-30P\n* `nema-14-50p` - NEMA 14-50P\n* `nema-14-60p` - NEMA 14-60P\n* `nema-15-15p` - NEMA 15-15P\n* `nema-15-20p` - NEMA 15-20P\n* `nema-15-30p` - NEMA 15-30P\n* `nema-15-50p` - NEMA 15-50P\n* `nema-15-60p` - NEMA 15-60P\n* `nema-l1-15p` - NEMA L1-15P\n* `nema-l5-15p` - NEMA L5-15P\n* `nema-l5-20p` - NEMA L5-20P\n* `nema-l5-30p` - NEMA L5-30P\n* `nema-l5-50p` - NEMA L5-50P\n* `nema-l6-15p` - NEMA L6-15P\n* `nema-l6-20p` - NEMA L6-20P\n* `nema-l6-30p` - NEMA L6-30P\n* `nema-l6-50p` - NEMA L6-50P\n* `nema-l10-30p` - NEMA L10-30P\n* `nema-l14-20p` - NEMA L14-20P\n* `nema-l14-30p` - NEMA L14-30P\n* `nema-l14-50p` - NEMA L14-50P\n* `nema-l14-60p` - NEMA L14-60P\n* `nema-l15-20p` - NEMA L15-20P\n* `nema-l15-30p` - NEMA L15-30P\n* `nema-l15-50p` - NEMA L15-50P\n* `nema-l15-60p` - NEMA L15-60P\n* `nema-l21-20p` - NEMA L21-20P\n* `nema-l21-30p` - NEMA L21-30P\n* `nema-l22-20p` - NEMA L22-20P\n* `nema-l22-30p` - NEMA L22-30P\n* `cs6361c` - CS6361C\n* `cs6365c` - CS6365C\n* `cs8165c` - CS8165C\n* `cs8265c` - CS8265C\n* `cs8365c` - CS8365C\n* `cs8465c` - CS8465C\n* `ita-c` - ITA Type C (CEE 7/16)\n* `ita-e` - ITA Type E (CEE 7/6)\n* `ita-f` - ITA Type F (CEE 7/4)\n* `ita-ef` - ITA Type E/F (CEE 7/7)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `usb-3-b` - USB 3.0 Type B\n* `usb-3-micro-b` - USB 3.0 Micro B\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20` - Neutrik powerCON (20A)\n* `neutrik-powercon-32` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    maximum_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Maximum power draw (watts)"
    )
    allocated_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Allocated power draw (watts)"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritablePowerPortTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) | None = Field(
        None,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c6",
            "iec-60320-c8",
            "iec-60320-c14",
            "iec-60320-c16",
            "iec-60320-c20",
            "iec-60320-c22",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15p",
            "nema-5-15p",
            "nema-5-20p",
            "nema-5-30p",
            "nema-5-50p",
            "nema-6-15p",
            "nema-6-20p",
            "nema-6-30p",
            "nema-6-50p",
            "nema-10-30p",
            "nema-10-50p",
            "nema-14-20p",
            "nema-14-30p",
            "nema-14-50p",
            "nema-14-60p",
            "nema-15-15p",
            "nema-15-20p",
            "nema-15-30p",
            "nema-15-50p",
            "nema-15-60p",
            "nema-l1-15p",
            "nema-l5-15p",
            "nema-l5-20p",
            "nema-l5-30p",
            "nema-l5-50p",
            "nema-l6-15p",
            "nema-l6-20p",
            "nema-l6-30p",
            "nema-l6-50p",
            "nema-l10-30p",
            "nema-l14-20p",
            "nema-l14-30p",
            "nema-l14-50p",
            "nema-l14-60p",
            "nema-l15-20p",
            "nema-l15-30p",
            "nema-l15-50p",
            "nema-l15-60p",
            "nema-l21-20p",
            "nema-l21-30p",
            "nema-l22-20p",
            "nema-l22-30p",
            "cs6361c",
            "cs6365c",
            "cs8165c",
            "cs8265c",
            "cs8365c",
            "cs8465c",
            "ita-c",
            "ita-e",
            "ita-f",
            "ita-ef",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "usb-3-b",
            "usb-3-micro-b",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "saf-d-grid",
            "neutrik-powercon-20",
            "neutrik-powercon-32",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `iec-60320-c6` - C6\n* `iec-60320-c8` - C8\n* `iec-60320-c14` - C14\n* `iec-60320-c16` - C16\n* `iec-60320-c20` - C20\n* `iec-60320-c22` - C22\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15p` - NEMA 1-15P\n* `nema-5-15p` - NEMA 5-15P\n* `nema-5-20p` - NEMA 5-20P\n* `nema-5-30p` - NEMA 5-30P\n* `nema-5-50p` - NEMA 5-50P\n* `nema-6-15p` - NEMA 6-15P\n* `nema-6-20p` - NEMA 6-20P\n* `nema-6-30p` - NEMA 6-30P\n* `nema-6-50p` - NEMA 6-50P\n* `nema-10-30p` - NEMA 10-30P\n* `nema-10-50p` - NEMA 10-50P\n* `nema-14-20p` - NEMA 14-20P\n* `nema-14-30p` - NEMA 14-30P\n* `nema-14-50p` - NEMA 14-50P\n* `nema-14-60p` - NEMA 14-60P\n* `nema-15-15p` - NEMA 15-15P\n* `nema-15-20p` - NEMA 15-20P\n* `nema-15-30p` - NEMA 15-30P\n* `nema-15-50p` - NEMA 15-50P\n* `nema-15-60p` - NEMA 15-60P\n* `nema-l1-15p` - NEMA L1-15P\n* `nema-l5-15p` - NEMA L5-15P\n* `nema-l5-20p` - NEMA L5-20P\n* `nema-l5-30p` - NEMA L5-30P\n* `nema-l5-50p` - NEMA L5-50P\n* `nema-l6-15p` - NEMA L6-15P\n* `nema-l6-20p` - NEMA L6-20P\n* `nema-l6-30p` - NEMA L6-30P\n* `nema-l6-50p` - NEMA L6-50P\n* `nema-l10-30p` - NEMA L10-30P\n* `nema-l14-20p` - NEMA L14-20P\n* `nema-l14-30p` - NEMA L14-30P\n* `nema-l14-50p` - NEMA L14-50P\n* `nema-l14-60p` - NEMA L14-60P\n* `nema-l15-20p` - NEMA L15-20P\n* `nema-l15-30p` - NEMA L15-30P\n* `nema-l15-50p` - NEMA L15-50P\n* `nema-l15-60p` - NEMA L15-60P\n* `nema-l21-20p` - NEMA L21-20P\n* `nema-l21-30p` - NEMA L21-30P\n* `nema-l22-20p` - NEMA L22-20P\n* `nema-l22-30p` - NEMA L22-30P\n* `cs6361c` - CS6361C\n* `cs6365c` - CS6365C\n* `cs8165c` - CS8165C\n* `cs8265c` - CS8265C\n* `cs8365c` - CS8365C\n* `cs8465c` - CS8465C\n* `ita-c` - ITA Type C (CEE 7/16)\n* `ita-e` - ITA Type E (CEE 7/6)\n* `ita-f` - ITA Type F (CEE 7/4)\n* `ita-ef` - ITA Type E/F (CEE 7/7)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `usb-3-b` - USB 3.0 Type B\n* `usb-3-micro-b` - USB 3.0 Micro B\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20` - Neutrik powerCON (20A)\n* `neutrik-powercon-32` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    maximum_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Maximum power draw (watts)"
    )
    allocated_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Allocated power draw (watts)"
    )
    description: constr(max_length=200) | None = None


class PatchedWritableRearPortRequest(BaseModel):
    device: int | BriefDeviceRequest | None = None
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64) | None = None
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "8p8c",
            "8p6c",
            "8p4c",
            "8p2c",
            "6p6c",
            "6p4c",
            "6p2c",
            "4p4c",
            "4p2c",
            "gg45",
            "tera-4p",
            "tera-2p",
            "tera-1p",
            "110-punch",
            "bnc",
            "f",
            "n",
            "mrj21",
            "fc",
            "fc-pc",
            "fc-upc",
            "fc-apc",
            "lc",
            "lc-pc",
            "lc-upc",
            "lc-apc",
            "lsh",
            "lsh-pc",
            "lsh-upc",
            "lsh-apc",
            "lx5",
            "lx5-pc",
            "lx5-upc",
            "lx5-apc",
            "mpo",
            "mtrj",
            "sc",
            "sc-pc",
            "sc-upc",
            "sc-apc",
            "st",
            "cs",
            "sn",
            "sma-905",
            "sma-906",
            "urm-p2",
            "urm-p4",
            "urm-p8",
            "splice",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
        ]
        | None
    ) = Field(
        None,
        description="* `8p8c` - 8P8C\n* `8p6c` - 8P6C\n* `8p4c` - 8P4C\n* `8p2c` - 8P2C\n* `6p6c` - 6P6C\n* `6p4c` - 6P4C\n* `6p2c` - 6P2C\n* `4p4c` - 4P4C\n* `4p2c` - 4P2C\n* `gg45` - GG45\n* `tera-4p` - TERA 4P\n* `tera-2p` - TERA 2P\n* `tera-1p` - TERA 1P\n* `110-punch` - 110 Punch\n* `bnc` - BNC\n* `f` - F Connector\n* `n` - N Connector\n* `mrj21` - MRJ21\n* `fc` - FC\n* `fc-pc` - FC/PC\n* `fc-upc` - FC/UPC\n* `fc-apc` - FC/APC\n* `lc` - LC\n* `lc-pc` - LC/PC\n* `lc-upc` - LC/UPC\n* `lc-apc` - LC/APC\n* `lsh` - LSH\n* `lsh-pc` - LSH/PC\n* `lsh-upc` - LSH/UPC\n* `lsh-apc` - LSH/APC\n* `lx5` - LX.5\n* `lx5-pc` - LX.5/PC\n* `lx5-upc` - LX.5/UPC\n* `lx5-apc` - LX.5/APC\n* `mpo` - MPO\n* `mtrj` - MTRJ\n* `sc` - SC\n* `sc-pc` - SC/PC\n* `sc-upc` - SC/UPC\n* `sc-apc` - SC/APC\n* `st` - ST\n* `cs` - CS\n* `sn` - SN\n* `sma-905` - SMA 905\n* `sma-906` - SMA 906\n* `urm-p2` - URM-P2\n* `urm-p4` - URM-P4\n* `urm-p8` - URM-P8\n* `splice` - Splice\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    positions: conint(ge=1, le=1024) | None = Field(
        None, description="Number of front ports which may be mapped"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PatchedWritableRearPortTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) | None = Field(
        None,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "8p8c",
            "8p6c",
            "8p4c",
            "8p2c",
            "6p6c",
            "6p4c",
            "6p2c",
            "4p4c",
            "4p2c",
            "gg45",
            "tera-4p",
            "tera-2p",
            "tera-1p",
            "110-punch",
            "bnc",
            "f",
            "n",
            "mrj21",
            "fc",
            "fc-pc",
            "fc-upc",
            "fc-apc",
            "lc",
            "lc-pc",
            "lc-upc",
            "lc-apc",
            "lsh",
            "lsh-pc",
            "lsh-upc",
            "lsh-apc",
            "lx5",
            "lx5-pc",
            "lx5-upc",
            "lx5-apc",
            "mpo",
            "mtrj",
            "sc",
            "sc-pc",
            "sc-upc",
            "sc-apc",
            "st",
            "cs",
            "sn",
            "sma-905",
            "sma-906",
            "urm-p2",
            "urm-p4",
            "urm-p8",
            "splice",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
        ]
        | None
    ) = Field(
        None,
        description="* `8p8c` - 8P8C\n* `8p6c` - 8P6C\n* `8p4c` - 8P4C\n* `8p2c` - 8P2C\n* `6p6c` - 6P6C\n* `6p4c` - 6P4C\n* `6p2c` - 6P2C\n* `4p4c` - 4P4C\n* `4p2c` - 4P2C\n* `gg45` - GG45\n* `tera-4p` - TERA 4P\n* `tera-2p` - TERA 2P\n* `tera-1p` - TERA 1P\n* `110-punch` - 110 Punch\n* `bnc` - BNC\n* `f` - F Connector\n* `n` - N Connector\n* `mrj21` - MRJ21\n* `fc` - FC\n* `fc-pc` - FC/PC\n* `fc-upc` - FC/UPC\n* `fc-apc` - FC/APC\n* `lc` - LC\n* `lc-pc` - LC/PC\n* `lc-upc` - LC/UPC\n* `lc-apc` - LC/APC\n* `lsh` - LSH\n* `lsh-pc` - LSH/PC\n* `lsh-upc` - LSH/UPC\n* `lsh-apc` - LSH/APC\n* `lx5` - LX.5\n* `lx5-pc` - LX.5/PC\n* `lx5-upc` - LX.5/UPC\n* `lx5-apc` - LX.5/APC\n* `mpo` - MPO\n* `mtrj` - MTRJ\n* `sc` - SC\n* `sc-pc` - SC/PC\n* `sc-upc` - SC/UPC\n* `sc-apc` - SC/APC\n* `st` - ST\n* `cs` - CS\n* `sn` - SN\n* `sma-905` - SMA 905\n* `sma-906` - SMA 906\n* `urm-p2` - URM-P2\n* `urm-p4` - URM-P4\n* `urm-p8` - URM-P8\n* `splice` - Splice\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    positions: conint(ge=1, le=1024) | None = None
    description: constr(max_length=200) | None = None


class PowerOutlet(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: BriefDevice
    module: BriefModule | None = None
    name: constr(max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type13 | None = None
    status: Status15 | None = None
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    power_port: BriefPowerPort | None = None
    feed_leg: FeedLeg | None = None
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    cable: BriefCable | None = None
    cable_end: str | None = None
    link_peers: list[Any]
    link_peers_type: str | None = Field(
        None, description="Return the type of the peer link terminations, or None."
    )
    connected_endpoints: list[Any] | None = None
    connected_endpoints_type: str | None = None
    connected_endpoints_reachable: bool
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    field_occupied: FieldOccupied = Field(..., alias="_occupied", title=" occupied")


class PowerOutletRequest(BaseModel):
    device: int | BriefDeviceRequest
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c5",
            "iec-60320-c7",
            "iec-60320-c13",
            "iec-60320-c15",
            "iec-60320-c19",
            "iec-60320-c21",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15r",
            "nema-5-15r",
            "nema-5-20r",
            "nema-5-30r",
            "nema-5-50r",
            "nema-6-15r",
            "nema-6-20r",
            "nema-6-30r",
            "nema-6-50r",
            "nema-10-30r",
            "nema-10-50r",
            "nema-14-20r",
            "nema-14-30r",
            "nema-14-50r",
            "nema-14-60r",
            "nema-15-15r",
            "nema-15-20r",
            "nema-15-30r",
            "nema-15-50r",
            "nema-15-60r",
            "nema-l1-15r",
            "nema-l5-15r",
            "nema-l5-20r",
            "nema-l5-30r",
            "nema-l5-50r",
            "nema-l6-15r",
            "nema-l6-20r",
            "nema-l6-30r",
            "nema-l6-50r",
            "nema-l10-30r",
            "nema-l14-20r",
            "nema-l14-30r",
            "nema-l14-50r",
            "nema-l14-60r",
            "nema-l15-20r",
            "nema-l15-30r",
            "nema-l15-50r",
            "nema-l15-60r",
            "nema-l21-20r",
            "nema-l21-30r",
            "nema-l22-20r",
            "nema-l22-30r",
            "CS6360C",
            "CS6364C",
            "CS8164C",
            "CS8264C",
            "CS8364C",
            "CS8464C",
            "ita-e",
            "ita-f",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "ita-multistandard",
            "usb-a",
            "usb-micro-b",
            "usb-c",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "eaton-c39",
            "hdot-cx",
            "saf-d-grid",
            "neutrik-powercon-20a",
            "neutrik-powercon-32a",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `iec-60320-c5` - C5\n* `iec-60320-c7` - C7\n* `iec-60320-c13` - C13\n* `iec-60320-c15` - C15\n* `iec-60320-c19` - C19\n* `iec-60320-c21` - C21\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15r` - NEMA 1-15R\n* `nema-5-15r` - NEMA 5-15R\n* `nema-5-20r` - NEMA 5-20R\n* `nema-5-30r` - NEMA 5-30R\n* `nema-5-50r` - NEMA 5-50R\n* `nema-6-15r` - NEMA 6-15R\n* `nema-6-20r` - NEMA 6-20R\n* `nema-6-30r` - NEMA 6-30R\n* `nema-6-50r` - NEMA 6-50R\n* `nema-10-30r` - NEMA 10-30R\n* `nema-10-50r` - NEMA 10-50R\n* `nema-14-20r` - NEMA 14-20R\n* `nema-14-30r` - NEMA 14-30R\n* `nema-14-50r` - NEMA 14-50R\n* `nema-14-60r` - NEMA 14-60R\n* `nema-15-15r` - NEMA 15-15R\n* `nema-15-20r` - NEMA 15-20R\n* `nema-15-30r` - NEMA 15-30R\n* `nema-15-50r` - NEMA 15-50R\n* `nema-15-60r` - NEMA 15-60R\n* `nema-l1-15r` - NEMA L1-15R\n* `nema-l5-15r` - NEMA L5-15R\n* `nema-l5-20r` - NEMA L5-20R\n* `nema-l5-30r` - NEMA L5-30R\n* `nema-l5-50r` - NEMA L5-50R\n* `nema-l6-15r` - NEMA L6-15R\n* `nema-l6-20r` - NEMA L6-20R\n* `nema-l6-30r` - NEMA L6-30R\n* `nema-l6-50r` - NEMA L6-50R\n* `nema-l10-30r` - NEMA L10-30R\n* `nema-l14-20r` - NEMA L14-20R\n* `nema-l14-30r` - NEMA L14-30R\n* `nema-l14-50r` - NEMA L14-50R\n* `nema-l14-60r` - NEMA L14-60R\n* `nema-l15-20r` - NEMA L15-20R\n* `nema-l15-30r` - NEMA L15-30R\n* `nema-l15-50r` - NEMA L15-50R\n* `nema-l15-60r` - NEMA L15-60R\n* `nema-l21-20r` - NEMA L21-20R\n* `nema-l21-30r` - NEMA L21-30R\n* `nema-l22-20r` - NEMA L22-20R\n* `nema-l22-30r` - NEMA L22-30R\n* `CS6360C` - CS6360C\n* `CS6364C` - CS6364C\n* `CS8164C` - CS8164C\n* `CS8264C` - CS8264C\n* `CS8364C` - CS8364C\n* `CS8464C` - CS8464C\n* `ita-e` - ITA Type E (CEE 7/5)\n* `ita-f` - ITA Type F (CEE 7/3)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `ita-multistandard` - ITA Multistandard\n* `usb-a` - USB Type A\n* `usb-micro-b` - USB Micro B\n* `usb-c` - USB Type C\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `eaton-c39` - Eaton C39\n* `hdot-cx` - HDOT Cx\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20a` - Neutrik powerCON (20A)\n* `neutrik-powercon-32a` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    status: Literal["enabled", "disabled", "faulty"] | None = Field(
        None,
        description="* `enabled` - Enabled\n* `disabled` - Disabled\n* `faulty` - Faulty",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    power_port: int | BriefPowerPortRequest | None = None
    feed_leg: Literal["A", "B", "C", ""] | None = Field(
        None, description="* `A` - A\n* `B` - B\n* `C` - C"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PowerOutletTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device_type: BriefDeviceType | None = None
    module_type: BriefModuleType | None = None
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type13 | None = None
    power_port: BriefPowerPortTemplate | None = None
    feed_leg: FeedLeg | None = None
    description: constr(max_length=200) | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class PowerOutletTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c5",
            "iec-60320-c7",
            "iec-60320-c13",
            "iec-60320-c15",
            "iec-60320-c19",
            "iec-60320-c21",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15r",
            "nema-5-15r",
            "nema-5-20r",
            "nema-5-30r",
            "nema-5-50r",
            "nema-6-15r",
            "nema-6-20r",
            "nema-6-30r",
            "nema-6-50r",
            "nema-10-30r",
            "nema-10-50r",
            "nema-14-20r",
            "nema-14-30r",
            "nema-14-50r",
            "nema-14-60r",
            "nema-15-15r",
            "nema-15-20r",
            "nema-15-30r",
            "nema-15-50r",
            "nema-15-60r",
            "nema-l1-15r",
            "nema-l5-15r",
            "nema-l5-20r",
            "nema-l5-30r",
            "nema-l5-50r",
            "nema-l6-15r",
            "nema-l6-20r",
            "nema-l6-30r",
            "nema-l6-50r",
            "nema-l10-30r",
            "nema-l14-20r",
            "nema-l14-30r",
            "nema-l14-50r",
            "nema-l14-60r",
            "nema-l15-20r",
            "nema-l15-30r",
            "nema-l15-50r",
            "nema-l15-60r",
            "nema-l21-20r",
            "nema-l21-30r",
            "nema-l22-20r",
            "nema-l22-30r",
            "CS6360C",
            "CS6364C",
            "CS8164C",
            "CS8264C",
            "CS8364C",
            "CS8464C",
            "ita-e",
            "ita-f",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "ita-multistandard",
            "usb-a",
            "usb-micro-b",
            "usb-c",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "eaton-c39",
            "hdot-cx",
            "saf-d-grid",
            "neutrik-powercon-20a",
            "neutrik-powercon-32a",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `iec-60320-c5` - C5\n* `iec-60320-c7` - C7\n* `iec-60320-c13` - C13\n* `iec-60320-c15` - C15\n* `iec-60320-c19` - C19\n* `iec-60320-c21` - C21\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15r` - NEMA 1-15R\n* `nema-5-15r` - NEMA 5-15R\n* `nema-5-20r` - NEMA 5-20R\n* `nema-5-30r` - NEMA 5-30R\n* `nema-5-50r` - NEMA 5-50R\n* `nema-6-15r` - NEMA 6-15R\n* `nema-6-20r` - NEMA 6-20R\n* `nema-6-30r` - NEMA 6-30R\n* `nema-6-50r` - NEMA 6-50R\n* `nema-10-30r` - NEMA 10-30R\n* `nema-10-50r` - NEMA 10-50R\n* `nema-14-20r` - NEMA 14-20R\n* `nema-14-30r` - NEMA 14-30R\n* `nema-14-50r` - NEMA 14-50R\n* `nema-14-60r` - NEMA 14-60R\n* `nema-15-15r` - NEMA 15-15R\n* `nema-15-20r` - NEMA 15-20R\n* `nema-15-30r` - NEMA 15-30R\n* `nema-15-50r` - NEMA 15-50R\n* `nema-15-60r` - NEMA 15-60R\n* `nema-l1-15r` - NEMA L1-15R\n* `nema-l5-15r` - NEMA L5-15R\n* `nema-l5-20r` - NEMA L5-20R\n* `nema-l5-30r` - NEMA L5-30R\n* `nema-l5-50r` - NEMA L5-50R\n* `nema-l6-15r` - NEMA L6-15R\n* `nema-l6-20r` - NEMA L6-20R\n* `nema-l6-30r` - NEMA L6-30R\n* `nema-l6-50r` - NEMA L6-50R\n* `nema-l10-30r` - NEMA L10-30R\n* `nema-l14-20r` - NEMA L14-20R\n* `nema-l14-30r` - NEMA L14-30R\n* `nema-l14-50r` - NEMA L14-50R\n* `nema-l14-60r` - NEMA L14-60R\n* `nema-l15-20r` - NEMA L15-20R\n* `nema-l15-30r` - NEMA L15-30R\n* `nema-l15-50r` - NEMA L15-50R\n* `nema-l15-60r` - NEMA L15-60R\n* `nema-l21-20r` - NEMA L21-20R\n* `nema-l21-30r` - NEMA L21-30R\n* `nema-l22-20r` - NEMA L22-20R\n* `nema-l22-30r` - NEMA L22-30R\n* `CS6360C` - CS6360C\n* `CS6364C` - CS6364C\n* `CS8164C` - CS8164C\n* `CS8264C` - CS8264C\n* `CS8364C` - CS8364C\n* `CS8464C` - CS8464C\n* `ita-e` - ITA Type E (CEE 7/5)\n* `ita-f` - ITA Type F (CEE 7/3)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `ita-multistandard` - ITA Multistandard\n* `usb-a` - USB Type A\n* `usb-micro-b` - USB Micro B\n* `usb-c` - USB Type C\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `eaton-c39` - Eaton C39\n* `hdot-cx` - HDOT Cx\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20a` - Neutrik powerCON (20A)\n* `neutrik-powercon-32a` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    power_port: int | BriefPowerPortTemplateRequest | None = None
    feed_leg: Literal["A", "B", "C", ""] | None = Field(
        None, description="* `A` - A\n* `B` - B\n* `C` - C"
    )
    description: constr(max_length=200) | None = None


class PowerPort(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: BriefDevice
    module: BriefModule | None = None
    name: constr(max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type15 | None = None
    maximum_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Maximum power draw (watts)"
    )
    allocated_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Allocated power draw (watts)"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    cable: BriefCable | None = None
    cable_end: str | None = None
    link_peers: list[Any]
    link_peers_type: str | None = Field(
        None, description="Return the type of the peer link terminations, or None."
    )
    connected_endpoints: list[Any] | None = None
    connected_endpoints_type: str | None = None
    connected_endpoints_reachable: bool
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    field_occupied: FieldOccupied = Field(..., alias="_occupied", title=" occupied")


class PowerPortRequest(BaseModel):
    device: int | BriefDeviceRequest
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c6",
            "iec-60320-c8",
            "iec-60320-c14",
            "iec-60320-c16",
            "iec-60320-c20",
            "iec-60320-c22",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15p",
            "nema-5-15p",
            "nema-5-20p",
            "nema-5-30p",
            "nema-5-50p",
            "nema-6-15p",
            "nema-6-20p",
            "nema-6-30p",
            "nema-6-50p",
            "nema-10-30p",
            "nema-10-50p",
            "nema-14-20p",
            "nema-14-30p",
            "nema-14-50p",
            "nema-14-60p",
            "nema-15-15p",
            "nema-15-20p",
            "nema-15-30p",
            "nema-15-50p",
            "nema-15-60p",
            "nema-l1-15p",
            "nema-l5-15p",
            "nema-l5-20p",
            "nema-l5-30p",
            "nema-l5-50p",
            "nema-l6-15p",
            "nema-l6-20p",
            "nema-l6-30p",
            "nema-l6-50p",
            "nema-l10-30p",
            "nema-l14-20p",
            "nema-l14-30p",
            "nema-l14-50p",
            "nema-l14-60p",
            "nema-l15-20p",
            "nema-l15-30p",
            "nema-l15-50p",
            "nema-l15-60p",
            "nema-l21-20p",
            "nema-l21-30p",
            "nema-l22-20p",
            "nema-l22-30p",
            "cs6361c",
            "cs6365c",
            "cs8165c",
            "cs8265c",
            "cs8365c",
            "cs8465c",
            "ita-c",
            "ita-e",
            "ita-f",
            "ita-ef",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "usb-3-b",
            "usb-3-micro-b",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "saf-d-grid",
            "neutrik-powercon-20",
            "neutrik-powercon-32",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `iec-60320-c6` - C6\n* `iec-60320-c8` - C8\n* `iec-60320-c14` - C14\n* `iec-60320-c16` - C16\n* `iec-60320-c20` - C20\n* `iec-60320-c22` - C22\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15p` - NEMA 1-15P\n* `nema-5-15p` - NEMA 5-15P\n* `nema-5-20p` - NEMA 5-20P\n* `nema-5-30p` - NEMA 5-30P\n* `nema-5-50p` - NEMA 5-50P\n* `nema-6-15p` - NEMA 6-15P\n* `nema-6-20p` - NEMA 6-20P\n* `nema-6-30p` - NEMA 6-30P\n* `nema-6-50p` - NEMA 6-50P\n* `nema-10-30p` - NEMA 10-30P\n* `nema-10-50p` - NEMA 10-50P\n* `nema-14-20p` - NEMA 14-20P\n* `nema-14-30p` - NEMA 14-30P\n* `nema-14-50p` - NEMA 14-50P\n* `nema-14-60p` - NEMA 14-60P\n* `nema-15-15p` - NEMA 15-15P\n* `nema-15-20p` - NEMA 15-20P\n* `nema-15-30p` - NEMA 15-30P\n* `nema-15-50p` - NEMA 15-50P\n* `nema-15-60p` - NEMA 15-60P\n* `nema-l1-15p` - NEMA L1-15P\n* `nema-l5-15p` - NEMA L5-15P\n* `nema-l5-20p` - NEMA L5-20P\n* `nema-l5-30p` - NEMA L5-30P\n* `nema-l5-50p` - NEMA L5-50P\n* `nema-l6-15p` - NEMA L6-15P\n* `nema-l6-20p` - NEMA L6-20P\n* `nema-l6-30p` - NEMA L6-30P\n* `nema-l6-50p` - NEMA L6-50P\n* `nema-l10-30p` - NEMA L10-30P\n* `nema-l14-20p` - NEMA L14-20P\n* `nema-l14-30p` - NEMA L14-30P\n* `nema-l14-50p` - NEMA L14-50P\n* `nema-l14-60p` - NEMA L14-60P\n* `nema-l15-20p` - NEMA L15-20P\n* `nema-l15-30p` - NEMA L15-30P\n* `nema-l15-50p` - NEMA L15-50P\n* `nema-l15-60p` - NEMA L15-60P\n* `nema-l21-20p` - NEMA L21-20P\n* `nema-l21-30p` - NEMA L21-30P\n* `nema-l22-20p` - NEMA L22-20P\n* `nema-l22-30p` - NEMA L22-30P\n* `cs6361c` - CS6361C\n* `cs6365c` - CS6365C\n* `cs8165c` - CS8165C\n* `cs8265c` - CS8265C\n* `cs8365c` - CS8365C\n* `cs8465c` - CS8465C\n* `ita-c` - ITA Type C (CEE 7/16)\n* `ita-e` - ITA Type E (CEE 7/6)\n* `ita-f` - ITA Type F (CEE 7/4)\n* `ita-ef` - ITA Type E/F (CEE 7/7)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `usb-3-b` - USB 3.0 Type B\n* `usb-3-micro-b` - USB 3.0 Micro B\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20` - Neutrik powerCON (20A)\n* `neutrik-powercon-32` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    maximum_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Maximum power draw (watts)"
    )
    allocated_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Allocated power draw (watts)"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class PowerPortTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device_type: BriefDeviceType | None = None
    module_type: BriefModuleType | None = None
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type15 | None = None
    maximum_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Maximum power draw (watts)"
    )
    allocated_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Allocated power draw (watts)"
    )
    description: constr(max_length=200) | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class PowerPortTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c6",
            "iec-60320-c8",
            "iec-60320-c14",
            "iec-60320-c16",
            "iec-60320-c20",
            "iec-60320-c22",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15p",
            "nema-5-15p",
            "nema-5-20p",
            "nema-5-30p",
            "nema-5-50p",
            "nema-6-15p",
            "nema-6-20p",
            "nema-6-30p",
            "nema-6-50p",
            "nema-10-30p",
            "nema-10-50p",
            "nema-14-20p",
            "nema-14-30p",
            "nema-14-50p",
            "nema-14-60p",
            "nema-15-15p",
            "nema-15-20p",
            "nema-15-30p",
            "nema-15-50p",
            "nema-15-60p",
            "nema-l1-15p",
            "nema-l5-15p",
            "nema-l5-20p",
            "nema-l5-30p",
            "nema-l5-50p",
            "nema-l6-15p",
            "nema-l6-20p",
            "nema-l6-30p",
            "nema-l6-50p",
            "nema-l10-30p",
            "nema-l14-20p",
            "nema-l14-30p",
            "nema-l14-50p",
            "nema-l14-60p",
            "nema-l15-20p",
            "nema-l15-30p",
            "nema-l15-50p",
            "nema-l15-60p",
            "nema-l21-20p",
            "nema-l21-30p",
            "nema-l22-20p",
            "nema-l22-30p",
            "cs6361c",
            "cs6365c",
            "cs8165c",
            "cs8265c",
            "cs8365c",
            "cs8465c",
            "ita-c",
            "ita-e",
            "ita-f",
            "ita-ef",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "usb-3-b",
            "usb-3-micro-b",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "saf-d-grid",
            "neutrik-powercon-20",
            "neutrik-powercon-32",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `iec-60320-c6` - C6\n* `iec-60320-c8` - C8\n* `iec-60320-c14` - C14\n* `iec-60320-c16` - C16\n* `iec-60320-c20` - C20\n* `iec-60320-c22` - C22\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15p` - NEMA 1-15P\n* `nema-5-15p` - NEMA 5-15P\n* `nema-5-20p` - NEMA 5-20P\n* `nema-5-30p` - NEMA 5-30P\n* `nema-5-50p` - NEMA 5-50P\n* `nema-6-15p` - NEMA 6-15P\n* `nema-6-20p` - NEMA 6-20P\n* `nema-6-30p` - NEMA 6-30P\n* `nema-6-50p` - NEMA 6-50P\n* `nema-10-30p` - NEMA 10-30P\n* `nema-10-50p` - NEMA 10-50P\n* `nema-14-20p` - NEMA 14-20P\n* `nema-14-30p` - NEMA 14-30P\n* `nema-14-50p` - NEMA 14-50P\n* `nema-14-60p` - NEMA 14-60P\n* `nema-15-15p` - NEMA 15-15P\n* `nema-15-20p` - NEMA 15-20P\n* `nema-15-30p` - NEMA 15-30P\n* `nema-15-50p` - NEMA 15-50P\n* `nema-15-60p` - NEMA 15-60P\n* `nema-l1-15p` - NEMA L1-15P\n* `nema-l5-15p` - NEMA L5-15P\n* `nema-l5-20p` - NEMA L5-20P\n* `nema-l5-30p` - NEMA L5-30P\n* `nema-l5-50p` - NEMA L5-50P\n* `nema-l6-15p` - NEMA L6-15P\n* `nema-l6-20p` - NEMA L6-20P\n* `nema-l6-30p` - NEMA L6-30P\n* `nema-l6-50p` - NEMA L6-50P\n* `nema-l10-30p` - NEMA L10-30P\n* `nema-l14-20p` - NEMA L14-20P\n* `nema-l14-30p` - NEMA L14-30P\n* `nema-l14-50p` - NEMA L14-50P\n* `nema-l14-60p` - NEMA L14-60P\n* `nema-l15-20p` - NEMA L15-20P\n* `nema-l15-30p` - NEMA L15-30P\n* `nema-l15-50p` - NEMA L15-50P\n* `nema-l15-60p` - NEMA L15-60P\n* `nema-l21-20p` - NEMA L21-20P\n* `nema-l21-30p` - NEMA L21-30P\n* `nema-l22-20p` - NEMA L22-20P\n* `nema-l22-30p` - NEMA L22-30P\n* `cs6361c` - CS6361C\n* `cs6365c` - CS6365C\n* `cs8165c` - CS8165C\n* `cs8265c` - CS8265C\n* `cs8365c` - CS8365C\n* `cs8465c` - CS8465C\n* `ita-c` - ITA Type C (CEE 7/16)\n* `ita-e` - ITA Type E (CEE 7/6)\n* `ita-f` - ITA Type F (CEE 7/4)\n* `ita-ef` - ITA Type E/F (CEE 7/7)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `usb-3-b` - USB 3.0 Type B\n* `usb-3-micro-b` - USB 3.0 Micro B\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20` - Neutrik powerCON (20A)\n* `neutrik-powercon-32` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    maximum_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Maximum power draw (watts)"
    )
    allocated_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Allocated power draw (watts)"
    )
    description: constr(max_length=200) | None = None


class Provider(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100) = Field(..., description="Full name of the provider")
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    accounts: list[NestedProviderAccount] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    asns: list[ASN] | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    circuit_count: int | None = None


class RearPort(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    device: BriefDevice
    module: BriefModule | None = None
    name: constr(max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type17
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    positions: conint(ge=1, le=1024) | None = Field(
        None, description="Number of front ports which may be mapped"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    cable: BriefCable | None = None
    cable_end: str | None = None
    link_peers: list[Any]
    link_peers_type: str | None = Field(
        None, description="Return the type of the peer link terminations, or None."
    )
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    field_occupied: FieldOccupied = Field(..., alias="_occupied", title=" occupied")


class RearPortRequest(BaseModel):
    device: int | BriefDeviceRequest
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Literal[
        "8p8c",
        "8p6c",
        "8p4c",
        "8p2c",
        "6p6c",
        "6p4c",
        "6p2c",
        "4p4c",
        "4p2c",
        "gg45",
        "tera-4p",
        "tera-2p",
        "tera-1p",
        "110-punch",
        "bnc",
        "f",
        "n",
        "mrj21",
        "fc",
        "fc-pc",
        "fc-upc",
        "fc-apc",
        "lc",
        "lc-pc",
        "lc-upc",
        "lc-apc",
        "lsh",
        "lsh-pc",
        "lsh-upc",
        "lsh-apc",
        "lx5",
        "lx5-pc",
        "lx5-upc",
        "lx5-apc",
        "mpo",
        "mtrj",
        "sc",
        "sc-pc",
        "sc-upc",
        "sc-apc",
        "st",
        "cs",
        "sn",
        "sma-905",
        "sma-906",
        "urm-p2",
        "urm-p4",
        "urm-p8",
        "splice",
        "usb-a",
        "usb-b",
        "usb-c",
        "usb-mini-a",
        "usb-mini-b",
        "usb-micro-a",
        "usb-micro-b",
        "usb-micro-ab",
        "other",
    ] = Field(
        ...,
        description="* `8p8c` - 8P8C\n* `8p6c` - 8P6C\n* `8p4c` - 8P4C\n* `8p2c` - 8P2C\n* `6p6c` - 6P6C\n* `6p4c` - 6P4C\n* `6p2c` - 6P2C\n* `4p4c` - 4P4C\n* `4p2c` - 4P2C\n* `gg45` - GG45\n* `tera-4p` - TERA 4P\n* `tera-2p` - TERA 2P\n* `tera-1p` - TERA 1P\n* `110-punch` - 110 Punch\n* `bnc` - BNC\n* `f` - F Connector\n* `n` - N Connector\n* `mrj21` - MRJ21\n* `fc` - FC\n* `fc-pc` - FC/PC\n* `fc-upc` - FC/UPC\n* `fc-apc` - FC/APC\n* `lc` - LC\n* `lc-pc` - LC/PC\n* `lc-upc` - LC/UPC\n* `lc-apc` - LC/APC\n* `lsh` - LSH\n* `lsh-pc` - LSH/PC\n* `lsh-upc` - LSH/UPC\n* `lsh-apc` - LSH/APC\n* `lx5` - LX.5\n* `lx5-pc` - LX.5/PC\n* `lx5-upc` - LX.5/UPC\n* `lx5-apc` - LX.5/APC\n* `mpo` - MPO\n* `mtrj` - MTRJ\n* `sc` - SC\n* `sc-pc` - SC/PC\n* `sc-upc` - SC/UPC\n* `sc-apc` - SC/APC\n* `st` - ST\n* `cs` - CS\n* `sn` - SN\n* `sma-905` - SMA 905\n* `sma-906` - SMA 906\n* `urm-p2` - URM-P2\n* `urm-p4` - URM-P4\n* `urm-p8` - URM-P8\n* `splice` - Splice\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    positions: conint(ge=1, le=1024) | None = Field(
        None, description="Number of front ports which may be mapped"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class RearPortTemplate(BaseModel):
    id: int
    url: AnyUrl
    display: str
    device_type: BriefDeviceType | None = None
    module_type: BriefModuleType | None = None
    name: constr(max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Type17
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    positions: conint(ge=1, le=1024) | None = None
    description: constr(max_length=200) | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class RearPortTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Literal[
        "8p8c",
        "8p6c",
        "8p4c",
        "8p2c",
        "6p6c",
        "6p4c",
        "6p2c",
        "4p4c",
        "4p2c",
        "gg45",
        "tera-4p",
        "tera-2p",
        "tera-1p",
        "110-punch",
        "bnc",
        "f",
        "n",
        "mrj21",
        "fc",
        "fc-pc",
        "fc-upc",
        "fc-apc",
        "lc",
        "lc-pc",
        "lc-upc",
        "lc-apc",
        "lsh",
        "lsh-pc",
        "lsh-upc",
        "lsh-apc",
        "lx5",
        "lx5-pc",
        "lx5-upc",
        "lx5-apc",
        "mpo",
        "mtrj",
        "sc",
        "sc-pc",
        "sc-upc",
        "sc-apc",
        "st",
        "cs",
        "sn",
        "sma-905",
        "sma-906",
        "urm-p2",
        "urm-p4",
        "urm-p8",
        "splice",
        "usb-a",
        "usb-b",
        "usb-c",
        "usb-mini-a",
        "usb-mini-b",
        "usb-micro-a",
        "usb-micro-b",
        "usb-micro-ab",
        "other",
    ] = Field(
        ...,
        description="* `8p8c` - 8P8C\n* `8p6c` - 8P6C\n* `8p4c` - 8P4C\n* `8p2c` - 8P2C\n* `6p6c` - 6P6C\n* `6p4c` - 6P4C\n* `6p2c` - 6P2C\n* `4p4c` - 4P4C\n* `4p2c` - 4P2C\n* `gg45` - GG45\n* `tera-4p` - TERA 4P\n* `tera-2p` - TERA 2P\n* `tera-1p` - TERA 1P\n* `110-punch` - 110 Punch\n* `bnc` - BNC\n* `f` - F Connector\n* `n` - N Connector\n* `mrj21` - MRJ21\n* `fc` - FC\n* `fc-pc` - FC/PC\n* `fc-upc` - FC/UPC\n* `fc-apc` - FC/APC\n* `lc` - LC\n* `lc-pc` - LC/PC\n* `lc-upc` - LC/UPC\n* `lc-apc` - LC/APC\n* `lsh` - LSH\n* `lsh-pc` - LSH/PC\n* `lsh-upc` - LSH/UPC\n* `lsh-apc` - LSH/APC\n* `lx5` - LX.5\n* `lx5-pc` - LX.5/PC\n* `lx5-upc` - LX.5/UPC\n* `lx5-apc` - LX.5/APC\n* `mpo` - MPO\n* `mtrj` - MTRJ\n* `sc` - SC\n* `sc-pc` - SC/PC\n* `sc-upc` - SC/UPC\n* `sc-apc` - SC/APC\n* `st` - ST\n* `cs` - CS\n* `sn` - SN\n* `sma-905` - SMA 905\n* `sma-906` - SMA 906\n* `urm-p2` - URM-P2\n* `urm-p4` - URM-P4\n* `urm-p8` - URM-P8\n* `splice` - Splice\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    positions: conint(ge=1, le=1024) | None = None
    description: constr(max_length=200) | None = None


class Script(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    module: int
    name: str
    description: str | None = None
    vars: Any | None = None
    result: BriefJob
    display: str
    is_executable: bool


class Service(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    parent_object_type: str
    parent_object_id: conint(ge=0, le=9223372036854775807)
    parent: Any | None = None
    name: constr(max_length=100)
    protocol: Protocol | None = None
    ports: PortNumbers = Field(..., title="Port numbers")
    ipaddresses: list[IPAddress] | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class Site(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100) = Field(..., description="Full name of the site")
    slug: constr(pattern=r"^[-a-zA-Z0-9_]+$", max_length=100)
    status: Status18 | None = None
    region: BriefRegion | None = None
    group: BriefSiteGroup | None = None
    tenant: BriefTenant | None = None
    facility: constr(max_length=50) | None = Field(
        None, description="Local facility ID or description"
    )
    time_zone: str | None = None
    description: constr(max_length=200) | None = None
    physical_address: constr(max_length=200) | None = Field(
        None, description="Physical location of the building"
    )
    shipping_address: constr(max_length=200) | None = Field(
        None, description="If different from the physical address"
    )
    latitude: confloat(lt=100.0, gt=-100.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    longitude: confloat(lt=1000.0, gt=-1000.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    comments: str | None = None
    asns: list[ASN] | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    circuit_count: int | None = None
    device_count: int | None = None
    prefix_count: int | None = None
    rack_count: int | None = None
    virtualmachine_count: int | None = None
    vlan_count: int | None = None


class User(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    username: constr(pattern=r"^[\w.@+-]+$", max_length=150) = Field(
        ...,
        description="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
    )
    first_name: constr(max_length=150) | None = None
    last_name: constr(max_length=150) | None = None
    email: EmailAddress | None = Field(None, title="Email address")
    is_staff: StaffStatus | None = Field(
        None,
        description="Designates whether the user can log into this admin site.",
        title="Staff status",
    )
    is_active: Active | None = Field(
        None,
        description="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
        title="Active",
    )
    date_joined: AwareDatetime | None = None
    last_login: AwareDatetime | None = None
    groups: list[Group] | None = None
    permissions: list[ObjectPermission] | None = None


class VLANTranslationPolicy(BaseModel):
    id: int
    url: AnyUrl
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    rules: list[VLANTranslationRule]


class VMInterface(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    virtual_machine: BriefVirtualMachine
    name: constr(max_length=64)
    enabled: bool | None = None
    parent: NestedVMInterface | None = None
    bridge: NestedVMInterface | None = None
    mtu: conint(ge=1, le=65536) | None = None
    mac_address: str | None = None
    primary_mac_address: BriefMACAddress | None = None
    mac_addresses: list[BriefMACAddress] | None = None
    description: constr(max_length=200) | None = None
    mode: Mode2 | None = None
    untagged_vlan: BriefVLAN | None = None
    tagged_vlans: list[VLAN] | None = None
    qinq_svlan: BriefVLAN | None = None
    vlan_translation_policy: BriefVLANTranslationPolicy | None = None
    vrf: BriefVRF | None = None
    l2vpn_termination: BriefL2VPNTermination | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None
    count_ipaddresses: int
    count_fhrp_groups: int


class WritableCircuitRequest(BaseModel):
    cid: CircuitID9 = Field(..., description="Unique circuit ID", title="Circuit ID")
    provider: int | BriefProviderRequest
    provider_account: int | BriefProviderAccountRequest | None = None
    type: int | BriefCircuitTypeRequest
    status: (
        Literal[
            "planned",
            "provisioning",
            "active",
            "offline",
            "deprovisioning",
            "decommissioned",
        ]
        | None
    ) = Field(
        None,
        description="* `planned` - Planned\n* `provisioning` - Provisioning\n* `active` - Active\n* `offline` - Offline\n* `deprovisioning` - Deprovisioning\n* `decommissioned` - Decommissioned",
    )
    tenant: int | BriefTenantRequest | None = None
    install_date: Installed | None = Field(None, title="Installed")
    termination_date: Terminates | None = Field(None, title="Terminates")
    commit_rate: CommitRateKbps | None = Field(
        None, description="Committed rate", title="Commit rate (Kbps)"
    )
    description: constr(max_length=200) | None = None
    distance: confloat(lt=1000000.0, gt=-1000000.0) | None = None
    distance_unit: Literal["km", "m", "mi", "ft", ""] | None = Field(
        None,
        description="* `km` - Kilometers\n* `m` - Meters\n* `mi` - Miles\n* `ft` - Feet",
    )
    comments: str | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None
    assignments: list[BriefCircuitGroupAssignmentSerializerRequest] | None = None


class WritableConsolePortRequest(BaseModel):
    device: int | BriefDeviceRequest
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "de-9",
            "db-25",
            "rj-11",
            "rj-12",
            "rj-45",
            "mini-din-8",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="Physical port type\n\n* `de-9` - DE-9\n* `db-25` - DB-25\n* `rj-11` - RJ-11\n* `rj-12` - RJ-12\n* `rj-45` - RJ-45\n* `mini-din-8` - Mini-DIN 8\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    speed: Literal[1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200] | None = Field(
        None,
        description="Port speed in bits per second\n\n* `1200` - 1200 bps\n* `2400` - 2400 bps\n* `4800` - 4800 bps\n* `9600` - 9600 bps\n* `19200` - 19.2 kbps\n* `38400` - 38.4 kbps\n* `57600` - 57.6 kbps\n* `115200` - 115.2 kbps",
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableConsolePortTemplateRequest(ConsolePortTemplateRequest):
    pass


class WritableConsoleServerPortRequest(WritableConsolePortRequest):
    pass


class WritableConsoleServerPortTemplateRequest(ConsolePortTemplateRequest):
    pass


class WritableDeviceWithConfigContextRequest(BaseModel):
    name: constr(max_length=64) | None = None
    device_type: int | BriefDeviceTypeRequest
    role: int | BriefDeviceRoleRequest
    tenant: int | BriefTenantRequest | None = None
    platform: int | BriefPlatformRequest | None = None
    serial: SerialNumber16 | None = Field(
        None,
        description="Chassis serial number, assigned by the manufacturer",
        title="Serial number",
    )
    asset_tag: constr(max_length=50) | None = Field(
        None, description="A unique tag used to identify this device"
    )
    site: int | BriefSiteRequest
    location: int | BriefLocationRequest | None = None
    rack: int | BriefRackRequest | None = None
    position: PositionU8 | None = Field(None, title="Position (U)")
    face: RackFace | None = Field(
        None, description="* `front` - Front\n* `rear` - Rear", title="Rack face"
    )
    latitude: confloat(lt=100.0, gt=-100.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    longitude: confloat(lt=1000.0, gt=-1000.0) | None = Field(
        None, description="GPS coordinate in decimal format (xx.yyyyyy)"
    )
    status: (
        Literal[
            "offline",
            "active",
            "planned",
            "staged",
            "failed",
            "inventory",
            "decommissioning",
        ]
        | None
    ) = Field(
        None,
        description="* `offline` - Offline\n* `active` - Active\n* `planned` - Planned\n* `staged` - Staged\n* `failed` - Failed\n* `inventory` - Inventory\n* `decommissioning` - Decommissioning",
    )
    airflow: (
        Literal[
            "front-to-rear",
            "rear-to-front",
            "left-to-right",
            "right-to-left",
            "side-to-rear",
            "rear-to-side",
            "bottom-to-top",
            "top-to-bottom",
            "passive",
            "mixed",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `front-to-rear` - Front to rear\n* `rear-to-front` - Rear to front\n* `left-to-right` - Left to right\n* `right-to-left` - Right to left\n* `side-to-rear` - Side to rear\n* `rear-to-side` - Rear to side\n* `bottom-to-top` - Bottom to top\n* `top-to-bottom` - Top to bottom\n* `passive` - Passive\n* `mixed` - Mixed",
    )
    primary_ip4: int | BriefIPAddressRequest | None = None
    primary_ip6: int | BriefIPAddressRequest | None = None
    oob_ip: int | BriefIPAddressRequest | None = None
    cluster: int | BriefClusterRequest | None = None
    virtual_chassis: int | BriefVirtualChassisRequest | None = None
    vc_position: conint(ge=0, le=255) | None = None
    vc_priority: conint(ge=0, le=255) | None = Field(
        None, description="Virtual chassis master election priority"
    )
    description: constr(max_length=200) | None = None
    comments: str | None = None
    config_template: int | BriefConfigTemplateRequest | None = None
    local_context_data: Any | None = Field(
        None,
        description="Local config context data takes precedence over source contexts in the final rendered config context",
    )
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableFrontPortRequest(BaseModel):
    device: int | BriefDeviceRequest
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Literal[
        "8p8c",
        "8p6c",
        "8p4c",
        "8p2c",
        "6p6c",
        "6p4c",
        "6p2c",
        "4p4c",
        "4p2c",
        "gg45",
        "tera-4p",
        "tera-2p",
        "tera-1p",
        "110-punch",
        "bnc",
        "f",
        "n",
        "mrj21",
        "fc",
        "fc-pc",
        "fc-upc",
        "fc-apc",
        "lc",
        "lc-pc",
        "lc-upc",
        "lc-apc",
        "lsh",
        "lsh-pc",
        "lsh-upc",
        "lsh-apc",
        "lx5",
        "lx5-pc",
        "lx5-upc",
        "lx5-apc",
        "mpo",
        "mtrj",
        "sc",
        "sc-pc",
        "sc-upc",
        "sc-apc",
        "st",
        "cs",
        "sn",
        "sma-905",
        "sma-906",
        "urm-p2",
        "urm-p4",
        "urm-p8",
        "splice",
        "usb-a",
        "usb-b",
        "usb-c",
        "usb-mini-a",
        "usb-mini-b",
        "usb-micro-a",
        "usb-micro-b",
        "usb-micro-ab",
        "other",
    ] = Field(
        ...,
        description="* `8p8c` - 8P8C\n* `8p6c` - 8P6C\n* `8p4c` - 8P4C\n* `8p2c` - 8P2C\n* `6p6c` - 6P6C\n* `6p4c` - 6P4C\n* `6p2c` - 6P2C\n* `4p4c` - 4P4C\n* `4p2c` - 4P2C\n* `gg45` - GG45\n* `tera-4p` - TERA 4P\n* `tera-2p` - TERA 2P\n* `tera-1p` - TERA 1P\n* `110-punch` - 110 Punch\n* `bnc` - BNC\n* `f` - F Connector\n* `n` - N Connector\n* `mrj21` - MRJ21\n* `fc` - FC\n* `fc-pc` - FC/PC\n* `fc-upc` - FC/UPC\n* `fc-apc` - FC/APC\n* `lc` - LC\n* `lc-pc` - LC/PC\n* `lc-upc` - LC/UPC\n* `lc-apc` - LC/APC\n* `lsh` - LSH\n* `lsh-pc` - LSH/PC\n* `lsh-upc` - LSH/UPC\n* `lsh-apc` - LSH/APC\n* `lx5` - LX.5\n* `lx5-pc` - LX.5/PC\n* `lx5-upc` - LX.5/UPC\n* `lx5-apc` - LX.5/APC\n* `mpo` - MPO\n* `mtrj` - MTRJ\n* `sc` - SC\n* `sc-pc` - SC/PC\n* `sc-upc` - SC/UPC\n* `sc-apc` - SC/APC\n* `st` - ST\n* `cs` - CS\n* `sn` - SN\n* `sma-905` - SMA 905\n* `sma-906` - SMA 906\n* `urm-p2` - URM-P2\n* `urm-p4` - URM-P4\n* `urm-p8` - URM-P8\n* `splice` - Splice\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `other` - Other",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    rear_port: int
    rear_port_position: conint(ge=1, le=1024) | None = Field(
        None, description="Mapped position on corresponding rear port"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableFrontPortTemplateRequest(FrontPortTemplateRequest):
    pass


class WritableInterfaceRequest(BaseModel):
    device: int | BriefDeviceRequest
    vdcs: list[int] | None = None
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Literal[
        "virtual",
        "bridge",
        "lag",
        "100base-fx",
        "100base-lfx",
        "100base-tx",
        "100base-t1",
        "1000base-t",
        "1000base-lx",
        "1000base-tx",
        "2.5gbase-t",
        "5gbase-t",
        "10gbase-t",
        "10gbase-cx4",
        "100base-x-sfp",
        "1000base-x-gbic",
        "1000base-x-sfp",
        "10gbase-x-sfpp",
        "10gbase-x-xfp",
        "10gbase-x-xenpak",
        "10gbase-x-x2",
        "25gbase-x-sfp28",
        "50gbase-x-sfp56",
        "40gbase-x-qsfpp",
        "50gbase-x-sfp28",
        "100gbase-x-cfp",
        "100gbase-x-cfp2",
        "200gbase-x-cfp2",
        "400gbase-x-cfp2",
        "100gbase-x-cfp4",
        "100gbase-x-cxp",
        "100gbase-x-cpak",
        "100gbase-x-dsfp",
        "100gbase-x-sfpdd",
        "100gbase-x-qsfp28",
        "100gbase-x-qsfpdd",
        "200gbase-x-qsfp56",
        "200gbase-x-qsfpdd",
        "400gbase-x-qsfp112",
        "400gbase-x-qsfpdd",
        "400gbase-x-osfp",
        "400gbase-x-osfp-rhs",
        "400gbase-x-cdfp",
        "400gbase-x-cfp8",
        "800gbase-x-qsfpdd",
        "800gbase-x-osfp",
        "1000base-kx",
        "2.5gbase-kx",
        "5gbase-kr",
        "10gbase-kr",
        "10gbase-kx4",
        "25gbase-kr",
        "40gbase-kr4",
        "50gbase-kr",
        "100gbase-kp4",
        "100gbase-kr2",
        "100gbase-kr4",
        "ieee802.11a",
        "ieee802.11g",
        "ieee802.11n",
        "ieee802.11ac",
        "ieee802.11ad",
        "ieee802.11ax",
        "ieee802.11ay",
        "ieee802.11be",
        "ieee802.15.1",
        "ieee802.15.4",
        "other-wireless",
        "gsm",
        "cdma",
        "lte",
        "4g",
        "5g",
        "sonet-oc3",
        "sonet-oc12",
        "sonet-oc48",
        "sonet-oc192",
        "sonet-oc768",
        "sonet-oc1920",
        "sonet-oc3840",
        "1gfc-sfp",
        "2gfc-sfp",
        "4gfc-sfp",
        "8gfc-sfpp",
        "16gfc-sfpp",
        "32gfc-sfp28",
        "32gfc-sfpp",
        "64gfc-qsfpp",
        "64gfc-sfpdd",
        "64gfc-sfpp",
        "128gfc-qsfp28",
        "infiniband-sdr",
        "infiniband-ddr",
        "infiniband-qdr",
        "infiniband-fdr10",
        "infiniband-fdr",
        "infiniband-edr",
        "infiniband-hdr",
        "infiniband-ndr",
        "infiniband-xdr",
        "t1",
        "e1",
        "t3",
        "e3",
        "xdsl",
        "docsis",
        "moca",
        "bpon",
        "epon",
        "10g-epon",
        "gpon",
        "xg-pon",
        "xgs-pon",
        "ng-pon2",
        "25g-pon",
        "50g-pon",
        "cisco-stackwise",
        "cisco-stackwise-plus",
        "cisco-flexstack",
        "cisco-flexstack-plus",
        "cisco-stackwise-80",
        "cisco-stackwise-160",
        "cisco-stackwise-320",
        "cisco-stackwise-480",
        "cisco-stackwise-1t",
        "juniper-vcp",
        "extreme-summitstack",
        "extreme-summitstack-128",
        "extreme-summitstack-256",
        "extreme-summitstack-512",
        "other",
    ] = Field(
        ...,
        description="* `virtual` - Virtual\n* `bridge` - Bridge\n* `lag` - Link Aggregation Group (LAG)\n* `100base-fx` - 100BASE-FX (10/100ME FIBER)\n* `100base-lfx` - 100BASE-LFX (10/100ME FIBER)\n* `100base-tx` - 100BASE-TX (10/100ME)\n* `100base-t1` - 100BASE-T1 (10/100ME Single Pair)\n* `1000base-t` - 1000BASE-T (1GE)\n* `1000base-lx` - 1000BASE-LX (1GE)\n* `1000base-tx` - 1000BASE-TX (1GE)\n* `2.5gbase-t` - 2.5GBASE-T (2.5GE)\n* `5gbase-t` - 5GBASE-T (5GE)\n* `10gbase-t` - 10GBASE-T (10GE)\n* `10gbase-cx4` - 10GBASE-CX4 (10GE)\n* `100base-x-sfp` - SFP (100ME)\n* `1000base-x-gbic` - GBIC (1GE)\n* `1000base-x-sfp` - SFP (1GE)\n* `10gbase-x-sfpp` - SFP+ (10GE)\n* `10gbase-x-xfp` - XFP (10GE)\n* `10gbase-x-xenpak` - XENPAK (10GE)\n* `10gbase-x-x2` - X2 (10GE)\n* `25gbase-x-sfp28` - SFP28 (25GE)\n* `50gbase-x-sfp56` - SFP56 (50GE)\n* `40gbase-x-qsfpp` - QSFP+ (40GE)\n* `50gbase-x-sfp28` - QSFP28 (50GE)\n* `100gbase-x-cfp` - CFP (100GE)\n* `100gbase-x-cfp2` - CFP2 (100GE)\n* `200gbase-x-cfp2` - CFP2 (200GE)\n* `400gbase-x-cfp2` - CFP2 (400GE)\n* `100gbase-x-cfp4` - CFP4 (100GE)\n* `100gbase-x-cxp` - CXP (100GE)\n* `100gbase-x-cpak` - Cisco CPAK (100GE)\n* `100gbase-x-dsfp` - DSFP (100GE)\n* `100gbase-x-sfpdd` - SFP-DD (100GE)\n* `100gbase-x-qsfp28` - QSFP28 (100GE)\n* `100gbase-x-qsfpdd` - QSFP-DD (100GE)\n* `200gbase-x-qsfp56` - QSFP56 (200GE)\n* `200gbase-x-qsfpdd` - QSFP-DD (200GE)\n* `400gbase-x-qsfp112` - QSFP112 (400GE)\n* `400gbase-x-qsfpdd` - QSFP-DD (400GE)\n* `400gbase-x-osfp` - OSFP (400GE)\n* `400gbase-x-osfp-rhs` - OSFP-RHS (400GE)\n* `400gbase-x-cdfp` - CDFP (400GE)\n* `400gbase-x-cfp8` - CPF8 (400GE)\n* `800gbase-x-qsfpdd` - QSFP-DD (800GE)\n* `800gbase-x-osfp` - OSFP (800GE)\n* `1000base-kx` - 1000BASE-KX (1GE)\n* `2.5gbase-kx` - 2.5GBASE-KX (2.5GE)\n* `5gbase-kr` - 5GBASE-KR (5GE)\n* `10gbase-kr` - 10GBASE-KR (10GE)\n* `10gbase-kx4` - 10GBASE-KX4 (10GE)\n* `25gbase-kr` - 25GBASE-KR (25GE)\n* `40gbase-kr4` - 40GBASE-KR4 (40GE)\n* `50gbase-kr` - 50GBASE-KR (50GE)\n* `100gbase-kp4` - 100GBASE-KP4 (100GE)\n* `100gbase-kr2` - 100GBASE-KR2 (100GE)\n* `100gbase-kr4` - 100GBASE-KR4 (100GE)\n* `ieee802.11a` - IEEE 802.11a\n* `ieee802.11g` - IEEE 802.11b/g\n* `ieee802.11n` - IEEE 802.11n\n* `ieee802.11ac` - IEEE 802.11ac\n* `ieee802.11ad` - IEEE 802.11ad\n* `ieee802.11ax` - IEEE 802.11ax\n* `ieee802.11ay` - IEEE 802.11ay\n* `ieee802.11be` - IEEE 802.11be\n* `ieee802.15.1` - IEEE 802.15.1 (Bluetooth)\n* `ieee802.15.4` - IEEE 802.15.4 (LR-WPAN)\n* `other-wireless` - Other (Wireless)\n* `gsm` - GSM\n* `cdma` - CDMA\n* `lte` - LTE\n* `4g` - 4G\n* `5g` - 5G\n* `sonet-oc3` - OC-3/STM-1\n* `sonet-oc12` - OC-12/STM-4\n* `sonet-oc48` - OC-48/STM-16\n* `sonet-oc192` - OC-192/STM-64\n* `sonet-oc768` - OC-768/STM-256\n* `sonet-oc1920` - OC-1920/STM-640\n* `sonet-oc3840` - OC-3840/STM-1234\n* `1gfc-sfp` - SFP (1GFC)\n* `2gfc-sfp` - SFP (2GFC)\n* `4gfc-sfp` - SFP (4GFC)\n* `8gfc-sfpp` - SFP+ (8GFC)\n* `16gfc-sfpp` - SFP+ (16GFC)\n* `32gfc-sfp28` - SFP28 (32GFC)\n* `32gfc-sfpp` - SFP+ (32GFC)\n* `64gfc-qsfpp` - QSFP+ (64GFC)\n* `64gfc-sfpdd` - SFP-DD (64GFC)\n* `64gfc-sfpp` - SFP+ (64GFC)\n* `128gfc-qsfp28` - QSFP28 (128GFC)\n* `infiniband-sdr` - SDR (2 Gbps)\n* `infiniband-ddr` - DDR (4 Gbps)\n* `infiniband-qdr` - QDR (8 Gbps)\n* `infiniband-fdr10` - FDR10 (10 Gbps)\n* `infiniband-fdr` - FDR (13.5 Gbps)\n* `infiniband-edr` - EDR (25 Gbps)\n* `infiniband-hdr` - HDR (50 Gbps)\n* `infiniband-ndr` - NDR (100 Gbps)\n* `infiniband-xdr` - XDR (250 Gbps)\n* `t1` - T1 (1.544 Mbps)\n* `e1` - E1 (2.048 Mbps)\n* `t3` - T3 (45 Mbps)\n* `e3` - E3 (34 Mbps)\n* `xdsl` - xDSL\n* `docsis` - DOCSIS\n* `moca` - MoCA\n* `bpon` - BPON (622 Mbps / 155 Mbps)\n* `epon` - EPON (1 Gbps)\n* `10g-epon` - 10G-EPON (10 Gbps)\n* `gpon` - GPON (2.5 Gbps / 1.25 Gbps)\n* `xg-pon` - XG-PON (10 Gbps / 2.5 Gbps)\n* `xgs-pon` - XGS-PON (10 Gbps)\n* `ng-pon2` - NG-PON2 (TWDM-PON) (4x10 Gbps)\n* `25g-pon` - 25G-PON (25 Gbps)\n* `50g-pon` - 50G-PON (50 Gbps)\n* `cisco-stackwise` - Cisco StackWise\n* `cisco-stackwise-plus` - Cisco StackWise Plus\n* `cisco-flexstack` - Cisco FlexStack\n* `cisco-flexstack-plus` - Cisco FlexStack Plus\n* `cisco-stackwise-80` - Cisco StackWise-80\n* `cisco-stackwise-160` - Cisco StackWise-160\n* `cisco-stackwise-320` - Cisco StackWise-320\n* `cisco-stackwise-480` - Cisco StackWise-480\n* `cisco-stackwise-1t` - Cisco StackWise-1T\n* `juniper-vcp` - Juniper VCP\n* `extreme-summitstack` - Extreme SummitStack\n* `extreme-summitstack-128` - Extreme SummitStack-128\n* `extreme-summitstack-256` - Extreme SummitStack-256\n* `extreme-summitstack-512` - Extreme SummitStack-512\n* `other` - Other",
    )
    enabled: bool | None = None
    parent: ParentInterface | None = Field(None, title="Parent interface")
    bridge: BridgeInterface | None = Field(None, title="Bridge interface")
    lag: ParentLAG | None = Field(None, title="Parent LAG")
    mtu: conint(ge=1, le=65536) | None = None
    primary_mac_address: int | BriefMACAddressRequest | None = None
    speed: SpeedKbps | None = Field(None, title="Speed (Kbps)")
    duplex: Literal["half", "full", "auto", ""] | None = Field(
        None, description="* `half` - Half\n* `full` - Full\n* `auto` - Auto"
    )
    wwn: str | None = None
    mgmt_only: ManagementOnly6 | None = Field(
        None,
        description="This interface is used only for out-of-band management",
        title="Management only",
    )
    description: constr(max_length=200) | None = None
    mode: Literal["access", "tagged", "tagged-all", "q-in-q", ""] | None = Field(
        None,
        description="IEEE 802.1Q tagging strategy\n\n* `access` - Access\n* `tagged` - Tagged\n* `tagged-all` - Tagged (All)\n* `q-in-q` - Q-in-Q (802.1ad)",
    )
    rf_role: WirelessRole | None = Field(
        None,
        description="* `ap` - Access point\n* `station` - Station",
        title="Wireless role",
    )
    rf_channel: WirelessChannel | None = Field(
        None,
        description="* `2.4g-1-2412-22` - 1 (2412 MHz)\n* `2.4g-2-2417-22` - 2 (2417 MHz)\n* `2.4g-3-2422-22` - 3 (2422 MHz)\n* `2.4g-4-2427-22` - 4 (2427 MHz)\n* `2.4g-5-2432-22` - 5 (2432 MHz)\n* `2.4g-6-2437-22` - 6 (2437 MHz)\n* `2.4g-7-2442-22` - 7 (2442 MHz)\n* `2.4g-8-2447-22` - 8 (2447 MHz)\n* `2.4g-9-2452-22` - 9 (2452 MHz)\n* `2.4g-10-2457-22` - 10 (2457 MHz)\n* `2.4g-11-2462-22` - 11 (2462 MHz)\n* `2.4g-12-2467-22` - 12 (2467 MHz)\n* `2.4g-13-2472-22` - 13 (2472 MHz)\n* `5g-32-5160-20` - 32 (5160/20 MHz)\n* `5g-34-5170-40` - 34 (5170/40 MHz)\n* `5g-36-5180-20` - 36 (5180/20 MHz)\n* `5g-38-5190-40` - 38 (5190/40 MHz)\n* `5g-40-5200-20` - 40 (5200/20 MHz)\n* `5g-42-5210-80` - 42 (5210/80 MHz)\n* `5g-44-5220-20` - 44 (5220/20 MHz)\n* `5g-46-5230-40` - 46 (5230/40 MHz)\n* `5g-48-5240-20` - 48 (5240/20 MHz)\n* `5g-50-5250-160` - 50 (5250/160 MHz)\n* `5g-52-5260-20` - 52 (5260/20 MHz)\n* `5g-54-5270-40` - 54 (5270/40 MHz)\n* `5g-56-5280-20` - 56 (5280/20 MHz)\n* `5g-58-5290-80` - 58 (5290/80 MHz)\n* `5g-60-5300-20` - 60 (5300/20 MHz)\n* `5g-62-5310-40` - 62 (5310/40 MHz)\n* `5g-64-5320-20` - 64 (5320/20 MHz)\n* `5g-100-5500-20` - 100 (5500/20 MHz)\n* `5g-102-5510-40` - 102 (5510/40 MHz)\n* `5g-104-5520-20` - 104 (5520/20 MHz)\n* `5g-106-5530-80` - 106 (5530/80 MHz)\n* `5g-108-5540-20` - 108 (5540/20 MHz)\n* `5g-110-5550-40` - 110 (5550/40 MHz)\n* `5g-112-5560-20` - 112 (5560/20 MHz)\n* `5g-114-5570-160` - 114 (5570/160 MHz)\n* `5g-116-5580-20` - 116 (5580/20 MHz)\n* `5g-118-5590-40` - 118 (5590/40 MHz)\n* `5g-120-5600-20` - 120 (5600/20 MHz)\n* `5g-122-5610-80` - 122 (5610/80 MHz)\n* `5g-124-5620-20` - 124 (5620/20 MHz)\n* `5g-126-5630-40` - 126 (5630/40 MHz)\n* `5g-128-5640-20` - 128 (5640/20 MHz)\n* `5g-132-5660-20` - 132 (5660/20 MHz)\n* `5g-134-5670-40` - 134 (5670/40 MHz)\n* `5g-136-5680-20` - 136 (5680/20 MHz)\n* `5g-138-5690-80` - 138 (5690/80 MHz)\n* `5g-140-5700-20` - 140 (5700/20 MHz)\n* `5g-142-5710-40` - 142 (5710/40 MHz)\n* `5g-144-5720-20` - 144 (5720/20 MHz)\n* `5g-149-5745-20` - 149 (5745/20 MHz)\n* `5g-151-5755-40` - 151 (5755/40 MHz)\n* `5g-153-5765-20` - 153 (5765/20 MHz)\n* `5g-155-5775-80` - 155 (5775/80 MHz)\n* `5g-157-5785-20` - 157 (5785/20 MHz)\n* `5g-159-5795-40` - 159 (5795/40 MHz)\n* `5g-161-5805-20` - 161 (5805/20 MHz)\n* `5g-163-5815-160` - 163 (5815/160 MHz)\n* `5g-165-5825-20` - 165 (5825/20 MHz)\n* `5g-167-5835-40` - 167 (5835/40 MHz)\n* `5g-169-5845-20` - 169 (5845/20 MHz)\n* `5g-171-5855-80` - 171 (5855/80 MHz)\n* `5g-173-5865-20` - 173 (5865/20 MHz)\n* `5g-175-5875-40` - 175 (5875/40 MHz)\n* `5g-177-5885-20` - 177 (5885/20 MHz)\n* `6g-1-5955-20` - 1 (5955/20 MHz)\n* `6g-3-5965-40` - 3 (5965/40 MHz)\n* `6g-5-5975-20` - 5 (5975/20 MHz)\n* `6g-7-5985-80` - 7 (5985/80 MHz)\n* `6g-9-5995-20` - 9 (5995/20 MHz)\n* `6g-11-6005-40` - 11 (6005/40 MHz)\n* `6g-13-6015-20` - 13 (6015/20 MHz)\n* `6g-15-6025-160` - 15 (6025/160 MHz)\n* `6g-17-6035-20` - 17 (6035/20 MHz)\n* `6g-19-6045-40` - 19 (6045/40 MHz)\n* `6g-21-6055-20` - 21 (6055/20 MHz)\n* `6g-23-6065-80` - 23 (6065/80 MHz)\n* `6g-25-6075-20` - 25 (6075/20 MHz)\n* `6g-27-6085-40` - 27 (6085/40 MHz)\n* `6g-29-6095-20` - 29 (6095/20 MHz)\n* `6g-31-6105-320` - 31 (6105/320 MHz)\n* `6g-33-6115-20` - 33 (6115/20 MHz)\n* `6g-35-6125-40` - 35 (6125/40 MHz)\n* `6g-37-6135-20` - 37 (6135/20 MHz)\n* `6g-39-6145-80` - 39 (6145/80 MHz)\n* `6g-41-6155-20` - 41 (6155/20 MHz)\n* `6g-43-6165-40` - 43 (6165/40 MHz)\n* `6g-45-6175-20` - 45 (6175/20 MHz)\n* `6g-47-6185-160` - 47 (6185/160 MHz)\n* `6g-49-6195-20` - 49 (6195/20 MHz)\n* `6g-51-6205-40` - 51 (6205/40 MHz)\n* `6g-53-6215-20` - 53 (6215/20 MHz)\n* `6g-55-6225-80` - 55 (6225/80 MHz)\n* `6g-57-6235-20` - 57 (6235/20 MHz)\n* `6g-59-6245-40` - 59 (6245/40 MHz)\n* `6g-61-6255-20` - 61 (6255/20 MHz)\n* `6g-65-6275-20` - 65 (6275/20 MHz)\n* `6g-67-6285-40` - 67 (6285/40 MHz)\n* `6g-69-6295-20` - 69 (6295/20 MHz)\n* `6g-71-6305-80` - 71 (6305/80 MHz)\n* `6g-73-6315-20` - 73 (6315/20 MHz)\n* `6g-75-6325-40` - 75 (6325/40 MHz)\n* `6g-77-6335-20` - 77 (6335/20 MHz)\n* `6g-79-6345-160` - 79 (6345/160 MHz)\n* `6g-81-6355-20` - 81 (6355/20 MHz)\n* `6g-83-6365-40` - 83 (6365/40 MHz)\n* `6g-85-6375-20` - 85 (6375/20 MHz)\n* `6g-87-6385-80` - 87 (6385/80 MHz)\n* `6g-89-6395-20` - 89 (6395/20 MHz)\n* `6g-91-6405-40` - 91 (6405/40 MHz)\n* `6g-93-6415-20` - 93 (6415/20 MHz)\n* `6g-95-6425-320` - 95 (6425/320 MHz)\n* `6g-97-6435-20` - 97 (6435/20 MHz)\n* `6g-99-6445-40` - 99 (6445/40 MHz)\n* `6g-101-6455-20` - 101 (6455/20 MHz)\n* `6g-103-6465-80` - 103 (6465/80 MHz)\n* `6g-105-6475-20` - 105 (6475/20 MHz)\n* `6g-107-6485-40` - 107 (6485/40 MHz)\n* `6g-109-6495-20` - 109 (6495/20 MHz)\n* `6g-111-6505-160` - 111 (6505/160 MHz)\n* `6g-113-6515-20` - 113 (6515/20 MHz)\n* `6g-115-6525-40` - 115 (6525/40 MHz)\n* `6g-117-6535-20` - 117 (6535/20 MHz)\n* `6g-119-6545-80` - 119 (6545/80 MHz)\n* `6g-121-6555-20` - 121 (6555/20 MHz)\n* `6g-123-6565-40` - 123 (6565/40 MHz)\n* `6g-125-6575-20` - 125 (6575/20 MHz)\n* `6g-129-6595-20` - 129 (6595/20 MHz)\n* `6g-131-6605-40` - 131 (6605/40 MHz)\n* `6g-133-6615-20` - 133 (6615/20 MHz)\n* `6g-135-6625-80` - 135 (6625/80 MHz)\n* `6g-137-6635-20` - 137 (6635/20 MHz)\n* `6g-139-6645-40` - 139 (6645/40 MHz)\n* `6g-141-6655-20` - 141 (6655/20 MHz)\n* `6g-143-6665-160` - 143 (6665/160 MHz)\n* `6g-145-6675-20` - 145 (6675/20 MHz)\n* `6g-147-6685-40` - 147 (6685/40 MHz)\n* `6g-149-6695-20` - 149 (6695/20 MHz)\n* `6g-151-6705-80` - 151 (6705/80 MHz)\n* `6g-153-6715-20` - 153 (6715/20 MHz)\n* `6g-155-6725-40` - 155 (6725/40 MHz)\n* `6g-157-6735-20` - 157 (6735/20 MHz)\n* `6g-159-6745-320` - 159 (6745/320 MHz)\n* `6g-161-6755-20` - 161 (6755/20 MHz)\n* `6g-163-6765-40` - 163 (6765/40 MHz)\n* `6g-165-6775-20` - 165 (6775/20 MHz)\n* `6g-167-6785-80` - 167 (6785/80 MHz)\n* `6g-169-6795-20` - 169 (6795/20 MHz)\n* `6g-171-6805-40` - 171 (6805/40 MHz)\n* `6g-173-6815-20` - 173 (6815/20 MHz)\n* `6g-175-6825-160` - 175 (6825/160 MHz)\n* `6g-177-6835-20` - 177 (6835/20 MHz)\n* `6g-179-6845-40` - 179 (6845/40 MHz)\n* `6g-181-6855-20` - 181 (6855/20 MHz)\n* `6g-183-6865-80` - 183 (6865/80 MHz)\n* `6g-185-6875-20` - 185 (6875/20 MHz)\n* `6g-187-6885-40` - 187 (6885/40 MHz)\n* `6g-189-6895-20` - 189 (6895/20 MHz)\n* `6g-193-6915-20` - 193 (6915/20 MHz)\n* `6g-195-6925-40` - 195 (6925/40 MHz)\n* `6g-197-6935-20` - 197 (6935/20 MHz)\n* `6g-199-6945-80` - 199 (6945/80 MHz)\n* `6g-201-6955-20` - 201 (6955/20 MHz)\n* `6g-203-6965-40` - 203 (6965/40 MHz)\n* `6g-205-6975-20` - 205 (6975/20 MHz)\n* `6g-207-6985-160` - 207 (6985/160 MHz)\n* `6g-209-6995-20` - 209 (6995/20 MHz)\n* `6g-211-7005-40` - 211 (7005/40 MHz)\n* `6g-213-7015-20` - 213 (7015/20 MHz)\n* `6g-215-7025-80` - 215 (7025/80 MHz)\n* `6g-217-7035-20` - 217 (7035/20 MHz)\n* `6g-219-7045-40` - 219 (7045/40 MHz)\n* `6g-221-7055-20` - 221 (7055/20 MHz)\n* `6g-225-7075-20` - 225 (7075/20 MHz)\n* `6g-227-7085-40` - 227 (7085/40 MHz)\n* `6g-229-7095-20` - 229 (7095/20 MHz)\n* `6g-233-7115-20` - 233 (7115/20 MHz)\n* `60g-1-58320-2160` - 1 (58.32/2.16 GHz)\n* `60g-2-60480-2160` - 2 (60.48/2.16 GHz)\n* `60g-3-62640-2160` - 3 (62.64/2.16 GHz)\n* `60g-4-64800-2160` - 4 (64.80/2.16 GHz)\n* `60g-5-66960-2160` - 5 (66.96/2.16 GHz)\n* `60g-6-69120-2160` - 6 (69.12/2.16 GHz)\n* `60g-9-59400-4320` - 9 (59.40/4.32 GHz)\n* `60g-10-61560-4320` - 10 (61.56/4.32 GHz)\n* `60g-11-63720-4320` - 11 (63.72/4.32 GHz)\n* `60g-12-65880-4320` - 12 (65.88/4.32 GHz)\n* `60g-13-68040-4320` - 13 (68.04/4.32 GHz)\n* `60g-17-60480-6480` - 17 (60.48/6.48 GHz)\n* `60g-18-62640-6480` - 18 (62.64/6.48 GHz)\n* `60g-19-64800-6480` - 19 (64.80/6.48 GHz)\n* `60g-20-66960-6480` - 20 (66.96/6.48 GHz)\n* `60g-25-61560-6480` - 25 (61.56/8.64 GHz)\n* `60g-26-63720-6480` - 26 (63.72/8.64 GHz)\n* `60g-27-65880-6480` - 27 (65.88/8.64 GHz)",
        title="Wireless channel",
    )
    poe_mode: Literal["pd", "pse", ""] | None = Field(
        None, description="* `pd` - PD\n* `pse` - PSE"
    )
    poe_type: (
        Literal[
            "type1-ieee802.3af",
            "type2-ieee802.3at",
            "type3-ieee802.3bt",
            "type4-ieee802.3bt",
            "passive-24v-2pair",
            "passive-24v-4pair",
            "passive-48v-2pair",
            "passive-48v-4pair",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `type1-ieee802.3af` - 802.3af (Type 1)\n* `type2-ieee802.3at` - 802.3at (Type 2)\n* `type3-ieee802.3bt` - 802.3bt (Type 3)\n* `type4-ieee802.3bt` - 802.3bt (Type 4)\n* `passive-24v-2pair` - Passive 24V (2-pair)\n* `passive-24v-4pair` - Passive 24V (4-pair)\n* `passive-48v-2pair` - Passive 48V (2-pair)\n* `passive-48v-4pair` - Passive 48V (4-pair)",
    )
    rf_channel_frequency: ChannelFrequencyMHz | None = Field(
        None,
        description="Populated by selected channel (if set)",
        title="Channel frequency (MHz)",
    )
    rf_channel_width: ChannelWidthMHz | None = Field(
        None,
        description="Populated by selected channel (if set)",
        title="Channel width (MHz)",
    )
    tx_power: TransmitPowerDBm | None = Field(None, title="Transmit power (dBm)")
    untagged_vlan: int | BriefVLANRequest | None = None
    tagged_vlans: list[int] | None = None
    qinq_svlan: int | BriefVLANRequest | None = None
    vlan_translation_policy: int | BriefVLANTranslationPolicyRequest | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    wireless_lans: list[int] | None = None
    vrf: int | BriefVRFRequest | None = None
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritableInterfaceTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: Literal[
        "virtual",
        "bridge",
        "lag",
        "100base-fx",
        "100base-lfx",
        "100base-tx",
        "100base-t1",
        "1000base-t",
        "1000base-lx",
        "1000base-tx",
        "2.5gbase-t",
        "5gbase-t",
        "10gbase-t",
        "10gbase-cx4",
        "100base-x-sfp",
        "1000base-x-gbic",
        "1000base-x-sfp",
        "10gbase-x-sfpp",
        "10gbase-x-xfp",
        "10gbase-x-xenpak",
        "10gbase-x-x2",
        "25gbase-x-sfp28",
        "50gbase-x-sfp56",
        "40gbase-x-qsfpp",
        "50gbase-x-sfp28",
        "100gbase-x-cfp",
        "100gbase-x-cfp2",
        "200gbase-x-cfp2",
        "400gbase-x-cfp2",
        "100gbase-x-cfp4",
        "100gbase-x-cxp",
        "100gbase-x-cpak",
        "100gbase-x-dsfp",
        "100gbase-x-sfpdd",
        "100gbase-x-qsfp28",
        "100gbase-x-qsfpdd",
        "200gbase-x-qsfp56",
        "200gbase-x-qsfpdd",
        "400gbase-x-qsfp112",
        "400gbase-x-qsfpdd",
        "400gbase-x-osfp",
        "400gbase-x-osfp-rhs",
        "400gbase-x-cdfp",
        "400gbase-x-cfp8",
        "800gbase-x-qsfpdd",
        "800gbase-x-osfp",
        "1000base-kx",
        "2.5gbase-kx",
        "5gbase-kr",
        "10gbase-kr",
        "10gbase-kx4",
        "25gbase-kr",
        "40gbase-kr4",
        "50gbase-kr",
        "100gbase-kp4",
        "100gbase-kr2",
        "100gbase-kr4",
        "ieee802.11a",
        "ieee802.11g",
        "ieee802.11n",
        "ieee802.11ac",
        "ieee802.11ad",
        "ieee802.11ax",
        "ieee802.11ay",
        "ieee802.11be",
        "ieee802.15.1",
        "ieee802.15.4",
        "other-wireless",
        "gsm",
        "cdma",
        "lte",
        "4g",
        "5g",
        "sonet-oc3",
        "sonet-oc12",
        "sonet-oc48",
        "sonet-oc192",
        "sonet-oc768",
        "sonet-oc1920",
        "sonet-oc3840",
        "1gfc-sfp",
        "2gfc-sfp",
        "4gfc-sfp",
        "8gfc-sfpp",
        "16gfc-sfpp",
        "32gfc-sfp28",
        "32gfc-sfpp",
        "64gfc-qsfpp",
        "64gfc-sfpdd",
        "64gfc-sfpp",
        "128gfc-qsfp28",
        "infiniband-sdr",
        "infiniband-ddr",
        "infiniband-qdr",
        "infiniband-fdr10",
        "infiniband-fdr",
        "infiniband-edr",
        "infiniband-hdr",
        "infiniband-ndr",
        "infiniband-xdr",
        "t1",
        "e1",
        "t3",
        "e3",
        "xdsl",
        "docsis",
        "moca",
        "bpon",
        "epon",
        "10g-epon",
        "gpon",
        "xg-pon",
        "xgs-pon",
        "ng-pon2",
        "25g-pon",
        "50g-pon",
        "cisco-stackwise",
        "cisco-stackwise-plus",
        "cisco-flexstack",
        "cisco-flexstack-plus",
        "cisco-stackwise-80",
        "cisco-stackwise-160",
        "cisco-stackwise-320",
        "cisco-stackwise-480",
        "cisco-stackwise-1t",
        "juniper-vcp",
        "extreme-summitstack",
        "extreme-summitstack-128",
        "extreme-summitstack-256",
        "extreme-summitstack-512",
        "other",
    ] = Field(
        ...,
        description="* `virtual` - Virtual\n* `bridge` - Bridge\n* `lag` - Link Aggregation Group (LAG)\n* `100base-fx` - 100BASE-FX (10/100ME FIBER)\n* `100base-lfx` - 100BASE-LFX (10/100ME FIBER)\n* `100base-tx` - 100BASE-TX (10/100ME)\n* `100base-t1` - 100BASE-T1 (10/100ME Single Pair)\n* `1000base-t` - 1000BASE-T (1GE)\n* `1000base-lx` - 1000BASE-LX (1GE)\n* `1000base-tx` - 1000BASE-TX (1GE)\n* `2.5gbase-t` - 2.5GBASE-T (2.5GE)\n* `5gbase-t` - 5GBASE-T (5GE)\n* `10gbase-t` - 10GBASE-T (10GE)\n* `10gbase-cx4` - 10GBASE-CX4 (10GE)\n* `100base-x-sfp` - SFP (100ME)\n* `1000base-x-gbic` - GBIC (1GE)\n* `1000base-x-sfp` - SFP (1GE)\n* `10gbase-x-sfpp` - SFP+ (10GE)\n* `10gbase-x-xfp` - XFP (10GE)\n* `10gbase-x-xenpak` - XENPAK (10GE)\n* `10gbase-x-x2` - X2 (10GE)\n* `25gbase-x-sfp28` - SFP28 (25GE)\n* `50gbase-x-sfp56` - SFP56 (50GE)\n* `40gbase-x-qsfpp` - QSFP+ (40GE)\n* `50gbase-x-sfp28` - QSFP28 (50GE)\n* `100gbase-x-cfp` - CFP (100GE)\n* `100gbase-x-cfp2` - CFP2 (100GE)\n* `200gbase-x-cfp2` - CFP2 (200GE)\n* `400gbase-x-cfp2` - CFP2 (400GE)\n* `100gbase-x-cfp4` - CFP4 (100GE)\n* `100gbase-x-cxp` - CXP (100GE)\n* `100gbase-x-cpak` - Cisco CPAK (100GE)\n* `100gbase-x-dsfp` - DSFP (100GE)\n* `100gbase-x-sfpdd` - SFP-DD (100GE)\n* `100gbase-x-qsfp28` - QSFP28 (100GE)\n* `100gbase-x-qsfpdd` - QSFP-DD (100GE)\n* `200gbase-x-qsfp56` - QSFP56 (200GE)\n* `200gbase-x-qsfpdd` - QSFP-DD (200GE)\n* `400gbase-x-qsfp112` - QSFP112 (400GE)\n* `400gbase-x-qsfpdd` - QSFP-DD (400GE)\n* `400gbase-x-osfp` - OSFP (400GE)\n* `400gbase-x-osfp-rhs` - OSFP-RHS (400GE)\n* `400gbase-x-cdfp` - CDFP (400GE)\n* `400gbase-x-cfp8` - CPF8 (400GE)\n* `800gbase-x-qsfpdd` - QSFP-DD (800GE)\n* `800gbase-x-osfp` - OSFP (800GE)\n* `1000base-kx` - 1000BASE-KX (1GE)\n* `2.5gbase-kx` - 2.5GBASE-KX (2.5GE)\n* `5gbase-kr` - 5GBASE-KR (5GE)\n* `10gbase-kr` - 10GBASE-KR (10GE)\n* `10gbase-kx4` - 10GBASE-KX4 (10GE)\n* `25gbase-kr` - 25GBASE-KR (25GE)\n* `40gbase-kr4` - 40GBASE-KR4 (40GE)\n* `50gbase-kr` - 50GBASE-KR (50GE)\n* `100gbase-kp4` - 100GBASE-KP4 (100GE)\n* `100gbase-kr2` - 100GBASE-KR2 (100GE)\n* `100gbase-kr4` - 100GBASE-KR4 (100GE)\n* `ieee802.11a` - IEEE 802.11a\n* `ieee802.11g` - IEEE 802.11b/g\n* `ieee802.11n` - IEEE 802.11n\n* `ieee802.11ac` - IEEE 802.11ac\n* `ieee802.11ad` - IEEE 802.11ad\n* `ieee802.11ax` - IEEE 802.11ax\n* `ieee802.11ay` - IEEE 802.11ay\n* `ieee802.11be` - IEEE 802.11be\n* `ieee802.15.1` - IEEE 802.15.1 (Bluetooth)\n* `ieee802.15.4` - IEEE 802.15.4 (LR-WPAN)\n* `other-wireless` - Other (Wireless)\n* `gsm` - GSM\n* `cdma` - CDMA\n* `lte` - LTE\n* `4g` - 4G\n* `5g` - 5G\n* `sonet-oc3` - OC-3/STM-1\n* `sonet-oc12` - OC-12/STM-4\n* `sonet-oc48` - OC-48/STM-16\n* `sonet-oc192` - OC-192/STM-64\n* `sonet-oc768` - OC-768/STM-256\n* `sonet-oc1920` - OC-1920/STM-640\n* `sonet-oc3840` - OC-3840/STM-1234\n* `1gfc-sfp` - SFP (1GFC)\n* `2gfc-sfp` - SFP (2GFC)\n* `4gfc-sfp` - SFP (4GFC)\n* `8gfc-sfpp` - SFP+ (8GFC)\n* `16gfc-sfpp` - SFP+ (16GFC)\n* `32gfc-sfp28` - SFP28 (32GFC)\n* `32gfc-sfpp` - SFP+ (32GFC)\n* `64gfc-qsfpp` - QSFP+ (64GFC)\n* `64gfc-sfpdd` - SFP-DD (64GFC)\n* `64gfc-sfpp` - SFP+ (64GFC)\n* `128gfc-qsfp28` - QSFP28 (128GFC)\n* `infiniband-sdr` - SDR (2 Gbps)\n* `infiniband-ddr` - DDR (4 Gbps)\n* `infiniband-qdr` - QDR (8 Gbps)\n* `infiniband-fdr10` - FDR10 (10 Gbps)\n* `infiniband-fdr` - FDR (13.5 Gbps)\n* `infiniband-edr` - EDR (25 Gbps)\n* `infiniband-hdr` - HDR (50 Gbps)\n* `infiniband-ndr` - NDR (100 Gbps)\n* `infiniband-xdr` - XDR (250 Gbps)\n* `t1` - T1 (1.544 Mbps)\n* `e1` - E1 (2.048 Mbps)\n* `t3` - T3 (45 Mbps)\n* `e3` - E3 (34 Mbps)\n* `xdsl` - xDSL\n* `docsis` - DOCSIS\n* `moca` - MoCA\n* `bpon` - BPON (622 Mbps / 155 Mbps)\n* `epon` - EPON (1 Gbps)\n* `10g-epon` - 10G-EPON (10 Gbps)\n* `gpon` - GPON (2.5 Gbps / 1.25 Gbps)\n* `xg-pon` - XG-PON (10 Gbps / 2.5 Gbps)\n* `xgs-pon` - XGS-PON (10 Gbps)\n* `ng-pon2` - NG-PON2 (TWDM-PON) (4x10 Gbps)\n* `25g-pon` - 25G-PON (25 Gbps)\n* `50g-pon` - 50G-PON (50 Gbps)\n* `cisco-stackwise` - Cisco StackWise\n* `cisco-stackwise-plus` - Cisco StackWise Plus\n* `cisco-flexstack` - Cisco FlexStack\n* `cisco-flexstack-plus` - Cisco FlexStack Plus\n* `cisco-stackwise-80` - Cisco StackWise-80\n* `cisco-stackwise-160` - Cisco StackWise-160\n* `cisco-stackwise-320` - Cisco StackWise-320\n* `cisco-stackwise-480` - Cisco StackWise-480\n* `cisco-stackwise-1t` - Cisco StackWise-1T\n* `juniper-vcp` - Juniper VCP\n* `extreme-summitstack` - Extreme SummitStack\n* `extreme-summitstack-128` - Extreme SummitStack-128\n* `extreme-summitstack-256` - Extreme SummitStack-256\n* `extreme-summitstack-512` - Extreme SummitStack-512\n* `other` - Other",
    )
    enabled: bool | None = None
    mgmt_only: ManagementOnly7 | None = Field(None, title="Management only")
    description: constr(max_length=200) | None = None
    bridge: BridgeInterface | None = Field(None, title="Bridge interface")
    poe_mode: Literal["pd", "pse", ""] | None = Field(
        None, description="* `pd` - PD\n* `pse` - PSE"
    )
    poe_type: (
        Literal[
            "type1-ieee802.3af",
            "type2-ieee802.3at",
            "type3-ieee802.3bt",
            "type4-ieee802.3bt",
            "passive-24v-2pair",
            "passive-24v-4pair",
            "passive-48v-2pair",
            "passive-48v-4pair",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `type1-ieee802.3af` - 802.3af (Type 1)\n* `type2-ieee802.3at` - 802.3at (Type 2)\n* `type3-ieee802.3bt` - 802.3bt (Type 3)\n* `type4-ieee802.3bt` - 802.3bt (Type 4)\n* `passive-24v-2pair` - Passive 24V (2-pair)\n* `passive-24v-4pair` - Passive 24V (4-pair)\n* `passive-48v-2pair` - Passive 48V (2-pair)\n* `passive-48v-4pair` - Passive 48V (4-pair)",
    )
    rf_role: WirelessRole | None = Field(
        None,
        description="* `ap` - Access point\n* `station` - Station",
        title="Wireless role",
    )


class WritablePowerOutletRequest(BaseModel):
    device: int | BriefDeviceRequest
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c5",
            "iec-60320-c7",
            "iec-60320-c13",
            "iec-60320-c15",
            "iec-60320-c19",
            "iec-60320-c21",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15r",
            "nema-5-15r",
            "nema-5-20r",
            "nema-5-30r",
            "nema-5-50r",
            "nema-6-15r",
            "nema-6-20r",
            "nema-6-30r",
            "nema-6-50r",
            "nema-10-30r",
            "nema-10-50r",
            "nema-14-20r",
            "nema-14-30r",
            "nema-14-50r",
            "nema-14-60r",
            "nema-15-15r",
            "nema-15-20r",
            "nema-15-30r",
            "nema-15-50r",
            "nema-15-60r",
            "nema-l1-15r",
            "nema-l5-15r",
            "nema-l5-20r",
            "nema-l5-30r",
            "nema-l5-50r",
            "nema-l6-15r",
            "nema-l6-20r",
            "nema-l6-30r",
            "nema-l6-50r",
            "nema-l10-30r",
            "nema-l14-20r",
            "nema-l14-30r",
            "nema-l14-50r",
            "nema-l14-60r",
            "nema-l15-20r",
            "nema-l15-30r",
            "nema-l15-50r",
            "nema-l15-60r",
            "nema-l21-20r",
            "nema-l21-30r",
            "nema-l22-20r",
            "nema-l22-30r",
            "CS6360C",
            "CS6364C",
            "CS8164C",
            "CS8264C",
            "CS8364C",
            "CS8464C",
            "ita-e",
            "ita-f",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "ita-multistandard",
            "usb-a",
            "usb-micro-b",
            "usb-c",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "eaton-c39",
            "hdot-cx",
            "saf-d-grid",
            "neutrik-powercon-20a",
            "neutrik-powercon-32a",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="Physical port type\n\n* `iec-60320-c5` - C5\n* `iec-60320-c7` - C7\n* `iec-60320-c13` - C13\n* `iec-60320-c15` - C15\n* `iec-60320-c19` - C19\n* `iec-60320-c21` - C21\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15r` - NEMA 1-15R\n* `nema-5-15r` - NEMA 5-15R\n* `nema-5-20r` - NEMA 5-20R\n* `nema-5-30r` - NEMA 5-30R\n* `nema-5-50r` - NEMA 5-50R\n* `nema-6-15r` - NEMA 6-15R\n* `nema-6-20r` - NEMA 6-20R\n* `nema-6-30r` - NEMA 6-30R\n* `nema-6-50r` - NEMA 6-50R\n* `nema-10-30r` - NEMA 10-30R\n* `nema-10-50r` - NEMA 10-50R\n* `nema-14-20r` - NEMA 14-20R\n* `nema-14-30r` - NEMA 14-30R\n* `nema-14-50r` - NEMA 14-50R\n* `nema-14-60r` - NEMA 14-60R\n* `nema-15-15r` - NEMA 15-15R\n* `nema-15-20r` - NEMA 15-20R\n* `nema-15-30r` - NEMA 15-30R\n* `nema-15-50r` - NEMA 15-50R\n* `nema-15-60r` - NEMA 15-60R\n* `nema-l1-15r` - NEMA L1-15R\n* `nema-l5-15r` - NEMA L5-15R\n* `nema-l5-20r` - NEMA L5-20R\n* `nema-l5-30r` - NEMA L5-30R\n* `nema-l5-50r` - NEMA L5-50R\n* `nema-l6-15r` - NEMA L6-15R\n* `nema-l6-20r` - NEMA L6-20R\n* `nema-l6-30r` - NEMA L6-30R\n* `nema-l6-50r` - NEMA L6-50R\n* `nema-l10-30r` - NEMA L10-30R\n* `nema-l14-20r` - NEMA L14-20R\n* `nema-l14-30r` - NEMA L14-30R\n* `nema-l14-50r` - NEMA L14-50R\n* `nema-l14-60r` - NEMA L14-60R\n* `nema-l15-20r` - NEMA L15-20R\n* `nema-l15-30r` - NEMA L15-30R\n* `nema-l15-50r` - NEMA L15-50R\n* `nema-l15-60r` - NEMA L15-60R\n* `nema-l21-20r` - NEMA L21-20R\n* `nema-l21-30r` - NEMA L21-30R\n* `nema-l22-20r` - NEMA L22-20R\n* `nema-l22-30r` - NEMA L22-30R\n* `CS6360C` - CS6360C\n* `CS6364C` - CS6364C\n* `CS8164C` - CS8164C\n* `CS8264C` - CS8264C\n* `CS8364C` - CS8364C\n* `CS8464C` - CS8464C\n* `ita-e` - ITA Type E (CEE 7/5)\n* `ita-f` - ITA Type F (CEE 7/3)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `ita-multistandard` - ITA Multistandard\n* `usb-a` - USB Type A\n* `usb-micro-b` - USB Micro B\n* `usb-c` - USB Type C\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `eaton-c39` - Eaton C39\n* `hdot-cx` - HDOT Cx\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20a` - Neutrik powerCON (20A)\n* `neutrik-powercon-32a` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    status: Literal["enabled", "disabled", "faulty"] | None = Field(
        None,
        description="* `enabled` - Enabled\n* `disabled` - Disabled\n* `faulty` - Faulty",
    )
    color: constr(pattern=r"^[0-9a-f]{6}$", max_length=6) | None = None
    power_port: int | BriefPowerPortRequest | None = None
    feed_leg: Literal["A", "B", "C", ""] | None = Field(
        None,
        description="Phase (for three-phase feeds)\n\n* `A` - A\n* `B` - B\n* `C` - C",
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritablePowerOutletTemplateRequest(BaseModel):
    device_type: int | BriefDeviceTypeRequest | None = None
    module_type: int | BriefModuleTypeRequest | None = None
    name: constr(min_length=1, max_length=64) = Field(
        ...,
        description="{module} is accepted as a substitution for the module bay position when attached to a module type.",
    )
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c5",
            "iec-60320-c7",
            "iec-60320-c13",
            "iec-60320-c15",
            "iec-60320-c19",
            "iec-60320-c21",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15r",
            "nema-5-15r",
            "nema-5-20r",
            "nema-5-30r",
            "nema-5-50r",
            "nema-6-15r",
            "nema-6-20r",
            "nema-6-30r",
            "nema-6-50r",
            "nema-10-30r",
            "nema-10-50r",
            "nema-14-20r",
            "nema-14-30r",
            "nema-14-50r",
            "nema-14-60r",
            "nema-15-15r",
            "nema-15-20r",
            "nema-15-30r",
            "nema-15-50r",
            "nema-15-60r",
            "nema-l1-15r",
            "nema-l5-15r",
            "nema-l5-20r",
            "nema-l5-30r",
            "nema-l5-50r",
            "nema-l6-15r",
            "nema-l6-20r",
            "nema-l6-30r",
            "nema-l6-50r",
            "nema-l10-30r",
            "nema-l14-20r",
            "nema-l14-30r",
            "nema-l14-50r",
            "nema-l14-60r",
            "nema-l15-20r",
            "nema-l15-30r",
            "nema-l15-50r",
            "nema-l15-60r",
            "nema-l21-20r",
            "nema-l21-30r",
            "nema-l22-20r",
            "nema-l22-30r",
            "CS6360C",
            "CS6364C",
            "CS8164C",
            "CS8264C",
            "CS8364C",
            "CS8464C",
            "ita-e",
            "ita-f",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "ita-multistandard",
            "usb-a",
            "usb-micro-b",
            "usb-c",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "eaton-c39",
            "hdot-cx",
            "saf-d-grid",
            "neutrik-powercon-20a",
            "neutrik-powercon-32a",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="* `iec-60320-c5` - C5\n* `iec-60320-c7` - C7\n* `iec-60320-c13` - C13\n* `iec-60320-c15` - C15\n* `iec-60320-c19` - C19\n* `iec-60320-c21` - C21\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15r` - NEMA 1-15R\n* `nema-5-15r` - NEMA 5-15R\n* `nema-5-20r` - NEMA 5-20R\n* `nema-5-30r` - NEMA 5-30R\n* `nema-5-50r` - NEMA 5-50R\n* `nema-6-15r` - NEMA 6-15R\n* `nema-6-20r` - NEMA 6-20R\n* `nema-6-30r` - NEMA 6-30R\n* `nema-6-50r` - NEMA 6-50R\n* `nema-10-30r` - NEMA 10-30R\n* `nema-10-50r` - NEMA 10-50R\n* `nema-14-20r` - NEMA 14-20R\n* `nema-14-30r` - NEMA 14-30R\n* `nema-14-50r` - NEMA 14-50R\n* `nema-14-60r` - NEMA 14-60R\n* `nema-15-15r` - NEMA 15-15R\n* `nema-15-20r` - NEMA 15-20R\n* `nema-15-30r` - NEMA 15-30R\n* `nema-15-50r` - NEMA 15-50R\n* `nema-15-60r` - NEMA 15-60R\n* `nema-l1-15r` - NEMA L1-15R\n* `nema-l5-15r` - NEMA L5-15R\n* `nema-l5-20r` - NEMA L5-20R\n* `nema-l5-30r` - NEMA L5-30R\n* `nema-l5-50r` - NEMA L5-50R\n* `nema-l6-15r` - NEMA L6-15R\n* `nema-l6-20r` - NEMA L6-20R\n* `nema-l6-30r` - NEMA L6-30R\n* `nema-l6-50r` - NEMA L6-50R\n* `nema-l10-30r` - NEMA L10-30R\n* `nema-l14-20r` - NEMA L14-20R\n* `nema-l14-30r` - NEMA L14-30R\n* `nema-l14-50r` - NEMA L14-50R\n* `nema-l14-60r` - NEMA L14-60R\n* `nema-l15-20r` - NEMA L15-20R\n* `nema-l15-30r` - NEMA L15-30R\n* `nema-l15-50r` - NEMA L15-50R\n* `nema-l15-60r` - NEMA L15-60R\n* `nema-l21-20r` - NEMA L21-20R\n* `nema-l21-30r` - NEMA L21-30R\n* `nema-l22-20r` - NEMA L22-20R\n* `nema-l22-30r` - NEMA L22-30R\n* `CS6360C` - CS6360C\n* `CS6364C` - CS6364C\n* `CS8164C` - CS8164C\n* `CS8264C` - CS8264C\n* `CS8364C` - CS8364C\n* `CS8464C` - CS8464C\n* `ita-e` - ITA Type E (CEE 7/5)\n* `ita-f` - ITA Type F (CEE 7/3)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `ita-multistandard` - ITA Multistandard\n* `usb-a` - USB Type A\n* `usb-micro-b` - USB Micro B\n* `usb-c` - USB Type C\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `eaton-c39` - Eaton C39\n* `hdot-cx` - HDOT Cx\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20a` - Neutrik powerCON (20A)\n* `neutrik-powercon-32a` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    power_port: int | BriefPowerPortTemplateRequest | None = None
    feed_leg: Literal["A", "B", "C", ""] | None = Field(
        None,
        description="Phase (for three-phase feeds)\n\n* `A` - A\n* `B` - B\n* `C` - C",
    )
    description: constr(max_length=200) | None = None


class WritablePowerPortRequest(BaseModel):
    device: int | BriefDeviceRequest
    module: int | BriefModuleRequest | None = None
    name: constr(min_length=1, max_length=64)
    label: constr(max_length=64) | None = Field(None, description="Physical label")
    type: (
        Literal[
            "iec-60320-c6",
            "iec-60320-c8",
            "iec-60320-c14",
            "iec-60320-c16",
            "iec-60320-c20",
            "iec-60320-c22",
            "iec-60309-p-n-e-4h",
            "iec-60309-p-n-e-6h",
            "iec-60309-p-n-e-9h",
            "iec-60309-2p-e-4h",
            "iec-60309-2p-e-6h",
            "iec-60309-2p-e-9h",
            "iec-60309-3p-e-4h",
            "iec-60309-3p-e-6h",
            "iec-60309-3p-e-9h",
            "iec-60309-3p-n-e-4h",
            "iec-60309-3p-n-e-6h",
            "iec-60309-3p-n-e-9h",
            "iec-60906-1",
            "nbr-14136-10a",
            "nbr-14136-20a",
            "nema-1-15p",
            "nema-5-15p",
            "nema-5-20p",
            "nema-5-30p",
            "nema-5-50p",
            "nema-6-15p",
            "nema-6-20p",
            "nema-6-30p",
            "nema-6-50p",
            "nema-10-30p",
            "nema-10-50p",
            "nema-14-20p",
            "nema-14-30p",
            "nema-14-50p",
            "nema-14-60p",
            "nema-15-15p",
            "nema-15-20p",
            "nema-15-30p",
            "nema-15-50p",
            "nema-15-60p",
            "nema-l1-15p",
            "nema-l5-15p",
            "nema-l5-20p",
            "nema-l5-30p",
            "nema-l5-50p",
            "nema-l6-15p",
            "nema-l6-20p",
            "nema-l6-30p",
            "nema-l6-50p",
            "nema-l10-30p",
            "nema-l14-20p",
            "nema-l14-30p",
            "nema-l14-50p",
            "nema-l14-60p",
            "nema-l15-20p",
            "nema-l15-30p",
            "nema-l15-50p",
            "nema-l15-60p",
            "nema-l21-20p",
            "nema-l21-30p",
            "nema-l22-20p",
            "nema-l22-30p",
            "cs6361c",
            "cs6365c",
            "cs8165c",
            "cs8265c",
            "cs8365c",
            "cs8465c",
            "ita-c",
            "ita-e",
            "ita-f",
            "ita-ef",
            "ita-g",
            "ita-h",
            "ita-i",
            "ita-j",
            "ita-k",
            "ita-l",
            "ita-m",
            "ita-n",
            "ita-o",
            "usb-a",
            "usb-b",
            "usb-c",
            "usb-mini-a",
            "usb-mini-b",
            "usb-micro-a",
            "usb-micro-b",
            "usb-micro-ab",
            "usb-3-b",
            "usb-3-micro-b",
            "molex-micro-fit-1x2",
            "molex-micro-fit-2x2",
            "molex-micro-fit-2x4",
            "dc-terminal",
            "saf-d-grid",
            "neutrik-powercon-20",
            "neutrik-powercon-32",
            "neutrik-powercon-true1",
            "neutrik-powercon-true1-top",
            "ubiquiti-smartpower",
            "hardwired",
            "other",
            "",
        ]
        | None
    ) = Field(
        None,
        description="Physical port type\n\n* `iec-60320-c6` - C6\n* `iec-60320-c8` - C8\n* `iec-60320-c14` - C14\n* `iec-60320-c16` - C16\n* `iec-60320-c20` - C20\n* `iec-60320-c22` - C22\n* `iec-60309-p-n-e-4h` - P+N+E 4H\n* `iec-60309-p-n-e-6h` - P+N+E 6H\n* `iec-60309-p-n-e-9h` - P+N+E 9H\n* `iec-60309-2p-e-4h` - 2P+E 4H\n* `iec-60309-2p-e-6h` - 2P+E 6H\n* `iec-60309-2p-e-9h` - 2P+E 9H\n* `iec-60309-3p-e-4h` - 3P+E 4H\n* `iec-60309-3p-e-6h` - 3P+E 6H\n* `iec-60309-3p-e-9h` - 3P+E 9H\n* `iec-60309-3p-n-e-4h` - 3P+N+E 4H\n* `iec-60309-3p-n-e-6h` - 3P+N+E 6H\n* `iec-60309-3p-n-e-9h` - 3P+N+E 9H\n* `iec-60906-1` - IEC 60906-1\n* `nbr-14136-10a` - 2P+T 10A (NBR 14136)\n* `nbr-14136-20a` - 2P+T 20A (NBR 14136)\n* `nema-1-15p` - NEMA 1-15P\n* `nema-5-15p` - NEMA 5-15P\n* `nema-5-20p` - NEMA 5-20P\n* `nema-5-30p` - NEMA 5-30P\n* `nema-5-50p` - NEMA 5-50P\n* `nema-6-15p` - NEMA 6-15P\n* `nema-6-20p` - NEMA 6-20P\n* `nema-6-30p` - NEMA 6-30P\n* `nema-6-50p` - NEMA 6-50P\n* `nema-10-30p` - NEMA 10-30P\n* `nema-10-50p` - NEMA 10-50P\n* `nema-14-20p` - NEMA 14-20P\n* `nema-14-30p` - NEMA 14-30P\n* `nema-14-50p` - NEMA 14-50P\n* `nema-14-60p` - NEMA 14-60P\n* `nema-15-15p` - NEMA 15-15P\n* `nema-15-20p` - NEMA 15-20P\n* `nema-15-30p` - NEMA 15-30P\n* `nema-15-50p` - NEMA 15-50P\n* `nema-15-60p` - NEMA 15-60P\n* `nema-l1-15p` - NEMA L1-15P\n* `nema-l5-15p` - NEMA L5-15P\n* `nema-l5-20p` - NEMA L5-20P\n* `nema-l5-30p` - NEMA L5-30P\n* `nema-l5-50p` - NEMA L5-50P\n* `nema-l6-15p` - NEMA L6-15P\n* `nema-l6-20p` - NEMA L6-20P\n* `nema-l6-30p` - NEMA L6-30P\n* `nema-l6-50p` - NEMA L6-50P\n* `nema-l10-30p` - NEMA L10-30P\n* `nema-l14-20p` - NEMA L14-20P\n* `nema-l14-30p` - NEMA L14-30P\n* `nema-l14-50p` - NEMA L14-50P\n* `nema-l14-60p` - NEMA L14-60P\n* `nema-l15-20p` - NEMA L15-20P\n* `nema-l15-30p` - NEMA L15-30P\n* `nema-l15-50p` - NEMA L15-50P\n* `nema-l15-60p` - NEMA L15-60P\n* `nema-l21-20p` - NEMA L21-20P\n* `nema-l21-30p` - NEMA L21-30P\n* `nema-l22-20p` - NEMA L22-20P\n* `nema-l22-30p` - NEMA L22-30P\n* `cs6361c` - CS6361C\n* `cs6365c` - CS6365C\n* `cs8165c` - CS8165C\n* `cs8265c` - CS8265C\n* `cs8365c` - CS8365C\n* `cs8465c` - CS8465C\n* `ita-c` - ITA Type C (CEE 7/16)\n* `ita-e` - ITA Type E (CEE 7/6)\n* `ita-f` - ITA Type F (CEE 7/4)\n* `ita-ef` - ITA Type E/F (CEE 7/7)\n* `ita-g` - ITA Type G (BS 1363)\n* `ita-h` - ITA Type H\n* `ita-i` - ITA Type I\n* `ita-j` - ITA Type J\n* `ita-k` - ITA Type K\n* `ita-l` - ITA Type L (CEI 23-50)\n* `ita-m` - ITA Type M (BS 546)\n* `ita-n` - ITA Type N\n* `ita-o` - ITA Type O\n* `usb-a` - USB Type A\n* `usb-b` - USB Type B\n* `usb-c` - USB Type C\n* `usb-mini-a` - USB Mini A\n* `usb-mini-b` - USB Mini B\n* `usb-micro-a` - USB Micro A\n* `usb-micro-b` - USB Micro B\n* `usb-micro-ab` - USB Micro AB\n* `usb-3-b` - USB 3.0 Type B\n* `usb-3-micro-b` - USB 3.0 Micro B\n* `molex-micro-fit-1x2` - Molex Micro-Fit 1x2\n* `molex-micro-fit-2x2` - Molex Micro-Fit 2x2\n* `molex-micro-fit-2x4` - Molex Micro-Fit 2x4\n* `dc-terminal` - DC Terminal\n* `saf-d-grid` - Saf-D-Grid\n* `neutrik-powercon-20` - Neutrik powerCON (20A)\n* `neutrik-powercon-32` - Neutrik powerCON (32A)\n* `neutrik-powercon-true1` - Neutrik powerCON TRUE1\n* `neutrik-powercon-true1-top` - Neutrik powerCON TRUE1 TOP\n* `ubiquiti-smartpower` - Ubiquiti SmartPower\n* `hardwired` - Hardwired\n* `other` - Other",
    )
    maximum_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Maximum power draw (watts)"
    )
    allocated_draw: conint(ge=1, le=2147483647) | None = Field(
        None, description="Allocated power draw (watts)"
    )
    description: constr(max_length=200) | None = None
    mark_connected: bool | None = Field(None, description="Treat as if a cable is connected")
    tags: list[NestedTagRequest] | None = None
    custom_fields: dict[str, Any] | None = None


class WritablePowerPortTemplateRequest(PowerPortTemplateRequest):
    pass


class WritableRearPortRequest(RearPortRequest):
    pass


class WritableRearPortTemplateRequest(RearPortTemplateRequest):
    pass


class ConfigContext(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    weight: conint(ge=0, le=32767) | None = None
    description: constr(max_length=200) | None = None
    is_active: bool | None = None
    regions: list[Region] | None = None
    site_groups: list[SiteGroup] | None = None
    sites: list[Site] | None = None
    locations: list[Location] | None = None
    device_types: list[DeviceType] | None = None
    roles: list[DeviceRole] | None = None
    platforms: list[Platform] | None = None
    cluster_types: list[ClusterType] | None = None
    cluster_groups: list[ClusterGroup] | None = None
    clusters: list[Cluster] | None = None
    tenant_groups: list[TenantGroup] | None = None
    tenants: list[Tenant] | None = None
    tags: list[str] | None = None
    data_source: BriefDataSource | None = None
    data_path: str = Field(..., description="Path to remote file (relative to data source root)")
    data_file: BriefDataFile
    data_synced: DateSynced | None = Field(None, title="Date synced")
    data: Any
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class Contact(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    groups: list[ContactGroup] | None = None
    name: constr(max_length=100)
    title: constr(max_length=100) | None = None
    phone: constr(max_length=50) | None = None
    email: EmailStr | None = None
    address: constr(max_length=200) | None = None
    link: AnyUrl | None = None
    description: constr(max_length=200) | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class IKEPolicy(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    version: Version
    mode: Mode | None = None
    proposals: list[IKEProposal] | None = None
    preshared_key: PreSharedKey | None = Field(None, title="Pre-shared key")
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class IPSecPolicy(BaseModel):
    id: int
    url: AnyUrl
    display_url: AnyUrl | None = None
    display: str
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    proposals: list[IPSecProposal] | None = None
    pfs_group: PfsGroup | None = None
    comments: str | None = None
    tags: list[NestedTag] | None = None
    custom_fields: dict[str, Any] | None = None
    created: AwareDatetime | None = None
    last_updated: AwareDatetime | None = None


class NotificationGroup(BaseModel):
    id: int
    url: AnyUrl
    display: str
    display_url: AnyUrl | None = None
    name: constr(max_length=100)
    description: constr(max_length=200) | None = None
    groups: list[Group] | None = None
    users: list[User] | None = None


class PaginatedConfigContextList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[ConfigContext]


class PaginatedContactList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Contact]


class PaginatedIKEPolicyList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[IKEPolicy]


class PaginatedIPSecPolicyList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[IPSecPolicy]


class PaginatedNotificationGroupList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[NotificationGroup]


class PaginatedPowerOutletList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[PowerOutlet]


class PaginatedPowerOutletTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[PowerOutletTemplate]


class PaginatedPowerPortList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[PowerPort]


class PaginatedPowerPortTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[PowerPortTemplate]


class PaginatedProviderList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Provider]


class PaginatedRearPortList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[RearPort]


class PaginatedRearPortTemplateList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[RearPortTemplate]


class PaginatedScriptList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Script]


class PaginatedServiceList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Service]


class PaginatedSiteList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[Site]


class PaginatedUserList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[User]


class PaginatedVLANTranslationPolicyList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VLANTranslationPolicy]


class PaginatedVMInterfaceList(BaseModel):
    count: int = Field(..., examples=[123])
    next: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=400&limit=100"]
    )
    previous: AnyUrl | None = Field(
        None, examples=["http://api.example.org/accounts/?offset=200&limit=100"]
    )
    results: list[VMInterface]
