Files
lagomareGateKeeperBot/models/credential.py

11 lines
364 B
Python

class Credential:
def __init__(self, username: str, password: str):
self.username = username
self.password = password
def to_dict(self) -> dict:
return {"username": self.username, "password": self.password}
@classmethod
def from_dict(cls, data: dict):
return cls(data.get("username", ""), data.get("password", ""))