OpoTests/Python/Models/UserModel.py

21 lines
489 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import Self
from Utils.Check import Check
class UserModel:
def __init__(self:Self, *arguments:list[dict[str, str]|str]) -> None:
self.name:str
self.password:str
if Check.is_dictionary(arguments[0]):
data:dict[str, str] = arguments[0]
self.name, self.password = data.get("name", ""), data.get("password", "")
else:
self.name, self.password = arguments