"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .activemq import Activemq, ActivemqTypedDict
from .amqp import Amqp, AmqpTypedDict
from .anyconnect import AnyConnect, AnyConnectTypedDict
from .asteriskmanagerinterface import (
    AsteriskManagerInterface,
    AsteriskManagerInterfaceTypedDict,
)
from .attribute import Attribute, AttributeTypedDict
from .bacnet import Bacnet, BacnetTypedDict
from .certificate import Certificate, CertificateTypedDict
from .checkpointtopology import CheckpointTopology, CheckpointTopologyTypedDict
from .chromecast import Chromecast, ChromecastTypedDict
from .ciscoipsla import CiscoIpsla, CiscoIpslaTypedDict
from .cmore import Cmore, CmoreTypedDict
from .coap import Coap, CoapTypedDict
from .crestroncp3 import CrestronCp3, CrestronCp3TypedDict
from .crestrondinap2 import CrestronDinAp2, CrestronDinAp2TypedDict
from .cwmp import Cwmp, CwmpTypedDict
from .darkcomet import Darkcomet, DarkcometTypedDict
from .darkgate import Darkgate, DarkgateTypedDict
from .dcerpc import Dcerpc, DcerpcTypedDict
from .dhcpdiscover import Dhcpdiscover, DhcpdiscoverTypedDict
from .dnp3 import Dnp3, Dnp3TypedDict
from .dns import DNS, DNSTypedDict
from .dtls import Dtls, DtlsTypedDict
from .dvrip import DvrIP, DvrIPTypedDict
from .eip import Eip, EipTypedDict
from .elffile import ElfFile, ElfFileTypedDict
from .endpointscanstate import EndpointScanState, EndpointScanStateTypedDict
from .epmd import Epmd, EpmdTypedDict
from .etcd import Etcd, EtcdTypedDict
from .ethereum import Ethereum, EthereumTypedDict
from .fox import Fox, FoxTypedDict
from .ftp import Ftp, FtpTypedDict
from .gearman import Gearman, GearmanTypedDict
from .hidvertx import HidVertx, HidVertxTypedDict
from .hikvision import Hikvision, HikvisionTypedDict
from .ibmnje import Ibmnje, IbmnjeTypedDict
from .ike import Ike, IkeTypedDict
from .imap import Imap, ImapTypedDict
from .iota import Iota, IotaTypedDict
from .ipmi import Ipmi, IpmiTypedDict
from .ipp import Ipp, IppTypedDict
from .iscsi import Iscsi, IscsiTypedDict
from .ja4tscanscan import Ja4TScanScan, Ja4TScanScanTypedDict
from .jarmscan import JarmScan, JarmScanTypedDict
from .krpc import Krpc, KrpcTypedDict
from .l2tp import L2Tp, L2TpTypedDict
from .label import Label, LabelTypedDict
from .ldap import Ldap, LdapTypedDict
from .lpd import Lpd, LpdTypedDict
from .mdns import Mdns, MdnsTypedDict
from .memcached import Memcached, MemcachedTypedDict
from .mikrotikwinbox import MikrotikWinbox, MikrotikWinboxTypedDict
from .minecraft import Minecraft, MinecraftTypedDict
from .mms import Mms, MmsTypedDict
from .modbus import Modbus, ModbusTypedDict
from .monerop2p import MoneroP2P, MoneroP2PTypedDict
from .mongodb import Mongodb, MongodbTypedDict
from .mqtt import Mqtt, MqttTypedDict
from .mssql import Mssql, MssqlTypedDict
from .murmur import Murmur, MurmurTypedDict
from .mysql import Mysql, MysqlTypedDict
from .natsio import NatsIo, NatsIoTypedDict
from .nbd import Nbd, NbdTypedDict
from .nfsmountd import NfsMountd, NfsMountdTypedDict
from .nmea import Nmea, NmeaTypedDict
from .ntp import Ntp, NtpTypedDict
from .ntrip import Ntrip, NtripTypedDict
from .onc import Onc, OncTypedDict
from .onvif import Onvif, OnvifTypedDict
from .opcua import OpcUa, OpcUaTypedDict
from .openvpn import Openvpn, OpenvpnTypedDict
from .openvpnmgmt import OpenvpnMgmt, OpenvpnMgmtTypedDict
from .oracle import Oracle, OracleTypedDict
from .pcanywhere import PcAnywhere, PcAnywhereTypedDict
from .pgbouncer import Pgbouncer, PgbouncerTypedDict
from .pop3 import Pop3, Pop3TypedDict
from .portmap import Portmap, PortmapTypedDict
from .postgres import Postgres, PostgresTypedDict
from .pptp import Pptp, PptpTypedDict
from .profinetcm import ProfinetCm, ProfinetCmTypedDict
from .rdate import Rdate, RdateTypedDict
from .rdp import Rdp, RdpTypedDict
from .realport import Realport, RealportTypedDict
from .redis import Redis, RedisTypedDict
from .redline import Redline, RedlineTypedDict
from .redlioncrimson import RedlionCrimson, RedlionCrimsonTypedDict
from .representativeinfo import RepresentativeInfo, RepresentativeInfoTypedDict
from .rifatron import Rifatron, RifatronTypedDict
from .ripple import Ripple, RippleTypedDict
from .risk import Risk, RiskTypedDict
from .rlogin import Rlogin, RloginTypedDict
from .rocketmq import Rocketmq, RocketmqTypedDict
from .rtsp import Rtsp, RtspTypedDict
from .s7 import S7, S7TypedDict
from .saprouter import SapRouter, SapRouterTypedDict
from .scpi import Scpi, ScpiTypedDict
from .screenshot import Screenshot, ScreenshotTypedDict
from .ser2net import Ser2Net, Ser2NetTypedDict
from .sevendaystodie import SevenDaysToDie, SevenDaysToDieTypedDict
from .sip import Sip, SipTypedDict
from .skinny import Skinny, SkinnyTypedDict
from .smb import Smb, SmbTypedDict
from .smtp import SMTP, SMTPTypedDict
from .snmp import Snmp, SnmpTypedDict
from .socks import Socks, SocksTypedDict
from .spice import Spice, SpiceTypedDict
from .ssdp import Ssdp, SsdpTypedDict
from .ssh import SSH, SSHTypedDict
from .steam import Steam, SteamTypedDict
from .tacacsplus import TacacsPlus, TacacsPlusTypedDict
from .teamviewer import TeamViewer, TeamViewerTypedDict
from .telnet import Telnet, TelnetTypedDict
from .threat import Threat, ThreatTypedDict
from .tibia import Tibia, TibiaTypedDict
from .tls import TLS, TLSTypedDict
from .tplinkkasa import TplinkKasa, TplinkKasaTypedDict
from .unitronicspcom import UnitronicsPcom, UnitronicsPcomTypedDict
from .upnp import Upnp, UpnpTypedDict
from .ventrilo import Ventrilo, VentriloTypedDict
from .vnc import Vnc, VncTypedDict
from .vuln import Vuln, VulnTypedDict
from .weblogict3 import WeblogicT3, WeblogicT3TypedDict
from .winrm import Winrm, WinrmTypedDict
from .wsdiscovery import WsDiscovery, WsDiscoveryTypedDict
from .x11 import X11, X11TypedDict
from .zeromq import Zeromq, ZeromqTypedDict
from censys_platform.types import (
    BaseModel,
    Nullable,
    OptionalNullable,
    UNSET,
    UNSET_SENTINEL,
)
from enum import Enum
from pydantic import model_serializer
from typing import List, Optional
from typing_extensions import NotRequired, TypedDict


class ServiceTransportProtocol(str, Enum):
    UNKNOWN = ""
    TCP = "tcp"
    UDP = "udp"
    ICMP = "icmp"
    QUIC = "quic"


class ServiceTypedDict(TypedDict):
    activemq: NotRequired[ActivemqTypedDict]
    amqp: NotRequired[AmqpTypedDict]
    any_connect: NotRequired[AnyConnectTypedDict]
    asterisk_manager_interface: NotRequired[AsteriskManagerInterfaceTypedDict]
    bacnet: NotRequired[BacnetTypedDict]
    banner: NotRequired[str]
    banner_hash_sha256: NotRequired[str]
    banner_hex: NotRequired[str]
    cert: NotRequired[CertificateTypedDict]
    checkpoint_topology: NotRequired[CheckpointTopologyTypedDict]
    chromecast: NotRequired[ChromecastTypedDict]
    cisco_ipsla: NotRequired[CiscoIpslaTypedDict]
    cmore: NotRequired[CmoreTypedDict]
    coap: NotRequired[CoapTypedDict]
    crestron_cp3: NotRequired[CrestronCp3TypedDict]
    crestron_din_ap2: NotRequired[CrestronDinAp2TypedDict]
    cwmp: NotRequired[CwmpTypedDict]
    darkcomet: NotRequired[DarkcometTypedDict]
    darkgate: NotRequired[DarkgateTypedDict]
    dcerpc: NotRequired[DcerpcTypedDict]
    dhcpdiscover: NotRequired[DhcpdiscoverTypedDict]
    dnp3: NotRequired[Dnp3TypedDict]
    dns: NotRequired[DNSTypedDict]
    dtls: NotRequired[DtlsTypedDict]
    dvr_ip: NotRequired[DvrIPTypedDict]
    eip: NotRequired[EipTypedDict]
    elf_file: NotRequired[ElfFileTypedDict]
    endpoints: NotRequired[Nullable[List[EndpointScanStateTypedDict]]]
    epmd: NotRequired[EpmdTypedDict]
    etcd: NotRequired[EtcdTypedDict]
    ethereum: NotRequired[EthereumTypedDict]
    exposures: NotRequired[Nullable[List[RiskTypedDict]]]
    fox: NotRequired[FoxTypedDict]
    ftp: NotRequired[FtpTypedDict]
    gearman: NotRequired[GearmanTypedDict]
    hardware: NotRequired[Nullable[List[AttributeTypedDict]]]
    hid_vertx: NotRequired[HidVertxTypedDict]
    hikvision: NotRequired[HikvisionTypedDict]
    ibmnje: NotRequired[IbmnjeTypedDict]
    ike: NotRequired[IkeTypedDict]
    imap: NotRequired[ImapTypedDict]
    iota: NotRequired[IotaTypedDict]
    ip: NotRequired[str]
    ipmi: NotRequired[IpmiTypedDict]
    ipp: NotRequired[IppTypedDict]
    iscsi: NotRequired[IscsiTypedDict]
    ja4tscan: NotRequired[Ja4TScanScanTypedDict]
    jarm: NotRequired[JarmScanTypedDict]
    krpc: NotRequired[KrpcTypedDict]
    l2tp: NotRequired[L2TpTypedDict]
    labels: NotRequired[Nullable[List[LabelTypedDict]]]
    ldap: NotRequired[LdapTypedDict]
    lpd: NotRequired[LpdTypedDict]
    mdns: NotRequired[MdnsTypedDict]
    memcached: NotRequired[MemcachedTypedDict]
    mikrotik_winbox: NotRequired[MikrotikWinboxTypedDict]
    minecraft: NotRequired[MinecraftTypedDict]
    misconfigs: NotRequired[Nullable[List[RiskTypedDict]]]
    mms: NotRequired[MmsTypedDict]
    modbus: NotRequired[ModbusTypedDict]
    monero_p2p: NotRequired[MoneroP2PTypedDict]
    mongodb: NotRequired[MongodbTypedDict]
    mqtt: NotRequired[MqttTypedDict]
    mssql: NotRequired[MssqlTypedDict]
    murmur: NotRequired[MurmurTypedDict]
    mysql: NotRequired[MysqlTypedDict]
    nats_io: NotRequired[NatsIoTypedDict]
    nbd: NotRequired[NbdTypedDict]
    nfs_mountd: NotRequired[NfsMountdTypedDict]
    nmea: NotRequired[NmeaTypedDict]
    ntp: NotRequired[NtpTypedDict]
    ntrip: NotRequired[NtripTypedDict]
    onc: NotRequired[OncTypedDict]
    onvif: NotRequired[OnvifTypedDict]
    opc_ua: NotRequired[OpcUaTypedDict]
    openvpn: NotRequired[OpenvpnTypedDict]
    openvpn_mgmt: NotRequired[OpenvpnMgmtTypedDict]
    operating_systems: NotRequired[Nullable[List[AttributeTypedDict]]]
    oracle: NotRequired[OracleTypedDict]
    pc_anywhere: NotRequired[PcAnywhereTypedDict]
    pgbouncer: NotRequired[PgbouncerTypedDict]
    pop3: NotRequired[Pop3TypedDict]
    port: NotRequired[int]
    portmap: NotRequired[PortmapTypedDict]
    postgres: NotRequired[PostgresTypedDict]
    pptp: NotRequired[PptpTypedDict]
    profinet_cm: NotRequired[ProfinetCmTypedDict]
    protocol: NotRequired[str]
    rdate: NotRequired[RdateTypedDict]
    rdp: NotRequired[RdpTypedDict]
    realport: NotRequired[RealportTypedDict]
    redis: NotRequired[RedisTypedDict]
    redline: NotRequired[RedlineTypedDict]
    redlion_crimson: NotRequired[RedlionCrimsonTypedDict]
    representative_info: NotRequired[RepresentativeInfoTypedDict]
    rifatron: NotRequired[RifatronTypedDict]
    ripple: NotRequired[RippleTypedDict]
    rlogin: NotRequired[RloginTypedDict]
    rocketmq: NotRequired[RocketmqTypedDict]
    rtsp: NotRequired[RtspTypedDict]
    s7: NotRequired[S7TypedDict]
    sap_router: NotRequired[SapRouterTypedDict]
    scan_time: NotRequired[str]
    scpi: NotRequired[ScpiTypedDict]
    screenshots: NotRequired[Nullable[List[ScreenshotTypedDict]]]
    ser2net: NotRequired[Ser2NetTypedDict]
    seven_days_to_die: NotRequired[SevenDaysToDieTypedDict]
    sip: NotRequired[SipTypedDict]
    skinny: NotRequired[SkinnyTypedDict]
    smb: NotRequired[SmbTypedDict]
    smtp: NotRequired[SMTPTypedDict]
    snmp: NotRequired[SnmpTypedDict]
    socks: NotRequired[SocksTypedDict]
    software: NotRequired[Nullable[List[AttributeTypedDict]]]
    spice: NotRequired[SpiceTypedDict]
    ssdp: NotRequired[SsdpTypedDict]
    ssh: NotRequired[SSHTypedDict]
    steam: NotRequired[SteamTypedDict]
    tacacs_plus: NotRequired[TacacsPlusTypedDict]
    team_viewer: NotRequired[TeamViewerTypedDict]
    telnet: NotRequired[TelnetTypedDict]
    threats: NotRequired[Nullable[List[ThreatTypedDict]]]
    tibia: NotRequired[TibiaTypedDict]
    tls: NotRequired[TLSTypedDict]
    tplink_kasa: NotRequired[TplinkKasaTypedDict]
    transport_protocol: NotRequired[ServiceTransportProtocol]
    unitronics_pcom: NotRequired[UnitronicsPcomTypedDict]
    upnp: NotRequired[UpnpTypedDict]
    ventrilo: NotRequired[VentriloTypedDict]
    vnc: NotRequired[VncTypedDict]
    vulns: NotRequired[Nullable[List[VulnTypedDict]]]
    weblogic_t3: NotRequired[WeblogicT3TypedDict]
    winrm: NotRequired[WinrmTypedDict]
    ws_discovery: NotRequired[WsDiscoveryTypedDict]
    x11: NotRequired[X11TypedDict]
    zeromq: NotRequired[ZeromqTypedDict]


class Service(BaseModel):
    activemq: Optional[Activemq] = None

    amqp: Optional[Amqp] = None

    any_connect: Optional[AnyConnect] = None

    asterisk_manager_interface: Optional[AsteriskManagerInterface] = None

    bacnet: Optional[Bacnet] = None

    banner: Optional[str] = None

    banner_hash_sha256: Optional[str] = None

    banner_hex: Optional[str] = None

    cert: Optional[Certificate] = None

    checkpoint_topology: Optional[CheckpointTopology] = None

    chromecast: Optional[Chromecast] = None

    cisco_ipsla: Optional[CiscoIpsla] = None

    cmore: Optional[Cmore] = None

    coap: Optional[Coap] = None

    crestron_cp3: Optional[CrestronCp3] = None

    crestron_din_ap2: Optional[CrestronDinAp2] = None

    cwmp: Optional[Cwmp] = None

    darkcomet: Optional[Darkcomet] = None

    darkgate: Optional[Darkgate] = None

    dcerpc: Optional[Dcerpc] = None

    dhcpdiscover: Optional[Dhcpdiscover] = None

    dnp3: Optional[Dnp3] = None

    dns: Optional[DNS] = None

    dtls: Optional[Dtls] = None

    dvr_ip: Optional[DvrIP] = None

    eip: Optional[Eip] = None

    elf_file: Optional[ElfFile] = None

    endpoints: OptionalNullable[List[EndpointScanState]] = UNSET

    epmd: Optional[Epmd] = None

    etcd: Optional[Etcd] = None

    ethereum: Optional[Ethereum] = None

    exposures: OptionalNullable[List[Risk]] = UNSET

    fox: Optional[Fox] = None

    ftp: Optional[Ftp] = None

    gearman: Optional[Gearman] = None

    hardware: OptionalNullable[List[Attribute]] = UNSET

    hid_vertx: Optional[HidVertx] = None

    hikvision: Optional[Hikvision] = None

    ibmnje: Optional[Ibmnje] = None

    ike: Optional[Ike] = None

    imap: Optional[Imap] = None

    iota: Optional[Iota] = None

    ip: Optional[str] = None

    ipmi: Optional[Ipmi] = None

    ipp: Optional[Ipp] = None

    iscsi: Optional[Iscsi] = None

    ja4tscan: Optional[Ja4TScanScan] = None

    jarm: Optional[JarmScan] = None

    krpc: Optional[Krpc] = None

    l2tp: Optional[L2Tp] = None

    labels: OptionalNullable[List[Label]] = UNSET

    ldap: Optional[Ldap] = None

    lpd: Optional[Lpd] = None

    mdns: Optional[Mdns] = None

    memcached: Optional[Memcached] = None

    mikrotik_winbox: Optional[MikrotikWinbox] = None

    minecraft: Optional[Minecraft] = None

    misconfigs: OptionalNullable[List[Risk]] = UNSET

    mms: Optional[Mms] = None

    modbus: Optional[Modbus] = None

    monero_p2p: Optional[MoneroP2P] = None

    mongodb: Optional[Mongodb] = None

    mqtt: Optional[Mqtt] = None

    mssql: Optional[Mssql] = None

    murmur: Optional[Murmur] = None

    mysql: Optional[Mysql] = None

    nats_io: Optional[NatsIo] = None

    nbd: Optional[Nbd] = None

    nfs_mountd: Optional[NfsMountd] = None

    nmea: Optional[Nmea] = None

    ntp: Optional[Ntp] = None

    ntrip: Optional[Ntrip] = None

    onc: Optional[Onc] = None

    onvif: Optional[Onvif] = None

    opc_ua: Optional[OpcUa] = None

    openvpn: Optional[Openvpn] = None

    openvpn_mgmt: Optional[OpenvpnMgmt] = None

    operating_systems: OptionalNullable[List[Attribute]] = UNSET

    oracle: Optional[Oracle] = None

    pc_anywhere: Optional[PcAnywhere] = None

    pgbouncer: Optional[Pgbouncer] = None

    pop3: Optional[Pop3] = None

    port: Optional[int] = None

    portmap: Optional[Portmap] = None

    postgres: Optional[Postgres] = None

    pptp: Optional[Pptp] = None

    profinet_cm: Optional[ProfinetCm] = None

    protocol: Optional[str] = None

    rdate: Optional[Rdate] = None

    rdp: Optional[Rdp] = None

    realport: Optional[Realport] = None

    redis: Optional[Redis] = None

    redline: Optional[Redline] = None

    redlion_crimson: Optional[RedlionCrimson] = None

    representative_info: Optional[RepresentativeInfo] = None

    rifatron: Optional[Rifatron] = None

    ripple: Optional[Ripple] = None

    rlogin: Optional[Rlogin] = None

    rocketmq: Optional[Rocketmq] = None

    rtsp: Optional[Rtsp] = None

    s7: Optional[S7] = None

    sap_router: Optional[SapRouter] = None

    scan_time: Optional[str] = None

    scpi: Optional[Scpi] = None

    screenshots: OptionalNullable[List[Screenshot]] = UNSET

    ser2net: Optional[Ser2Net] = None

    seven_days_to_die: Optional[SevenDaysToDie] = None

    sip: Optional[Sip] = None

    skinny: Optional[Skinny] = None

    smb: Optional[Smb] = None

    smtp: Optional[SMTP] = None

    snmp: Optional[Snmp] = None

    socks: Optional[Socks] = None

    software: OptionalNullable[List[Attribute]] = UNSET

    spice: Optional[Spice] = None

    ssdp: Optional[Ssdp] = None

    ssh: Optional[SSH] = None

    steam: Optional[Steam] = None

    tacacs_plus: Optional[TacacsPlus] = None

    team_viewer: Optional[TeamViewer] = None

    telnet: Optional[Telnet] = None

    threats: OptionalNullable[List[Threat]] = UNSET

    tibia: Optional[Tibia] = None

    tls: Optional[TLS] = None

    tplink_kasa: Optional[TplinkKasa] = None

    transport_protocol: Optional[ServiceTransportProtocol] = None

    unitronics_pcom: Optional[UnitronicsPcom] = None

    upnp: Optional[Upnp] = None

    ventrilo: Optional[Ventrilo] = None

    vnc: Optional[Vnc] = None

    vulns: OptionalNullable[List[Vuln]] = UNSET

    weblogic_t3: Optional[WeblogicT3] = None

    winrm: Optional[Winrm] = None

    ws_discovery: Optional[WsDiscovery] = None

    x11: Optional[X11] = None

    zeromq: Optional[Zeromq] = None

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = [
            "activemq",
            "amqp",
            "any_connect",
            "asterisk_manager_interface",
            "bacnet",
            "banner",
            "banner_hash_sha256",
            "banner_hex",
            "cert",
            "checkpoint_topology",
            "chromecast",
            "cisco_ipsla",
            "cmore",
            "coap",
            "crestron_cp3",
            "crestron_din_ap2",
            "cwmp",
            "darkcomet",
            "darkgate",
            "dcerpc",
            "dhcpdiscover",
            "dnp3",
            "dns",
            "dtls",
            "dvr_ip",
            "eip",
            "elf_file",
            "endpoints",
            "epmd",
            "etcd",
            "ethereum",
            "exposures",
            "fox",
            "ftp",
            "gearman",
            "hardware",
            "hid_vertx",
            "hikvision",
            "ibmnje",
            "ike",
            "imap",
            "iota",
            "ip",
            "ipmi",
            "ipp",
            "iscsi",
            "ja4tscan",
            "jarm",
            "krpc",
            "l2tp",
            "labels",
            "ldap",
            "lpd",
            "mdns",
            "memcached",
            "mikrotik_winbox",
            "minecraft",
            "misconfigs",
            "mms",
            "modbus",
            "monero_p2p",
            "mongodb",
            "mqtt",
            "mssql",
            "murmur",
            "mysql",
            "nats_io",
            "nbd",
            "nfs_mountd",
            "nmea",
            "ntp",
            "ntrip",
            "onc",
            "onvif",
            "opc_ua",
            "openvpn",
            "openvpn_mgmt",
            "operating_systems",
            "oracle",
            "pc_anywhere",
            "pgbouncer",
            "pop3",
            "port",
            "portmap",
            "postgres",
            "pptp",
            "profinet_cm",
            "protocol",
            "rdate",
            "rdp",
            "realport",
            "redis",
            "redline",
            "redlion_crimson",
            "representative_info",
            "rifatron",
            "ripple",
            "rlogin",
            "rocketmq",
            "rtsp",
            "s7",
            "sap_router",
            "scan_time",
            "scpi",
            "screenshots",
            "ser2net",
            "seven_days_to_die",
            "sip",
            "skinny",
            "smb",
            "smtp",
            "snmp",
            "socks",
            "software",
            "spice",
            "ssdp",
            "ssh",
            "steam",
            "tacacs_plus",
            "team_viewer",
            "telnet",
            "threats",
            "tibia",
            "tls",
            "tplink_kasa",
            "transport_protocol",
            "unitronics_pcom",
            "upnp",
            "ventrilo",
            "vnc",
            "vulns",
            "weblogic_t3",
            "winrm",
            "ws_discovery",
            "x11",
            "zeromq",
        ]
        nullable_fields = [
            "endpoints",
            "exposures",
            "hardware",
            "labels",
            "misconfigs",
            "operating_systems",
            "screenshots",
            "software",
            "threats",
            "vulns",
        ]
        null_default_fields = []

        serialized = handler(self)

        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k)
            serialized.pop(k, None)

            optional_nullable = k in optional_fields and k in nullable_fields
            is_set = (
                self.__pydantic_fields_set__.intersection({n})
                or k in null_default_fields
            )  # pylint: disable=no-member

            if val is not None and val != UNSET_SENTINEL:
                m[k] = val
            elif val != UNSET_SENTINEL and (
                not k in optional_fields or (optional_nullable and is_set)
            ):
                m[k] = val

        return m
