Skip to content

Commit 5eb11bb

Browse files
author
Priyadarshini Piramanayagam
committed
fix: rename file, add model
1 parent 3124c3b commit 5eb11bb

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

nisystemlink/clients/result/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ._result import Result, StatusObject, StatusType
2-
from ._create_results_partial_success import ResultsPartialSuccess
2+
from ._results_partial_success import ResultsPartialSuccess
33
from ._delete_results_partial_success import DeleteResultsPartialSuccess
44
from ._paged_results import PagedResults
55
from ._query_results_request import (

nisystemlink/clients/result/models/_query_results_request.py

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class ResultField(str, Enum):
10-
"""The valid ways to order a result query."""
10+
"""The allowed field for which the values can be queried for."""
1111

1212
ID = "ID"
1313
STARTED_AT = "STARTED_AT"
@@ -18,10 +18,27 @@ class ResultField(str, Enum):
1818
OPERATOR = "OPERATOR"
1919
SERIAL_NUMBER = "SERIAL_NUMBER"
2020
PART_NUMBER = "PART_NUMBER"
21-
PROPERTIES = "PROPERTIES"
21+
PRODUCT = "PRODUCT"
2222
TOTAL_TIME_IN_SECONDS = "TOTAL_TIME_IN_SECONDS"
2323

2424

25+
class ResultOrderByField(str, Enum):
26+
"""The fields by which results can be ordered."""
27+
28+
ID = "ID"
29+
STARTED_AT = "STARTED_AT"
30+
UPDATED_AT = "UPDATED_AT"
31+
PROGRAM_NAME = "PROGRAM_NAME"
32+
SYSTEM_ID = "SYSTEM_ID"
33+
HOST_NAME = "HOST_NAME"
34+
OPERATOR = "OPERATOR"
35+
SERIAL_NUMBER = "SERIAL_NUMBER"
36+
PART_NUMBER = "PART_NUMBER"
37+
PRODUCT = "PRODUCT"
38+
TOTAL_TIME_IN_SECONDS = "TOTAL_TIME_IN_SECONDS"
39+
PROPERTIES = "PROPERTIES"
40+
41+
2542
class ComparisonType(str, Enum):
2643
"""The valid ways to order a result query."""
2744

@@ -30,6 +47,32 @@ class ComparisonType(str, Enum):
3047
LEXICOGRAPHIC = "LEXICOGRAPHIC"
3148

3249

50+
class Projection(str, Enum):
51+
"""The allowed projections for query.
52+
53+
When using projection, only the fields specified by the projection element will be included in
54+
the response.
55+
"""
56+
57+
ID = "ID"
58+
STATUS = "STATUS"
59+
STARTED_AT = "STARTED_AT"
60+
UPDATED_AT = "UPDATED_AT"
61+
PROGRAM_NAME = "PROGRAM_NAME"
62+
SYSTEM_ID = "SYSTEM_ID"
63+
HOST_NAME = "HOST_NAME"
64+
OPERATOR = "OPERATOR"
65+
SERIAL_NUMBER = "SERIAL_NUMBER"
66+
PART_NUMBER = "PART_NUMBER"
67+
TOTAL_TIME_IN_SECONDS = "TOTAL_TIME_IN_SECONDS"
68+
KEYWORDS = "KEYWORDS"
69+
PROPERTIES = "PROPERTIES"
70+
FILE_IDS = "FILE_IDS"
71+
DATA_TABLE_IDS = "DATA_TABLE_IDS"
72+
STATUS_TYPE_SUMMARY = "STATUS_TYPE_SUMMARY"
73+
WORKSPACE = "WORKSPACE"
74+
75+
3376
class QueryResultsBase(JsonModel):
3477
filter: Optional[str] = None
3578
"""
@@ -100,7 +143,7 @@ class QueryProductsBase(JsonModel):
100143

101144
class QueryResultsRequest(QueryResultsBase, QueryProductsBase, WithPaging):
102145

103-
order_by: Optional[ResultField] = Field(None, alias="orderBy")
146+
order_by: Optional[ResultOrderByField] = Field(None, alias="orderBy")
104147
"""Specifies the fields to use to sort the results.
105148
By default, results are sorted by `id`
106149
"""
@@ -118,6 +161,10 @@ class QueryResultsRequest(QueryResultsBase, QueryProductsBase, WithPaging):
118161
"""Specifies whether to return the results in descending order.
119162
By default, this value is `false` and results are sorted in ascending order.
120163
"""
164+
projection: Optional[List[Projection]] = None
165+
"""Specifies the fields to include in the returned results.
166+
Fields you do not specify are excluded. Returns all fields if no value is specified.
167+
"""
121168
take: Optional[int] = None
122169
"""Maximum number of results to return in the current API response.
123170
Uses the default if the specified value is negative. The default value is `1000` results.

nisystemlink/clients/result/models/_create_results_partial_success.py renamed to nisystemlink/clients/result/models/_results_partial_success.py

File renamed without changes.

0 commit comments

Comments
 (0)