|
| 1 | +# |
| 2 | +# Lockstep Software Development Kit for Python |
| 3 | +# |
| 4 | +# (c) 2021-2022 Lockstep, Inc. |
| 5 | +# |
| 6 | +# For the full copyright and license information, please view the LICENSE |
| 7 | +# file that was distributed with this source code. |
| 8 | +# |
| 9 | +# @author Ted Spence <[email protected]> |
| 10 | +# @copyright 2021-2022 Lockstep, Inc. |
| 11 | +# @version 2021.39 |
| 12 | +# @link https://github.com/Lockstep-Network/lockstep-sdk-python |
| 13 | +# |
| 14 | + |
| 15 | +from src.lockstep_api import LockstepApi |
| 16 | +from src.models.lockstep_response import LockstepResponse |
| 17 | +from src.models.activitymodel import ActivityModel |
| 18 | + |
| 19 | +class ActivitiesClient: |
| 20 | + |
| 21 | + def __init__(self, client: LockstepApi): |
| 22 | + self.client = client |
| 23 | + |
| 24 | + """ |
| 25 | + Retrieves the Activity specified by this unique identifier, |
| 26 | + optionally including nested data sets. |
| 27 | +
|
| 28 | + An Activity contains information about work being done on a specific |
| 29 | + accounting task. You can use Activities to track information about |
| 30 | + who has been assigned a specific task, the current status of the |
| 31 | + task, the name and description given for the particular task, the |
| 32 | + priority of the task, and any amounts collected, paid, or credited |
| 33 | + for the task. |
| 34 | +
|
| 35 | + Parameters |
| 36 | + ---------- |
| 37 | + id : str |
| 38 | + The unique Lockstep Platform ID number of this Activity |
| 39 | + include : str |
| 40 | + To fetch additional data on this object, specify the list of |
| 41 | + elements to retrieve. Available collections: Attachments, |
| 42 | + CustomFields, and Notes |
| 43 | + """ |
| 44 | + def retrieve_activity(self, id: str, include: str) -> LockstepResponse: |
| 45 | + path = f"/api/v1/Activities/{id}" |
| 46 | + return self.client.send_request("GET", path, None, {id: str, include: str}) |
| 47 | + |
| 48 | + """ |
| 49 | + Updates an activity that matches the specified id with the requested |
| 50 | + information. |
| 51 | +
|
| 52 | + The PATCH method allows you to change specific values on the object |
| 53 | + while leaving other values alone. As input you should supply a list |
| 54 | + of field names and new values. If you do not provide the name of a |
| 55 | + field, that field will remain unchanged. This allows you to ensure |
| 56 | + that you are only updating the specific fields desired. |
| 57 | +
|
| 58 | + An Activity contains information about work being done on a specific |
| 59 | + accounting task. You can use Activities to track information about |
| 60 | + who has been assigned a specific task, the current status of the |
| 61 | + task, the name and description given for the particular task, the |
| 62 | + priority of the task, and any amounts collected, paid, or credited |
| 63 | + for the task. |
| 64 | +
|
| 65 | + Parameters |
| 66 | + ---------- |
| 67 | + id : str |
| 68 | + The unique Lockstep Platform ID number of the Activity to update |
| 69 | + body : object |
| 70 | + A list of changes to apply to this Activity |
| 71 | + """ |
| 72 | + def update_activity(self, id: str, body: object) -> LockstepResponse: |
| 73 | + path = f"/api/v1/Activities/{id}" |
| 74 | + return self.client.send_request("PATCH", path, body, {id: str, body: object}) |
| 75 | + |
| 76 | + """ |
| 77 | + Delete the Activity referred to by this unique identifier. |
| 78 | +
|
| 79 | + An Activity contains information about work being done on a specific |
| 80 | + accounting task. You can use Activities to track information about |
| 81 | + who has been assigned a specific task, the current status of the |
| 82 | + task, the name and description given for the particular task, the |
| 83 | + priority of the task, and any amounts collected, paid, or credited |
| 84 | + for the task. |
| 85 | +
|
| 86 | + Parameters |
| 87 | + ---------- |
| 88 | + id : str |
| 89 | + The unique Lockstep Platform ID number of the Activity to delete |
| 90 | + """ |
| 91 | + def delete_activity(self, id: str) -> LockstepResponse: |
| 92 | + path = f"/api/v1/Activities/{id}" |
| 93 | + return self.client.send_request("DELETE", path, None, {id: str}) |
| 94 | + |
| 95 | + """ |
| 96 | + Creates one or more activities from a given model. |
| 97 | +
|
| 98 | + An Activity contains information about work being done on a specific |
| 99 | + accounting task. You can use Activities to track information about |
| 100 | + who has been assigned a specific task, the current status of the |
| 101 | + task, the name and description given for the particular task, the |
| 102 | + priority of the task, and any amounts collected, paid, or credited |
| 103 | + for the task. |
| 104 | +
|
| 105 | + Parameters |
| 106 | + ---------- |
| 107 | + body : list[ActivityModel] |
| 108 | + The Activities to create |
| 109 | + """ |
| 110 | + def create_activities(self, body: list[ActivityModel]) -> LockstepResponse: |
| 111 | + path = f"/api/v1/Activities" |
| 112 | + return self.client.send_request("POST", path, body, {body: list[ActivityModel]}) |
| 113 | + |
| 114 | + """ |
| 115 | + Queries Activities for this account using the specified filtering, |
| 116 | + sorting, nested fetch, and pagination rules requested. |
| 117 | +
|
| 118 | + More information on querying can be found on the [Searchlight Query |
| 119 | + Language](https://developer.lockstep.io/docs/querying-with-searchlight) |
| 120 | + page on the Lockstep Developer website. |
| 121 | +
|
| 122 | + An Activity contains information about work being done on a specific |
| 123 | + accounting task. You can use Activities to track information about |
| 124 | + who has been assigned a specific task, the current status of the |
| 125 | + task, the name and description given for the particular task, the |
| 126 | + priority of the task, and any amounts collected, paid, or credited |
| 127 | + for the task. |
| 128 | +
|
| 129 | + Parameters |
| 130 | + ---------- |
| 131 | + filter : str |
| 132 | + The filter for this query. See [Searchlight Query |
| 133 | + Language](https://developer.lockstep.io/docs/querying-with-searchlight) |
| 134 | + include : str |
| 135 | + To fetch additional data on this object, specify the list of |
| 136 | + elements to retrieve. Available collections: Attachments, |
| 137 | + CustomFields, and Notes |
| 138 | + order : str |
| 139 | + The sort order for this query. See See [Searchlight Query |
| 140 | + Language](https://developer.lockstep.io/docs/querying-with-searchlight) |
| 141 | + pageSize : int |
| 142 | + The page size for results (default 200). See [Searchlight Query |
| 143 | + Language](https://developer.lockstep.io/docs/querying-with-searchlight) |
| 144 | + pageNumber : int |
| 145 | + The page number for results (default 0). See [Searchlight Query |
| 146 | + Language](https://developer.lockstep.io/docs/querying-with-searchlight) |
| 147 | + """ |
| 148 | + def query_activities(self, filter: str, include: str, order: str, pageSize: int, pageNumber: int) -> LockstepResponse: |
| 149 | + path = f"/api/v1/Activities/query" |
| 150 | + return self.client.send_request("GET", path, None, {filter: str, include: str, order: str, pageSize: int, pageNumber: int}) |
0 commit comments