Skip to content

Commit

Permalink
feat: add filter for project
Browse files Browse the repository at this point in the history
  • Loading branch information
HagenFritz committed Jan 20, 2025
1 parent 0c81e00 commit 1d67eb9
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 462 deletions.
Empty file.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
- name: Test with pytest
env:
CLIENT_ID: ${{ secrets.PROCORE_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.PROCORE_CLIENT_SECRET }}
PROCORE_CLIENT_ID: ${{ secrets.PROCORE_CLIENT_ID }}
PROCORE_CLIENT_SECRET: ${{ secrets.PROCORE_CLIENT_SECRET }}
SANDBOX_COMPANY_ID: ${{ secrets.SANDBOX_COMPANY_ID }}
SANDBOX_PROJECT_ID: ${{ secrets.SANDBOX_PROJECT_ID }}
REDIRECT_URI: "urn:ietf:wg:oauth:2.0:oob"
Expand Down
8 changes: 6 additions & 2 deletions ProPyCore/access/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ def __init__(self, access_token, server_url) -> None:

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

def get(self, company_id, per_page=300):
def get(self, company_id, status="All",per_page=300):
"""
Gets a list of all the projects from a certain company
https://developers.procore.com/reference/rest/projects?version=latest#list-projects
Parameters
----------
company_id : int
unique identifier for the company
per_page : int, default 300
number of companies to include. Max is 300 per v1.1 API.
status : str enum, default "All"
status of the projects to get must be one of: ["Active", "Inactive", "All"]
Returns
-------
Expand All @@ -34,7 +37,8 @@ def get(self, company_id, per_page=300):
params = {
"company_id": company_id,
"page": page,
"per_page": per_page
"per_page": per_page,
"filters[by_status]": status
}

projects_per_page = self.get_request(
Expand Down
4 changes: 0 additions & 4 deletions propycore-0.5.0/setup.cfg

This file was deleted.

52 changes: 0 additions & 52 deletions propycore-0.5.0/tests/unit/test_cost_codes.py

This file was deleted.

199 changes: 0 additions & 199 deletions propycore-0.5.0/tests/unit/test_files.py

This file was deleted.

39 changes: 0 additions & 39 deletions propycore-0.5.0/tests/unit/test_generic_tools.py

This file was deleted.

Loading

0 comments on commit 1d67eb9

Please sign in to comment.