Skip to content

Commit 378c54d

Browse files
barnabas-nagy-niBarnabas Nagy
andauthored
fix: Align FileClient.query_files_linq docstring with Swagger API documentation (#201)
Co-authored-by: Barnabas Nagy <barnabas.nagy@emerson.com>
1 parent 4004ded commit 378c54d

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

nisystemlink/clients/file/_file_client.py

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,58 @@ def query_files_linq(
153153
"""Queries file using LINQ filters.
154154
155155
Args:
156-
query: The LINQ query request containing the query string and optional parameters.
156+
query: The LINQ query request containing the following parameters:
157+
158+
- **filter** (:class:`str`, optional): The filter criteria for files. Consists of a
159+
string of queries composed using AND/OR operators. String values and date strings
160+
need to be enclosed in double quotes. Parentheses can be used around filters to
161+
better define the order of operations.
162+
163+
Filter syntax: ``[property name][operator][operand] and [property name][operator][operand]``
164+
165+
Operators:
166+
167+
- Equals: ``x = y``
168+
- Not equal: ``x != y``
169+
- Greater than: ``x > y``
170+
- Greater than or equal: ``x >= y``
171+
- Less than: ``x < y``
172+
- Less than or equal: ``x <= y``
173+
- Logical AND: ``x and y`` or ``x && y``
174+
- Logical OR: ``x or y`` or ``x || y``
175+
- Contains: ``x.Contains(y)`` — checks if a list contains an element
176+
- Not Contains: ``!x.Contains(y)`` — checks if a list does not contain an element
177+
178+
Valid file properties for filtering:
179+
180+
- ``created``: ISO timestamp string (e.g. ``"2023-01-01T08:00:00.000Z"``)
181+
- ``updated``: ISO timestamp string (e.g. ``"2023-01-01T08:00:00.000Z"``)
182+
- ``extension``: File extension (e.g. ``png``, ``txt``, ``pdf``)
183+
- ``size``: File size in bytes (e.g. ``1024``)
184+
- ``userId``: User ID that created the file (e.g. ``"8abc4b87-07d4-4f84-b54f-48eec89b07d4"``)
185+
- ``properties``: File properties (e.g. ``properties['x'] = 'y'``)
186+
- ``workspace``: The workspace of the files (e.g. ``"88974b87-07d4-4f84-b54f-48eec89b11ed"``)
187+
188+
Example::
189+
190+
'(name = "myfile.txt" OR extension = "png")'
191+
' and (DateTime(created) >'
192+
' DateTime.parse("2023-01-01T08:00:00.000Z"))'
193+
' and (size < 1024)'
194+
195+
- **order_by** (:class:`~nisystemlink.clients.file.models.FileLinqQueryOrderBy`, optional):
196+
The file property to order results by. One of ``created``, ``updated``,
197+
``extension``, ``size``, or ``workspace``. Defaults to ``updated``.
198+
199+
- **order_by_descending** (:class:`bool`, optional): Whether to return the files in
200+
descending order. Defaults to ``True``.
201+
202+
- **skip** (:class:`int`, optional): How many files to skip in the result when paging.
203+
For example, a list of 100 files with a skip value of 50 will return entries
204+
starting from the 51st file. Defaults to ``0``.
205+
206+
- **take** (:class:`int`, optional): Maximum number of files to return.
207+
Defaults to ``1000``.
157208
158209
Returns:
159210
File Query Response

0 commit comments

Comments
 (0)