|
| 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.LockstepApi import LockstepApi |
| 16 | +from src.models.LockstepResponse 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 | + # Retrieves the Activity specified by this unique identifier, optionally including nested data sets. |
| 25 | + # |
| 26 | + # An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task. |
| 27 | + # |
| 28 | + # @param id [uuid] The unique Lockstep Platform ID number of this Activity |
| 29 | + # @param include [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Attachments, CustomFields, and Notes |
| 30 | + def retrieve_activity(self, id: str, include: str) -> LockstepResponse: |
| 31 | + path = f"/api/v1/Activities/{id}" |
| 32 | + return self.client.send_request("GET", path, None, {id: str, include: str}) |
| 33 | + |
| 34 | + # Updates an activity that matches the specified id with the requested information. |
| 35 | + # |
| 36 | + # The PATCH method allows you to change specific values on the object while leaving other values alone. As input you should supply a list of field names and new values. If you do not provide the name of a field, that field will remain unchanged. This allows you to ensure that you are only updating the specific fields desired. |
| 37 | + # |
| 38 | + # An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task. |
| 39 | + # |
| 40 | + # @param id [uuid] The unique Lockstep Platform ID number of the Activity to update |
| 41 | + # @param body [object] A list of changes to apply to this Activity |
| 42 | + def update_activity(self, id: str, body: object) -> LockstepResponse: |
| 43 | + path = f"/api/v1/Activities/{id}" |
| 44 | + return self.client.send_request("PATCH", path, body, {id: str, body: object}) |
| 45 | + |
| 46 | + # Delete the Activity referred to by this unique identifier. |
| 47 | + # |
| 48 | + # An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task. |
| 49 | + # |
| 50 | + # @param id [uuid] The unique Lockstep Platform ID number of the Activity to delete |
| 51 | + def delete_activity(self, id: str) -> LockstepResponse: |
| 52 | + path = f"/api/v1/Activities/{id}" |
| 53 | + return self.client.send_request("DELETE", path, None, {id: str}) |
| 54 | + |
| 55 | + # Creates one or more activities from a given model. |
| 56 | + # |
| 57 | + # An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task. |
| 58 | + # |
| 59 | + # @param body [ActivityModel] The Activities to create |
| 60 | + def create_activities(self, body: list[ActivityModel]) -> LockstepResponse: |
| 61 | + path = f"/api/v1/Activities" |
| 62 | + return self.client.send_request("POST", path, body, {body: list[ActivityModel]}) |
| 63 | + |
| 64 | + # Queries Activities for this account using the specified filtering, sorting, nested fetch, and pagination rules requested. |
| 65 | + # |
| 66 | + # More information on querying can be found on the [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website. |
| 67 | + # |
| 68 | + # An Activity contains information about work being done on a specific accounting task. You can use Activities to track information about who has been assigned a specific task, the current status of the task, the name and description given for the particular task, the priority of the task, and any amounts collected, paid, or credited for the task. |
| 69 | + # |
| 70 | + # @param filter [string] The filter for this query. See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) |
| 71 | + # @param include [string] To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Attachments, CustomFields, and Notes |
| 72 | + # @param order [string] The sort order for this query. See See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) |
| 73 | + # @param pageSize [int32] The page size for results (default 200). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) |
| 74 | + # @param pageNumber [int32] The page number for results (default 0). See [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) |
| 75 | + def query_activities(self, filter: str, include: str, order: str, pageSize: int, pageNumber: int) -> LockstepResponse: |
| 76 | + path = f"/api/v1/Activities/query" |
| 77 | + return self.client.send_request("GET", path, None, {filter: str, include: str, order: str, pageSize: int, pageNumber: int}) |
0 commit comments