Updated responses and endpoint descriptions
This commit is contained in:
parent
44340f20b0
commit
17fc911290
2 changed files with 169 additions and 20 deletions
27
responses.py
27
responses.py
|
|
@ -5,6 +5,7 @@ from typing_extensions import TypedDict
|
|||
|
||||
class StartResponse(TypedDict):
|
||||
status: Literal["running", "started"]
|
||||
message: str
|
||||
|
||||
|
||||
class StatusResponsePlayers(TypedDict):
|
||||
|
|
@ -15,13 +16,39 @@ class StatusResponsePlayers(TypedDict):
|
|||
|
||||
class StatusResponse(TypedDict):
|
||||
status: Literal["online", "offline", "crashed", "maintainance", "starting"]
|
||||
message: str
|
||||
reason: NotRequired[str]
|
||||
motd: NotRequired[str]
|
||||
icon: NotRequired[str | None]
|
||||
players: NotRequired[StatusResponsePlayers]
|
||||
|
||||
|
||||
class StopResponse(TypedDict):
|
||||
status: Literal["stopping"]
|
||||
message: str
|
||||
|
||||
|
||||
class RestartResponse(TypedDict):
|
||||
status: Literal["restarting"]
|
||||
message: str
|
||||
|
||||
|
||||
class MaintainanceResponse(TypedDict):
|
||||
status: Literal["stopping"]
|
||||
message: str
|
||||
|
||||
|
||||
class CommandResponse(TypedDict):
|
||||
status: Literal["executed"]
|
||||
message: str
|
||||
output: str
|
||||
|
||||
|
||||
class Responses:
|
||||
StartResponse = StartResponse
|
||||
StatusResponsePlayers = StatusResponsePlayers
|
||||
StatusResponse = StatusResponse
|
||||
StopResponse = StopResponse
|
||||
RestartResponse = RestartResponse
|
||||
MaintainanceResponse = MaintainanceResponse
|
||||
CommandResponse = CommandResponse
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue