@@ -225,7 +225,7 @@ def remove(self, company_id, project_id, doc_id):
225225
226226 return doc_info
227227
228- def get (self , company_id , project_id , folder_id = None , view = "normal" ):
228+ def get (self , company_id , project_id , folder_id = None , view = "normal" , file_types = None ):
229229 """
230230 Gets all documents in a project.
231231
@@ -239,6 +239,8 @@ def get(self, company_id, project_id, folder_id=None, view="normal"):
239239 ID of parent folder.
240240 view : str, default "normal"
241241 View to use for the request: "normal" or "extended"
242+ file_types : list of str, default None
243+ List of file type extensions to filter by.
242244
243245 Returns
244246 -------
@@ -258,9 +260,12 @@ def get(self, company_id, project_id, folder_id=None, view="normal"):
258260 "per_page" : 10000 ,
259261 "filters[document_type]" : doc_type ,
260262 "filters[is_in_recycle_bin]" : False ,
263+ "filters[private]" : False ,
261264 }
262265 if folder_id is not None :
263266 params ["filters[folder_id]" ] = folder_id
267+ if file_types is not None :
268+ params ["filters[file_type]" ] = file_types
264269
265270 headers = {
266271 "Procore-Company-Id" : f"{ company_id } " ,
@@ -288,7 +293,7 @@ def get(self, company_id, project_id, folder_id=None, view="normal"):
288293 f"from Parent ID { folder_id if folder_id is not None else 'Root' } " ,
289294 )
290295
291- def search (self , company_id , project_id , value , folder_id = None , view = "normal" ):
296+ def search (self , company_id , project_id , value , folder_id = None , view = "normal" , file_types = [] ):
292297 """
293298 Searches through all available files to find the closest match to the given value.
294299
@@ -302,6 +307,8 @@ def search(self, company_id, project_id, value, folder_id=None, view="normal"):
302307 Search criteria.
303308 folder_id : int, default None
304309 ID of parent folder.
310+ file_types : list of str, default []
311+ List of file type extensions to filter by.
305312
306313 Returns
307314 -------
@@ -313,6 +320,7 @@ def search(self, company_id, project_id, value, folder_id=None, view="normal"):
313320 project_id = project_id ,
314321 folder_id = folder_id ,
315322 view = view ,
323+ file_types = file_types ,
316324 )
317325
318326 doc_type = self .endpoint .split ("/" )[- 1 ][:- 1 ]
0 commit comments