# generated by datamodel-codegen:
#   filename:  jsonschema.json
#   timestamp: 2025-01-31T08:28:40+00:00

from __future__ import annotations

from typing import List, Optional

from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated


class Ipv4Type(RootModel[str]):
    model_config = ConfigDict(
        regex_engine="python-re",
    )
    root: Annotated[str, Field(pattern='^(?=^(\\d{1,3}\\.){3}\\d{1,3}$).*$')]


class NameLeaf(RootModel[str]):
    root: Annotated[str, Field(description='Interface name')]


class VlanIdType(RootModel[int]):
    root: Annotated[int, Field(ge=1, le=4094)]


class IpLeafList(RootModel[Ipv4Type]):
    root: Annotated[Ipv4Type, Field(description='List of interface IPs')]


class TaggedLeafList(RootModel[VlanIdType]):
    root: Annotated[VlanIdType, Field(description='List of tagged VLANs')]


class UntaggedLeaf(RootModel[VlanIdType]):
    root: Annotated[VlanIdType, Field(description='Untagged VLAN')]


class InterfacesListEntry(BaseModel):
    interfaces_name: Annotated[Optional[NameLeaf], Field(alias='interfaces:name')] = (
        None
    )
    interfaces_ip: Annotated[
        Optional[List[IpLeafList]],
        Field(alias='interfaces:ip', description='List of interface IPs'),
    ] = []
    interfaces_tagged: Annotated[
        Optional[List[TaggedLeafList]],
        Field(alias='interfaces:tagged', description='List of tagged VLANs'),
    ] = []
    interfaces_untagged: Annotated[
        Optional[UntaggedLeaf], Field(alias='interfaces:untagged')
    ] = None


class Model(BaseModel):
    interfaces_interfaces: Annotated[
        Optional[List[InterfacesListEntry]], Field(alias='interfaces:interfaces')
    ] = None
