From 074856b6383eadccdd934aed3c7f160ca60d9f55 Mon Sep 17 00:00:00 2001 From: Ted Spence Date: Tue, 5 Dec 2023 12:28:51 -0800 Subject: [PATCH] Regenerate with file APIs --- pyproject.toml | 2 +- src/ProjectManagerSdk/__init__.py | 1 + src/ProjectManagerSdk/clients/fileclient.py | 25 ++++++++++++ src/ProjectManagerSdk/clients/teamsclient.py | 40 +++++++++++++++++++ src/ProjectManagerSdk/projectmanagerclient.py | 6 ++- 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 src/ProjectManagerSdk/clients/teamsclient.py diff --git a/pyproject.toml b/pyproject.toml index 9e15d75..cd7127d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ProjectManagerSdk" -version = "99.0.2541" +version = "99.0.2548" authors = [ { name = "ProjectManager.com", email = "support@projectmanager.com" } ] diff --git a/src/ProjectManagerSdk/__init__.py b/src/ProjectManagerSdk/__init__.py index cde0aa7..3fecf2e 100644 --- a/src/ProjectManagerSdk/__init__.py +++ b/src/ProjectManagerSdk/__init__.py @@ -32,6 +32,7 @@ from ProjectManagerSdk.clients.taskfileclient import TaskFileClient from ProjectManagerSdk.clients.taskstatusclient import TaskStatusClient from ProjectManagerSdk.clients.tasktagclient import TaskTagClient +from ProjectManagerSdk.clients.teamsclient import TeamsClient from ProjectManagerSdk.clients.timesheetclient import TimesheetClient from ProjectManagerSdk.clients.userroleclient import UserRoleClient from ProjectManagerSdk.clients.workspaceclient import WorkSpaceClient diff --git a/src/ProjectManagerSdk/clients/fileclient.py b/src/ProjectManagerSdk/clients/fileclient.py index 4a42b8f..08590b8 100644 --- a/src/ProjectManagerSdk/clients/fileclient.py +++ b/src/ProjectManagerSdk/clients/fileclient.py @@ -13,6 +13,7 @@ from ProjectManagerSdk.models.astroresult import AstroResult from ProjectManagerSdk.models.updaterequestdto import UpdateRequestDto +from requests.models import Response import json class FileClient: @@ -58,6 +59,30 @@ def download_file(self, documentId: str, type: str) -> AstroResult[object]: else: return AstroResult[object](result.json(), False, True, result.status_code, None) + def download_a_thumbnail_image(self, documentId: str) -> Response: + """ + Downloads a thumbnail image associated with a document that was + previously uploaded to ProjectManager.com. ProjectManager allows + you to store files linked to various elements within your + Workspace, such as Projects, Tasks, or your Home. Files are + organized based on their storage location. When uploading a + file, please allow some time for the file to undergo processing + and verification. ProjectManager may reject file uploads + containing issues such as malware. Once a file has completed the + upload process, you can retrieve its associated thumbnail using + the DownloadThumbnail API. + + Parameters + ---------- + documentId : str + The unique identifier of the document for which to download + the thumbnail. + """ + path = f"/api/data/files/{documentId}/thumbnail" + queryParams = {} + result = self.client.send_request("GET", path, None, queryParams, None) + return result + def update_file(self, fileId: str, body: UpdateRequestDto) -> AstroResult[object]: """ Updates information about a File uploaded to your Workspace. diff --git a/src/ProjectManagerSdk/clients/teamsclient.py b/src/ProjectManagerSdk/clients/teamsclient.py new file mode 100644 index 0000000..6659189 --- /dev/null +++ b/src/ProjectManagerSdk/clients/teamsclient.py @@ -0,0 +1,40 @@ +# +# ProjectManager API for Python +# +# (c) 2023-2023 ProjectManager.com, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author ProjectManager.com +# @copyright 2023-2023 ProjectManager.com, Inc. +# @link https://github.com/projectmgr/projectmanager-sdk-python +# + +from ProjectManagerSdk.models.astroresult import AstroResult +from requests.models import Response +import json + +class TeamsClient: + """ + API methods related to Teams + """ + from ProjectManagerSdk.projectmanagerclient import ProjectManagerClient + + def __init__(self, client: ProjectManagerClient): + self.client = client + + def retrieve_zip_file_for_teams_integrations(self) -> Response: + """ + Retrieves zip file for teams integrations. The Teams API is + intended for use by ProjectManager and its business development + partners. Please contact ProjectManager's sales team to request + use of this API. + + Parameters + ---------- + """ + path = "/api/data/integrations/teams/application" + queryParams = {} + result = self.client.send_request("GET", path, None, queryParams, None) + return result diff --git a/src/ProjectManagerSdk/projectmanagerclient.py b/src/ProjectManagerSdk/projectmanagerclient.py index b06ad72..2421e9e 100644 --- a/src/ProjectManagerSdk/projectmanagerclient.py +++ b/src/ProjectManagerSdk/projectmanagerclient.py @@ -9,7 +9,7 @@ # @author ProjectManager.com # # @copyright 2023-2023 ProjectManager.com, Inc. -# @version 99.0.2541 +# @version 99.0.2548 # @link https://github.com/projectmgr/projectmanager-sdk-python # @@ -72,6 +72,7 @@ def __init__(self, env: str, appname: str): from ProjectManagerSdk.clients.taskfileclient import TaskFileClient from ProjectManagerSdk.clients.taskstatusclient import TaskStatusClient from ProjectManagerSdk.clients.tasktagclient import TaskTagClient + from ProjectManagerSdk.clients.teamsclient import TeamsClient from ProjectManagerSdk.clients.timesheetclient import TimesheetClient from ProjectManagerSdk.clients.userroleclient import UserRoleClient from ProjectManagerSdk.clients.workspaceclient import WorkSpaceClient @@ -106,6 +107,7 @@ def __init__(self, env: str, appname: str): self.taskFile = TaskFileClient(self) self.taskStatus = TaskStatusClient(self) self.taskTag = TaskTagClient(self) + self.teams = TeamsClient(self) self.timesheet = TimesheetClient(self) self.userRole = UserRoleClient(self) self.workSpace = WorkSpaceClient(self) @@ -113,7 +115,7 @@ def __init__(self, env: str, appname: str): if env == "production": self.serverUrl = "https://api.projectmanager.com" self.sdkName = "Python" - self.sdkVersion = "99.0.2541" + self.sdkVersion = "99.0.2548" self.machineName = platform.uname().node self.applicationName = appname self.bearerToken = None