from zope.interface import Interface, Attribute class IGroup(Interface): """Represents a Unix group.""" cn = Attribute('common name') gid_number = Attribute('gid number') members = Attribute('usernames of group members') ldap3_entry = Attribute('cached ldap3.Entry instance for this group') def add_to_ldap(): """Add a new record to LDAP for this group.""" def add_member(username: str): """Add the member to this group in LDAP.""" def remove_member(username: str): """Remove the member from this group in LDAP.""" def to_dict(): """Serialize this group as JSON."""