| Conditions | 3 |
| Total Lines | 26 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from nextcloud.base import WithRequester |
||
| 8 | def get_activities(self, since=None, limit=None, object_type=None, object_id=None, sort=None): |
||
| 9 | """ |
||
| 10 | Get an activity feed showing your file changes and other interesting things going on in your Nextcloud |
||
| 11 | |||
| 12 | All args are optional |
||
| 13 | |||
| 14 | Args: |
||
| 15 | since (int): ID of the last activity that you’ve seen |
||
| 16 | limit (int): How many activities should be returned (default: 50) |
||
| 17 | object_type (string): Filter the activities to a given object. May only appear together with object_id |
||
| 18 | object_id (string): Filter the activities to a given object. May only appear together with object_type |
||
| 19 | sort (str, "asc" or "desc"): Sort activities ascending or descending (from the since) (Default: desc) |
||
| 20 | |||
| 21 | Returns: |
||
| 22 | |||
| 23 | """ |
||
| 24 | params = dict( |
||
| 25 | since=since, |
||
| 26 | limit=limit, |
||
| 27 | object_type=object_type, |
||
| 28 | object_id=object_id, |
||
| 29 | sort=sort |
||
| 30 | ) |
||
| 31 | if params['object_type'] and params['object_id']: |
||
| 32 | return self.requester.get(url="filter", params=params) |
||
| 33 | return self.requester.get(params=params) |
||
| 34 |