@@ -35,6 +35,28 @@ def apply_query_params(self, url):
3535
3636
3737class RequestOptions (RequestOptionsBase ):
38+ """
39+ This class is used to manage the options that can be used when querying content on the server.
40+ Optionally initialize with a page number and page size to control the number of items returned.
41+
42+ Additionally, you can add sorting and filtering options to the request.
43+
44+ The `sort` and `filter` options are set-like objects, so you can only add a field once. If you add the same field
45+ multiple times, only the last one will be used.
46+
47+ The list of fields that can be sorted on or filtered by can be found in the `Field`
48+ class contained within this class.
49+
50+ Parameters
51+ ----------
52+ pagenumber: int, optional
53+ The page number to start the query on. Default is 1.
54+
55+ pagesize: int, optional
56+ The number of items to return per page. Default is 100. Can also read
57+ from the environment variable `TSC_PAGE_SIZE`
58+ """
59+
3860 def __init__ (self , pagenumber = 1 , pagesize = None ):
3961 self .pagenumber = pagenumber
4062 self .pagesize = pagesize or config .PAGE_SIZE
@@ -199,13 +221,43 @@ def get_query_params(self):
199221
200222 def vf (self , name : str , value : str ) -> Self :
201223 """Apply a filter based on a column within the view.
202- Note that when filtering on a boolean type field, the only valid values are 'true' and 'false'"""
224+ Note that when filtering on a boolean type field, the only valid values are 'true' and 'false'
225+
226+ For more detail see: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_filtering_and_sorting.htm#Filter-query-views
227+
228+ Parameters
229+ ----------
230+ name: str
231+ The name of the column to filter on
232+
233+ value: str
234+ The value to filter on
235+
236+ Returns
237+ -------
238+ Self
239+ The current object
240+ """
203241 self .view_filters .append ((name , value ))
204242 return self
205243
206244 def parameter (self , name : str , value : str ) -> Self :
207245 """Apply a filter based on a parameter within the workbook.
208- Note that when filtering on a boolean type field, the only valid values are 'true' and 'false'"""
246+ Note that when filtering on a boolean type field, the only valid values are 'true' and 'false'
247+
248+ Parameters
249+ ----------
250+ name: str
251+ The name of the parameter to filter on
252+
253+ value: str
254+ The value to filter on
255+
256+ Returns
257+ -------
258+ Self
259+ The current object
260+ """
209261 self .view_parameters .append ((name , value ))
210262 return self
211263
@@ -257,14 +309,60 @@ def get_query_params(self) -> dict:
257309
258310
259311class CSVRequestOptions (_DataExportOptions ):
312+ """
313+ Options that can be used when exporting a view to CSV. Set the maxage to control the age of the data exported.
314+ Filters to the underlying data can be applied using the `vf` and `parameter` methods.
315+
316+ Parameters
317+ ----------
318+ maxage: int, optional
319+ The maximum age of the data to export. Shortest possible duration is 1
320+ minute. No upper limit. Default is -1, which means no limit.
321+ """
322+
260323 extension = "csv"
261324
262325
263326class ExcelRequestOptions (_DataExportOptions ):
327+ """
328+ Options that can be used when exporting a view to Excel. Set the maxage to control the age of the data exported.
329+ Filters to the underlying data can be applied using the `vf` and `parameter` methods.
330+
331+ Parameters
332+ ----------
333+ maxage: int, optional
334+ The maximum age of the data to export. Shortest possible duration is 1
335+ minute. No upper limit. Default is -1, which means no limit.
336+ """
337+
264338 extension = "xlsx"
265339
266340
267341class ImageRequestOptions (_ImagePDFCommonExportOptions ):
342+ """
343+ Options that can be used when exporting a view to an image. Set the maxage to control the age of the data exported.
344+ Filters to the underlying data can be applied using the `vf` and `parameter` methods.
345+
346+ Parameters
347+ ----------
348+ imageresolution: str, optional
349+ The resolution of the image to export. Valid values are "high" or None. Default is None.
350+ Image width and actual pixel density are determined by the display context
351+ of the image. Aspect ratio is always preserved. Set the value to "high" to
352+ ensure maximum pixel density.
353+
354+ maxage: int, optional
355+ The maximum age of the data to export. Shortest possible duration is 1
356+ minute. No upper limit. Default is -1, which means no limit.
357+
358+ viz_height: int, optional
359+ The height of the viz in pixels. If specified, viz_width must also be specified.
360+
361+ viz_width: int, optional
362+ The width of the viz in pixels. If specified, viz_height must also be specified.
363+
364+ """
365+
268366 extension = "png"
269367
270368 # if 'high' isn't specified, the REST API endpoint returns an image with standard resolution
@@ -283,6 +381,29 @@ def get_query_params(self):
283381
284382
285383class PDFRequestOptions (_ImagePDFCommonExportOptions ):
384+ """
385+ Options that can be used when exporting a view to PDF. Set the maxage to control the age of the data exported.
386+ Filters to the underlying data can be applied using the `vf` and `parameter` methods.
387+
388+ Parameters
389+ ----------
390+ page_type: str, optional
391+ The page type of the PDF to export. Valid values are accessible via the `PageType` class.
392+
393+ orientation: str, optional
394+ The orientation of the PDF to export. Valid values are accessible via the `Orientation` class.
395+
396+ maxage: int, optional
397+ The maximum age of the data to export. Shortest possible duration is 1
398+ minute. No upper limit. Default is -1, which means no limit.
399+
400+ viz_height: int, optional
401+ The height of the viz in pixels. If specified, viz_width must also be specified.
402+
403+ viz_width: int, optional
404+ The width of the viz in pixels. If specified, viz_height must also be specified.
405+ """
406+
286407 class PageType :
287408 A3 = "a3"
288409 A4 = "a4"
0 commit comments