diff --git a/src/linkahead/common/models.py b/src/linkahead/common/models.py index 98fc28a47a3c7b034b4b6f1dc12481f62fc69fd4..96851f34bd7558e03fb60d92ca001d8cd7c43171 100644 --- a/src/linkahead/common/models.py +++ b/src/linkahead/common/models.py @@ -1998,8 +1998,6 @@ class Property(Entity): Parameters ---------- - Parameters - ---------- parent : Entity or int or str or None The parent entity, either specified by the Entity object itself, or its id or its name. Default is None. @@ -3192,9 +3190,15 @@ class Container(list): """Get an xml tree representing this Container or append all entities to the given xml element. - @param add_to_element=None: optional element to which all entities of this container is to - be appended. - @return xml element + Parameters + ---------- + add_to_element : etree._Element, optional + optional element to which all entities of this container is to + be appended. Default is None + + Returns + ------- + xml_element : etree._Element """ tmpid = 0 @@ -4072,13 +4076,21 @@ class Container(list): warnings as errors. This prevents the server from inserting this entity if any warning occurs. - @param strict=False: Flag for strict mode. - @param sync=True: synchronize this container with the response from the server. Otherwise, - this method returns a new container with the inserted entities and leaves - this container untouched. - @param unique=True: Flag for unique mode. If set to True, the server will check if the name - of the entity is unique. If not, the server will return an error. - @param flags=None: Additional flags for the server. + Parameters + ---------- + strict : bool, optional + Flag for strict mode. Default is False. + sync : bool, optional + synchronize this container with the response from the + server. Otherwise, this method returns a new container with the + inserted entities and leaves this container untouched. Default is + True. + unique : bool, optional + Flag for unique mode. If set to True, the server will check if the + name of the entity is unique. If not, the server will return an + error. Default is True. + flags : dict, optional + Additional flags for the server. Default is None. """ @@ -5019,6 +5031,17 @@ class DropOffBox(list): class UserInfo(): + """User information from a server response. + + Attributes + ---------- + name : str + Username + realm : str + Realm in which this user lives, e.g., CaosDB or LDAP. + roles : list[str] + List of roles assigned to this user. + """ def __init__(self, xml: etree._Element): self.roles = [role.text for role in xml.findall("Roles/Role")] @@ -5027,6 +5050,21 @@ class UserInfo(): class Info(): + """Info about the LinkAhead instance that you are connected to. It has a + simple string representation in the form of "Connected to a LinkAhead with N + Records". + + Attributes + ---------- + messages : Messages + Collection of messages that the server's ``Info`` response contained. + user_info : UserInfo + Information about the user that is connected to the server, such as + name, realm or roles. + time_zone : TimeZone + The timezone information returned by the server. + + """ def __init__(self): self.messages = Messages() @@ -5035,6 +5073,7 @@ class Info(): self.sync() def sync(self): + """Retrieve server information from the server's ``Info`` response.""" c = get_connection() try: http_response = c.retrieve(["Info"])