94 lines
2.0 KiB
Python
94 lines
2.0 KiB
Python
import google.protobuf.message
|
|
import typing
|
|
|
|
|
|
# manually maintained typehints for protobuf created (and monkey-patched) types
|
|
|
|
|
|
class Message(google.protobuf.message.Message):
|
|
hello: Hello
|
|
authentication_result: AuthenticationResult
|
|
ping: Ping
|
|
mac_states: MacStates
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
hello: typing.Optional[Hello]=None,
|
|
authentication_result: typing.Optional[AuthenticationResult]=None,
|
|
ping: typing.Optional[Ping]=None,
|
|
mac_states: typing.Optional[MacStates]=None,
|
|
) -> None: ...
|
|
|
|
def to_variant(self) -> typing.Union[Hello, AuthenticationResult, Ping, MacStates]: ...
|
|
|
|
|
|
class Hello(google.protobuf.message.Message):
|
|
instance_id: bytes
|
|
hostname: str
|
|
is_controller: bool
|
|
authentication: bytes
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
instance_id: bytes=b'',
|
|
hostname: str='',
|
|
is_controller: bool=False,
|
|
authentication: bytes=b'',
|
|
) -> None: ...
|
|
|
|
def to_message(self) -> Message: ...
|
|
|
|
|
|
class AuthenticationResult(google.protobuf.message.Message):
|
|
success: bool
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
success: bool=False,
|
|
) -> None: ...
|
|
|
|
def to_message(self) -> Message: ...
|
|
|
|
|
|
class Ping(google.protobuf.message.Message):
|
|
payload: bytes
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
payload: bytes=b'',
|
|
) -> None: ...
|
|
|
|
def to_message(self) -> Message: ...
|
|
|
|
|
|
class MacStates(google.protobuf.message.Message):
|
|
states: typing.List[MacState]
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
states: typing.List[MacState]=[],
|
|
) -> None: ...
|
|
|
|
def to_message(self) -> Message: ...
|
|
|
|
|
|
class MacState(google.protobuf.message.Message):
|
|
mac_address: bytes
|
|
last_change: int # Seconds of UTC time since epoch
|
|
allow_until: int # Seconds of UTC time since epoch
|
|
allowed: bool
|
|
|
|
def __init__(
|
|
self,
|
|
*,
|
|
mac_address: bytes=b'',
|
|
last_change: int=0,
|
|
allow_until: int=0,
|
|
allowed: bool=False,
|
|
) -> None: ...
|