Skip to content

Commit 7d773b4

Browse files
committed
fix:PRComments
1 parent 5874d20 commit 7d773b4

7 files changed

+32
-42
lines changed
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
from datetime import datetime
2-
from typing import Optional
32

43
from nisystemlink.clients.core._uplink._json_model import JsonModel
54

65

76
class AssetUtilizationHistoryItem(JsonModel):
87
"""Model representing an asset utilization history record."""
98

10-
utilization_identifier: Optional[str] = None
9+
utilization_identifier: str | None = None
1110
"""String representing the unique identifier of an asset utilization history record."""
1211

13-
asset_identifier: Optional[str] = None
12+
asset_identifier: str | None = None
1413
"""String representing the unique identifier of an asset."""
1514

16-
minion_id: Optional[str] = None
15+
minion_id: str | None = None
1716
"""Identifier of the minion where the asset is located."""
1817

19-
category: Optional[str] = None
18+
category: str | None = None
2019
"""String representing the utilization task category."""
2120

22-
task_name: Optional[str] = None
21+
task_name: str | None = None
2322
"""String representing the name of the task."""
2423

25-
user_name: Optional[str] = None
24+
user_name: str | None = None
2625
"""String representing the name of the operator who utilized the asset."""
2726

28-
start_timestamp: Optional[datetime] = None
27+
start_timestamp: datetime | None = None
2928
"""A date time value which can be used to specify the start of an utilization."""
3029

31-
end_timestamp: Optional[datetime] = None
30+
end_timestamp: datetime | None = None
3231
"""A date time value which can be used to specify the end of an utilization."""
3332

34-
heartbeat_timestamp: Optional[datetime] = None
33+
heartbeat_timestamp: datetime | None = None
3534
"""A date time value which can be used to specify the heartbeat of an utilization."""
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import List, Optional
2-
31
from nisystemlink.clients.core._uplink._with_paging import WithPaging
42

53
from ._asset_utilization_history_item import AssetUtilizationHistoryItem
@@ -8,5 +6,5 @@
86
class AssetUtilizationHistoryResponse(WithPaging):
97
"""Response model for asset utilization history query."""
108

11-
asset_utilizations: Optional[List[AssetUtilizationHistoryItem]] = None
9+
asset_utilizations: list[AssetUtilizationHistoryItem] | None = None
1210
"""Array of asset utilizations."""
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from datetime import datetime
22
from enum import Enum
3-
from typing import Optional
43

54
from nisystemlink.clients.core._uplink._with_paging import WithPaging
65

@@ -14,33 +13,33 @@ class UtilizationOrderBy(Enum):
1413
class QueryAssetUtilizationHistoryRequest(WithPaging):
1514
"""Model for object containing filters for asset utilization and assets."""
1615

17-
utilization_filter: Optional[str] = None
16+
utilization_filter: str | None = None
1817
"""
1918
The filter criteria for asset utilization. Consists of a string of queries
2019
composed using AND/OR operators. Valid properties: MinionId, Category, UserName, TaskName,
2120
StartTimestamp, EndTimestamp.
2221
"""
2322

24-
asset_filter: Optional[str] = None
23+
asset_filter: str | None = None
2524
"""
2625
The filter criteria for assets. Consists of a string of queries composed
2726
using AND/OR operators. Valid properties include AssetIdentifier, SerialNumber, ModelName,
2827
VendorName, Location.MinionId, and many others.
2928
"""
3029

31-
take: Optional[int] = None
30+
take: int | None = None
3231
"""The maximum number of asset utilization history records to return."""
3332

34-
order_by: Optional[UtilizationOrderBy] = None
33+
order_by: UtilizationOrderBy | None = None
3534
"""
3635
The field to order results by. If not provided, default ordering is applied.
3736
"""
3837

39-
order_by_descending: Optional[bool] = None
38+
order_by_descending: bool | None = None
4039
"""Whether to return the asset utilization history records in descending order."""
4140

42-
start_time: Optional[datetime] = None
41+
start_time: datetime | None = None
4342
"""Start of the date range. Defaults to 90 days ago."""
4443

45-
end_time: Optional[datetime] = None
44+
end_time: datetime | None = None
4645
"""End of the date range. Defaults to current time."""
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Model for start utilization partial success response."""
22

3-
from typing import List, Optional
4-
53
from nisystemlink.clients.core._api_error import ApiError
64
from nisystemlink.clients.core._uplink._json_model import JsonModel
75

@@ -11,11 +9,11 @@
119
class StartUtilizationPartialSuccessResponse(JsonModel):
1210
"""Response model for start utilization operation with partial success support."""
1311

14-
error: Optional[ApiError] = None
12+
error: ApiError | None = None
1513
"""Error information if any failures occurred."""
1614

17-
assets_with_started_utilization: Optional[List[AssetIdentification]] = None
15+
assets_with_started_utilization: list[AssetIdentification] | None = None
1816
"""Array containing the asset identification data for the assets that started being utilized."""
1917

20-
failed: Optional[List[AssetIdentification]] = None
18+
failed: list[AssetIdentification] | None = None
2119
"""Array containing the asset identification data for the assets that failed to start being utilized."""
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Model for start utilization request."""
22

33
from datetime import datetime
4-
from typing import List, Optional
54

65
from nisystemlink.clients.core._uplink._json_model import JsonModel
76

@@ -11,24 +10,24 @@
1110
class StartUtilizationRequest(JsonModel):
1211
"""Request model for starting asset utilization tracking."""
1312

14-
utilization_identifier: Optional[str] = None
13+
utilization_identifier: str | None = None
1514
"""String representing the unique identifier of an asset utilization history record."""
1615

17-
minion_id: Optional[str] = None
16+
minion_id: str | None = None
1817
"""Identifier of the minion where the utilized assets are located."""
1918

20-
asset_identifications: Optional[List[AssetIdentification]] = None
19+
asset_identifications: list[AssetIdentification] | None = None
2120
"""Array of the identification information for the assets which are utilized.
2221
The maximum number of asset identifications allowed per request is 100."""
2322

24-
utilization_category: Optional[str] = None
23+
utilization_category: str | None = None
2524
"""String representing the utilization category."""
2625

27-
task_name: Optional[str] = None
26+
task_name: str | None = None
2827
"""String representing the name of the task."""
2928

30-
user_name: Optional[str] = None
29+
user_name: str | None = None
3130
"""String representing the name of the operator who utilized the asset."""
3231

33-
utilization_timestamp: Optional[datetime] = None
32+
utilization_timestamp: datetime | None = None
3433
"""A date time value which can be used to specify the start of an utilization."""
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
"""Model for update utilization partial success response."""
22

3-
from typing import List, Optional
4-
53
from nisystemlink.clients.core._api_error import ApiError
64
from nisystemlink.clients.core._uplink._json_model import JsonModel
75

86

97
class UpdateUtilizationPartialSuccessResponse(JsonModel):
108
"""Response model for update utilization operation with partial success support."""
119

12-
error: Optional[ApiError] = None
10+
error: ApiError | None = None
1311
"""Error information if any failures occurred."""
1412

15-
updated_utilization_ids: Optional[List[str]] = None
13+
updated_utilization_ids: list[str] | None = None
1614
"""Array of utilization identifiers for the entries that were updated."""
1715

18-
failed: Optional[List[str]] = None
16+
failed: list[str] | None = None
1917
"""Array of utilization identifiers for the entries that failed to update."""
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
"""Model for updating utilization (heartbeat or end)."""
22

33
from datetime import datetime
4-
from typing import List, Optional
54

65
from nisystemlink.clients.core._uplink._json_model import JsonModel
76

87

98
class UpdateUtilizationRequest(JsonModel):
109
"""Request model for updating utilization (heartbeat or end)."""
1110

12-
utilization_identifiers: Optional[List[str]] = None
11+
utilization_identifiers: list[str] | None = None
1312
"""Array representing the unique identifier of an asset utilization history record."""
1413

15-
utilization_timestamp: Optional[datetime] = None
14+
utilization_timestamp: datetime | None = None
1615
"""A date time value which can be used to specify the heartbeat timestamp."""

0 commit comments

Comments
 (0)