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

from __future__ import annotations
from censys_platform.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict


class NTPNTPHeaderTypedDict(TypedDict):
    leap_indicator: NotRequired[int]
    r"""An enumerated value from 0 to 3 signifying whether a leap second will occur at the end of the current month. 0 signifies no leap second, 1 signifies an additive leap second, 2 signifies a subtractive leap second, and 3 signifies the state is unknown."""
    mode: NotRequired[int]
    r"""An enumerated value from 0 to 7 signifying the operational mode of the server."""
    poll: NotRequired[int]
    r"""The interval within which the server will expect a subsequent synchronization message, in log2 seconds."""
    precision: NotRequired[int]
    r"""The precision of the system's clock, in log2 seconds."""
    reference_id: NotRequired[str]
    r"""The identifier of the reference clock. For servers in stratum 1, one of an IANA-maintained list of sources. For servers in stratum 2, the ID of the stratum 1 server from which the time was retrieved (usually, its IP address), etc."""
    stratum: NotRequired[int]
    r"""The number of servers between a client and a non-NTP time source. 1 signifies that the server is authoritative, having direct access to a sensor. 2 signifies that the server got its time from a \"stratum 1\" server, etc. 16 means the clock is unsynchronized."""
    version: NotRequired[int]
    r"""The NTP version indicated in the server's response."""


class NTPNTPHeader(BaseModel):
    leap_indicator: Optional[int] = None
    r"""An enumerated value from 0 to 3 signifying whether a leap second will occur at the end of the current month. 0 signifies no leap second, 1 signifies an additive leap second, 2 signifies a subtractive leap second, and 3 signifies the state is unknown."""

    mode: Optional[int] = None
    r"""An enumerated value from 0 to 7 signifying the operational mode of the server."""

    poll: Optional[int] = None
    r"""The interval within which the server will expect a subsequent synchronization message, in log2 seconds."""

    precision: Optional[int] = None
    r"""The precision of the system's clock, in log2 seconds."""

    reference_id: Optional[str] = None
    r"""The identifier of the reference clock. For servers in stratum 1, one of an IANA-maintained list of sources. For servers in stratum 2, the ID of the stratum 1 server from which the time was retrieved (usually, its IP address), etc."""

    stratum: Optional[int] = None
    r"""The number of servers between a client and a non-NTP time source. 1 signifies that the server is authoritative, having direct access to a sensor. 2 signifies that the server got its time from a \"stratum 1\" server, etc. 16 means the clock is unsynchronized."""

    version: Optional[int] = None
    r"""The NTP version indicated in the server's response."""
