@@ -167,6 +167,7 @@ def list_plots_groups(
167167 search : Optional [str ] = None ,
168168 page_number : Optional [int ] = None ,
169169 include_archived : bool = False ,
170+ methodology : Optional [str ] = None
170171 ) -> ResultsPage :
171172 """
172173 List all the plots group the user can access, see `ResultsPage`
@@ -179,6 +180,7 @@ def list_plots_groups(
179180 search: The term used to filter by name
180181 page_number: Optional page (from 1) of the list we want to retrieve
181182 include_archived: If true, includes archived plot groups in the results
183+ methodology: If not None, filters the groups by the methodology (eg "Coffee - EUDR")
182184
183185 Returns:
184186 See https://app.picterra.ch/public/apidocs/plots_analysis/v1/#tag/plots-groups/operation/getPlotsGroupsList
@@ -190,6 +192,8 @@ def list_plots_groups(
190192 data ["page_number" ] = int (page_number )
191193 if include_archived :
192194 data ["include_archived" ] = include_archived
195+ if methodology is not None :
196+ data ["methodology" ] = methodology
193197 return self ._return_results_page ("plots_groups" , data )
194198
195199 def analyze_plots_precheck (
@@ -304,6 +308,8 @@ def list_plots_analysis_reports(
304308 plots_group_id : Optional [str ] = None ,
305309 page_number : Optional [int ] = None ,
306310 include_archived : bool = False ,
311+ search : Optional [str ] = None ,
312+ report_type : Optional [str ] = None ,
307313 ) -> ResultsPage :
308314 """
309315 List all the reports belonging to a given plots analysis, see `ResultsPage`
@@ -314,6 +320,9 @@ def list_plots_analysis_reports(
314320 page_number: Optional page (from 1) of the list we want to retrieve
315321 include_archived: Defaults to false. If true, includes archived analysis reports in the
316322 results
323+ search: Optional term to search report types by name
324+ report_type: Optional type of report to restrict the list by, use list_plots_analysis_report_types
325+ to know which the available report types are
317326
318327 Deprecated arguments:
319328 plots_group_id: ignored, do not provide it
@@ -329,6 +338,10 @@ def list_plots_analysis_reports(
329338 params ["page_number" ] = int (page_number )
330339 if include_archived :
331340 params ["include_archived" ] = include_archived
341+ if search is not None :
342+ params ["search" ] = search .strip ()
343+ if report_type is not None :
344+ params ["report_type" ] = report_type
332345 return self ._return_results_page (
333346 f"plots_analyses/{ plots_analysis_id } /reports/" , params
334347 )
@@ -337,12 +350,14 @@ def list_plots_analysis_report_types(
337350 self ,
338351 plots_analysis_id : str ,
339352 plots_group_id : Optional [str ] = None ,
353+ search : Optional [str ] = None ,
340354 ) -> List [Dict [str , Any ]]:
341355 """
342356 List all the plots analyses report types the user can use (see create_plots_analysis_report)
343357
344358 Args:
345359 plots_analysis_id: id of the plots analysis
360+ search: optional term to search report types by name, if any
346361
347362 Deprecated arguments:
348363 plots_group_id: ignored, do not provide it
@@ -353,8 +368,12 @@ def list_plots_analysis_report_types(
353368 if plots_group_id is not None :
354369 warnings .warn ("Passing plots_group_id is not needed anymore, remove it" , DeprecationWarning )
355370
371+ params : Dict [str , Any ] = {}
372+ if search is not None :
373+ params ["search" ] = search .strip ()
356374 resp = self .sess .get (
357- self ._full_url (f"plots_analyses/{ plots_analysis_id } /reports/types/" )
375+ self ._full_url (f"plots_analyses/{ plots_analysis_id } /reports/types/" ),
376+ params = params
358377 )
359378 _check_resp_is_ok (resp , "Couldn't list report types" )
360379 return resp .json ()
0 commit comments