Пример #1
0
    def get_user(self, api_key):
        """Get the user for the given api key

        Parameters
        ----------
        api_key: str
            Clockify Api key

        Returns
        -------
        User
        """
        response = self.api_server.get(path="/user", api_key=api_key)
        return User.init_from_dict(response)
Пример #2
0
    def get_users(self, api_key, workspace) -> List[User]:
        """Get users for the given workspace

        Parameters
        ----------
        api_key: str
            Clockify Api key
        workspace: Workspace
            Get users in this workspace

        Returns
        -------
        List[User]
        """
        response = self.api_server.get(
            path=f"/workspaces/{workspace.obj_id}/users", api_key=api_key)
        return [User.init_from_dict(x) for x in response]