|
| 1 | +from datetime import datetime |
| 2 | +from typing import List, Optional, Union |
| 3 | + |
| 4 | +from nisystemlink.clients.core._uplink._with_paging import WithPaging |
| 5 | +from pydantic import StrictBool, StrictInt |
| 6 | + |
| 7 | +from ._order_by import OrderBy |
| 8 | + |
| 9 | + |
| 10 | +class QueryTablesRequest(WithPaging): |
| 11 | + """Request parameters for querying tables.""" |
| 12 | + |
| 13 | + filter: str |
| 14 | + """The table query filter in `Dynamic LINQ`_ format. |
| 15 | +
|
| 16 | + .. _Dynamic LINQ: https://github.com/ni/systemlink-OpenAPI-documents/wiki/Dynamic-Linq-Query-Language |
| 17 | +
|
| 18 | + Allowed properties in the filter are: |
| 19 | +
|
| 20 | + * ``createdAt``: DateTime the table was created |
| 21 | + * ``createdWithin``: TimeSpan in which the table was created |
| 22 | + * ``id``: String value uniquely identifying the table |
| 23 | + * ``name``: String name for the table |
| 24 | + * ``metadataModifiedAt``: DateTime the table's metadata was last modified |
| 25 | + * ``metadataModifiedWithin``: TimeSpan in which the table's metadata was |
| 26 | + last modified |
| 27 | + * ``properties``: Dictionary with string keys and values representing table |
| 28 | + metadata |
| 29 | + * ``rowsModifiedAt``: DateTime rows were last appended to the table |
| 30 | + * ``rowsModifiedWithin``: TimeSpan within rows were last appended to the |
| 31 | + table |
| 32 | + * ``rowCount``: Int32 number of rows in the table |
| 33 | + * ``supportsAppend``: Boolean indicating whether or not the table supports |
| 34 | + appending additional rows of data |
| 35 | + * ``workspace``: String value ID of the workspace the table belongs to |
| 36 | + * ``workspaceName``: String value name of the workspace the table belongs to |
| 37 | +
|
| 38 | + Allowed constants in the filter are: |
| 39 | +
|
| 40 | + * ``RelativeTime.CurrentDay``: TimeSpan representing the elapsed time |
| 41 | + between now and the start of the current day |
| 42 | + * ``RelativeTime.CurrentWeek``: TimeSpan representing the elapsed time |
| 43 | + between now and the start of the current week |
| 44 | + * ``RelativeTime.CurrentMonth``: TimeSpan representing the elapsed time |
| 45 | + between now and the start of the current month |
| 46 | + * ``RelativeTime.CurrentYear``: TimeSpan representing the elapsed time |
| 47 | + between now and the start of the current year |
| 48 | + """ |
| 49 | + |
| 50 | + substitutions: Optional[List[Union[StrictInt, StrictBool, str, None]]] = None |
| 51 | + """Make substitutions in the query filter expression. |
| 52 | +
|
| 53 | + Substitutions for the query expression are indicated by non-negative |
| 54 | + integers that are prefixed with the ``@`` symbol. Each substitution in the given |
| 55 | + expression will be replaced by the element at the corresponding index |
| 56 | + (zero-based) in this list. For example, ``@0`` in the filter expression will be |
| 57 | + replaced with the element at the zeroth index of the substitutions list. |
| 58 | + """ |
| 59 | + |
| 60 | + reference_time: Optional[datetime] = None |
| 61 | + """The date and time to use as the reference point for `RelativeTime` filters, |
| 62 | + including time zone information. Defaults to the time on the server in UTC.""" |
| 63 | + |
| 64 | + take: Optional[int] = None |
| 65 | + """Limits the returned list to the specified number of results.""" |
| 66 | + |
| 67 | + order_by: Optional[OrderBy] = None |
| 68 | + """The sort order of the returned list of tables.""" |
| 69 | + |
| 70 | + order_by_descending: Optional[bool] = None |
| 71 | + """Whether to sort descending instead of ascending. |
| 72 | +
|
| 73 | + The elements in the list are sorted ascending by default. If the |
| 74 | + orderByDescending parameter is specified, the elements in the list are |
| 75 | + sorted based on it's value. The orderByDescending value must be a boolean |
| 76 | + string. The elements in the list are sorted ascending if false and |
| 77 | + descending if true. |
| 78 | + """ |
0 commit comments