Skip to content

Commit 496694e

Browse files
committed
Feat: update endpoints
1 parent db43ec6 commit 496694e

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

ProPyCore/access/projects.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def __init__(self, access_token, server_url) -> None:
1111

1212
self.endpoint = "/rest/v1.1/projects"
1313

14-
def get(self, company_id, status="All",per_page=300):
14+
def get(self, company_id, status="All", region=None, per_page=300):
1515
"""
1616
Gets a list of all the projects from a certain company
1717
https://developers.procore.com/reference/rest/projects?version=latest#list-projects
@@ -24,6 +24,8 @@ def get(self, company_id, status="All",per_page=300):
2424
number of companies to include. Max is 300 per v1.1 API.
2525
status : str enum, default "All"
2626
status of the projects to get must be one of: ["Active", "Inactive", "All"]
27+
region : str or list of str, default None - NOT IMPLMENTED
28+
region of the projects to get
2729
2830
Returns
2931
-------

ProPyCore/access/quality/punch.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,34 @@ def show(self, company_id, project_id, punch_id):
8585
params=params
8686
)
8787

88-
return punch_info
88+
return punch_info
89+
90+
def get_assignment(self, company_id, project_id, assignment_id):
91+
"""
92+
Gets a specific punch item assignment
93+
94+
Parameters
95+
----------
96+
company_id : int
97+
unique identifier for the company
98+
project_id : int
99+
unique identifier for the project
100+
assignment_id : int
101+
unique identifier for the punch item assignment
102+
103+
Returns
104+
-------
105+
assignment_info : dict
106+
specific punch item assignment information
107+
"""
108+
109+
headers = {
110+
"Procore-Company-Id": f"{company_id}"
111+
}
112+
113+
assignment_info = self.get_request(
114+
api_url=f"/rest/v1.0/projects/{project_id}/punch_item_assignments/{assignment_id}",
115+
additional_headers=headers
116+
)
117+
118+
return assignment_info

0 commit comments

Comments
 (0)