from typing import Dict, List, Optional
from pydantic import BaseModel
from uuid import UUID
[docs]class Debug(BaseModel):
"""Info model
Args:
ping (bool): If the Server List Ping (SLP) protocol was used. Added in version 1.7 and can not be turned off.
query (bool):If the Query protocol was used. Default is off.
srv (bool): If a Service record (SRV) was detected and used. They use the following format: _minecraft._tcp.domain.tld.
querymismatch (bool): If the game port returned by the query protocol is not the same port as the Minecraft server is running on, the API assumes the query comes from another server.
"""
ping: bool
query: Optional[bool] = False
srv: bool
querymismatch: Optional[bool] = False
error: Optional[str] = None
[docs]class Motd(BaseModel):
"""Info model
Args:
raw (List[str]): Raw motd with minecraft formatting.
clean (List[str]): Cleaned motd without minecraft formatting.
html (List[str]): Html motd with html formatting.
"""
raw: List[str]
clean: List[str]
html: List[str]
[docs]class Players(BaseModel):
"""Info model
Args:
online (int): Current number of players online.
max (int): Max number of players.
list (Optional[List[str]]): Html info with html formatting.
uuid (Optional[Dict[str, UUID]]): Html info with html formatting.
"""
online: int
max: int
list: Optional[List[str]]
uuid: Optional[Dict[str, UUID]]
[docs]class Offline(BaseModel):
"""Offline Bedrock Status.
Args:
online (boot): Wether server online.
ip (boot): Ip of server.
port (boot): Port of server.
hostname (boot): Hostname of server.
error (str): Error which the request failed on.
"""
online: bool
port: int
debug: Debug
ip: Optional[str]
hostname: Optional[str]