Skip to content

Commit

Permalink
Regenerate with file APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
tspence committed Dec 5, 2023
1 parent 3eb2bed commit 074856b
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ProjectManagerSdk"
version = "99.0.2541"
version = "99.0.2548"
authors = [
{ name = "ProjectManager.com", email = "[email protected]" }
]
Expand Down
1 change: 1 addition & 0 deletions src/ProjectManagerSdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions src/ProjectManagerSdk/clients/fileclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
40 changes: 40 additions & 0 deletions src/ProjectManagerSdk/clients/teamsclient.py
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
# @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
6 changes: 4 additions & 2 deletions src/ProjectManagerSdk/projectmanagerclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# @author ProjectManager.com <[email protected]>
#
# @copyright 2023-2023 ProjectManager.com, Inc.
# @version 99.0.2541
# @version 99.0.2548
# @link https://github.com/projectmgr/projectmanager-sdk-python
#

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -106,14 +107,15 @@ 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)
self.serverUrl = env
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
Expand Down

0 comments on commit 074856b

Please sign in to comment.