Created
May 29, 2020 02:51
-
-
Save jamesperes-zz/f4e42022f6a9749ac33f3d0969ee6fcf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
@dataclass | |
class UserInfo(): | |
"""Entity to establish User info.""" | |
id: int = None | |
type: str = None | |
company_number: int = None | |
phone: int = None | |
name: str = None | |
def __bool__(self): | |
"""Validate if attributes are empties. | |
Returns: | |
False if id is empty. True if at least on is not | |
empty. | |
""" | |
return bool(self.id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment