layrz-sdk 3.1.50__py3-none-any.whl → 4.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of layrz-sdk might be problematic. Click here for more details.
- layrz_sdk/entities/__init__.py +4 -0
- layrz_sdk/entities/action.py +5 -21
- layrz_sdk/entities/action_geofence_ownership.py +3 -8
- layrz_sdk/entities/action_kind.py +3 -8
- layrz_sdk/entities/action_subkind.py +3 -8
- layrz_sdk/entities/asset.py +14 -9
- layrz_sdk/entities/asset_constants.py +1 -1
- layrz_sdk/entities/asset_operation_mode.py +3 -8
- layrz_sdk/entities/ats_entry.py +14 -0
- layrz_sdk/entities/ats_exit_history.py +19 -35
- layrz_sdk/entities/ats_possible_entry.py +27 -0
- layrz_sdk/entities/ats_possible_exit.py +15 -18
- layrz_sdk/entities/ats_reception.py +16 -3
- layrz_sdk/entities/broadcast/service.py +1 -1
- layrz_sdk/entities/broadcast/status.py +3 -8
- layrz_sdk/entities/case.py +2 -8
- layrz_sdk/entities/case_ignored_status.py +3 -8
- layrz_sdk/entities/case_status.py +3 -8
- layrz_sdk/entities/charts/bar_chart.py +1 -7
- layrz_sdk/entities/charts/chart_alignment.py +3 -8
- layrz_sdk/entities/charts/chart_color.py +3 -8
- layrz_sdk/entities/charts/chart_data_serie_type.py +6 -11
- layrz_sdk/entities/charts/chart_data_type.py +3 -8
- layrz_sdk/entities/charts/chart_render_technology.py +3 -8
- layrz_sdk/entities/charts/column_chart.py +3 -8
- layrz_sdk/entities/charts/html_chart.py +1 -7
- layrz_sdk/entities/charts/line_chart.py +1 -7
- layrz_sdk/entities/charts/map_center_type.py +3 -8
- layrz_sdk/entities/charts/map_chart.py +1 -7
- layrz_sdk/entities/charts/number_chart.py +1 -7
- layrz_sdk/entities/charts/pie_chart.py +1 -7
- layrz_sdk/entities/charts/radar_chart.py +1 -7
- layrz_sdk/entities/charts/radial_bar_chart.py +1 -7
- layrz_sdk/entities/charts/scatter_chart.py +1 -7
- layrz_sdk/entities/charts/table_chart.py +1 -7
- layrz_sdk/entities/charts/timeline_chart.py +1 -7
- layrz_sdk/entities/checkpoint.py +1 -2
- layrz_sdk/entities/command_series_ticket.py +1 -1
- layrz_sdk/entities/comment.py +1 -1
- layrz_sdk/entities/destination_phone.py +1 -6
- layrz_sdk/entities/device.py +1 -1
- layrz_sdk/entities/event.py +1 -1
- layrz_sdk/entities/function.py +31 -14
- layrz_sdk/entities/geofence.py +1 -1
- layrz_sdk/entities/geofence_category.py +3 -8
- layrz_sdk/entities/message.py +24 -6
- layrz_sdk/entities/modbus/schema.py +2 -2
- layrz_sdk/entities/modbus/status.py +2 -2
- layrz_sdk/entities/notification_type.py +3 -8
- layrz_sdk/entities/operation.py +25 -9
- layrz_sdk/entities/operation_case_payload.py +1 -7
- layrz_sdk/entities/operation_payload.py +4 -11
- layrz_sdk/entities/operation_type.py +3 -8
- layrz_sdk/entities/outbound_service.py +1 -1
- layrz_sdk/entities/platform.py +3 -8
- layrz_sdk/entities/position.py +8 -14
- layrz_sdk/entities/presence_type.py +3 -8
- layrz_sdk/entities/preset.py +1 -2
- layrz_sdk/entities/report.py +1 -7
- layrz_sdk/entities/report_col.py +1 -7
- layrz_sdk/entities/report_data_type.py +3 -8
- layrz_sdk/entities/report_format.py +3 -8
- layrz_sdk/entities/request_type.py +3 -8
- layrz_sdk/entities/sensor.py +1 -1
- layrz_sdk/entities/sound_effect.py +3 -8
- layrz_sdk/entities/telemetry/assetmessage.py +4 -11
- layrz_sdk/entities/telemetry/devicemessage.py +8 -26
- layrz_sdk/entities/text_alignment.py +3 -8
- layrz_sdk/entities/trigger.py +1 -1
- layrz_sdk/entities/trigger_kind.py +6 -11
- layrz_sdk/entities/user.py +1 -1
- layrz_sdk/entities/waypoint.py +8 -3
- layrz_sdk/entities/weekday.py +3 -8
- {layrz_sdk-3.1.50.dist-info → layrz_sdk-4.0.1.dist-info}/METADATA +2 -5
- layrz_sdk-4.0.1.dist-info/RECORD +116 -0
- layrz_sdk/backwards.py +0 -6
- layrz_sdk-3.1.50.dist-info/RECORD +0 -115
- {layrz_sdk-3.1.50.dist-info → layrz_sdk-4.0.1.dist-info}/WHEEL +0 -0
- {layrz_sdk-3.1.50.dist-info → layrz_sdk-4.0.1.dist-info}/licenses/LICENSE +0 -0
- {layrz_sdk-3.1.50.dist-info → layrz_sdk-4.0.1.dist-info}/top_level.txt +0 -0
layrz_sdk/entities/__init__.py
CHANGED
|
@@ -8,7 +8,9 @@ from .asset import Asset
|
|
|
8
8
|
from .asset_constants import AssetConstants
|
|
9
9
|
from .asset_contact import AssetContact
|
|
10
10
|
from .asset_operation_mode import AssetOperationMode
|
|
11
|
+
from .ats_entry import AtsEntry
|
|
11
12
|
from .ats_exit_history import AtsExitExecutionHistory
|
|
13
|
+
from .ats_possible_entry import AtsPossibleEntry
|
|
12
14
|
from .ats_possible_exit import AtsPossibleExit
|
|
13
15
|
from .ats_reception import AtsReception
|
|
14
16
|
from .broadcast import (
|
|
@@ -108,6 +110,8 @@ __all__ = [
|
|
|
108
110
|
'AtsExitExecutionHistory',
|
|
109
111
|
'AtsPossibleExit',
|
|
110
112
|
'AtsReception',
|
|
113
|
+
'AtsEntry',
|
|
114
|
+
'AtsPossibleEntry',
|
|
111
115
|
'AxisConfig',
|
|
112
116
|
'BarChart',
|
|
113
117
|
'BroadcastPayload',
|
layrz_sdk/entities/action.py
CHANGED
|
@@ -23,29 +23,16 @@ class Action(BaseModel):
|
|
|
23
23
|
},
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
pk: int = Field(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
alias='id',
|
|
30
|
-
)
|
|
31
|
-
name: str = Field(
|
|
32
|
-
...,
|
|
33
|
-
description='Name of the action',
|
|
34
|
-
)
|
|
35
|
-
kind: ActionKind = Field(
|
|
36
|
-
...,
|
|
37
|
-
description='Kind of the action',
|
|
38
|
-
)
|
|
26
|
+
pk: int = Field(..., description='Primary key of the action entity', alias='id')
|
|
27
|
+
name: str = Field(..., description='Name of the action')
|
|
28
|
+
kind: ActionKind = Field(..., description='Kind of the action')
|
|
39
29
|
|
|
40
30
|
command_id: int | None = Field(
|
|
41
31
|
default=None,
|
|
42
32
|
description='Tag ID associated with the action to send commands to primary devices',
|
|
43
33
|
)
|
|
44
34
|
|
|
45
|
-
subkind: ActionSubKind = Field(
|
|
46
|
-
default=ActionSubKind.UNUSED,
|
|
47
|
-
description='Subkind of the action',
|
|
48
|
-
)
|
|
35
|
+
subkind: ActionSubKind = Field(default=ActionSubKind.UNUSED, description='Subkind of the action')
|
|
49
36
|
|
|
50
37
|
wait_for_image: bool = Field(
|
|
51
38
|
default=False,
|
|
@@ -80,7 +67,4 @@ class Action(BaseModel):
|
|
|
80
67
|
description='Ownership of the new geofence created by the action',
|
|
81
68
|
)
|
|
82
69
|
|
|
83
|
-
owner_id: int | None = Field(
|
|
84
|
-
default=None,
|
|
85
|
-
description='Owner ID',
|
|
86
|
-
)
|
|
70
|
+
owner_id: int | None = Field(default=None, description='Owner ID')
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Action geofence ownership"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Self
|
|
5
5
|
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
class ActionGeofenceOwnership(str, Enum):
|
|
7
|
+
class ActionGeofenceOwnership(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Action geofence ownership definition
|
|
15
10
|
"""
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Action kind"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Self
|
|
5
5
|
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
class ActionKind(str, Enum):
|
|
7
|
+
class ActionKind(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Action kind definition
|
|
15
10
|
"""
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Action sub kind"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Self
|
|
5
5
|
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
class ActionSubKind(str, Enum):
|
|
7
|
+
class ActionSubKind(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Action sub kind definition
|
|
15
10
|
"""
|
layrz_sdk/entities/asset.py
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
"""Asset Entity"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from typing import Any
|
|
3
|
+
from typing import Any, Self
|
|
5
4
|
|
|
6
5
|
from pydantic import BaseModel, Field, model_validator
|
|
7
6
|
|
|
8
|
-
if sys.version_info >= (3, 11):
|
|
9
|
-
from typing import Self
|
|
10
|
-
else:
|
|
11
|
-
from typing_extensions import Self
|
|
12
|
-
|
|
13
7
|
from .asset_contact import AssetContact
|
|
14
8
|
from .asset_operation_mode import AssetOperationMode
|
|
15
9
|
from .custom_field import CustomField
|
|
@@ -21,14 +15,20 @@ from .static_position import StaticPosition
|
|
|
21
15
|
class Asset(BaseModel):
|
|
22
16
|
"""Asset entity definition"""
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
model_config = {
|
|
19
|
+
'json_encoders': {
|
|
20
|
+
AssetOperationMode: lambda v: v.value,
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
pk: int = Field(description='Defines the primary key of the asset', alias='id')
|
|
25
25
|
name: str = Field(description='Defines the name of the asset')
|
|
26
26
|
vin: str | None = Field(
|
|
27
27
|
default=None,
|
|
28
28
|
description='Defines the serial number of the asset, may be an VIN, or any other unique identifier',
|
|
29
29
|
)
|
|
30
30
|
plate: str | None = Field(default=None, description='Defines the plate number of the asset')
|
|
31
|
-
|
|
31
|
+
kind_id: int | None = Field(description='Defines the type of the asset', default=None)
|
|
32
32
|
operation_mode: AssetOperationMode = Field(description='Defines the operation mode of the asset')
|
|
33
33
|
sensors: list[Sensor] = Field(default_factory=list, description='Defines the list of sensors of the asset')
|
|
34
34
|
custom_fields: list[CustomField] = Field(
|
|
@@ -85,3 +85,8 @@ class Asset(BaseModel):
|
|
|
85
85
|
default=None,
|
|
86
86
|
description='Owner ID',
|
|
87
87
|
)
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
def asset_type(self: Self) -> int | None:
|
|
91
|
+
"""Get asset type"""
|
|
92
|
+
return self.kind_id
|
|
@@ -15,7 +15,7 @@ class AssetConstants(BaseModel):
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
distance_traveled: float = Field(default=0.0, description='Total distance traveled by the asset in meters')
|
|
18
|
-
primary_device: str = Field(default='N/
|
|
18
|
+
primary_device: str = Field(default='N/A', description='Primary device associated with the asset')
|
|
19
19
|
elapsed_time: timedelta = Field(
|
|
20
20
|
default=timedelta(seconds=0),
|
|
21
21
|
description='Total elapsed time for the asset in seconds',
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Asset Operation Mode"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Self
|
|
5
5
|
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
class AssetOperationMode(str, Enum):
|
|
7
|
+
class AssetOperationMode(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Asset Operation mode definition
|
|
15
10
|
It's an enum of the operation mode of the asset.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Entry entity"""
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AtsEntry(BaseModel):
|
|
7
|
+
"""Entry entity"""
|
|
8
|
+
|
|
9
|
+
pk: int = Field(description='Defines the primary key of the Function', alias='id')
|
|
10
|
+
old_tank_level: float = Field(description='Old tank level in liters', default=0.0)
|
|
11
|
+
new_tank_level: float = Field(description='New tank level in liters', default=0.0)
|
|
12
|
+
density: float = Field(description='Density of the fuel in kg/m3', default=0.0)
|
|
13
|
+
temperature: float = Field(description='Temperature of the fuel in Celsius', default=0.0)
|
|
14
|
+
is_executed_by_command: bool = Field(description='Indicates if the entry is executed by command', default=False)
|
|
@@ -1,58 +1,42 @@
|
|
|
1
1
|
"""Exit Execution History"""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
-
from typing import Literal
|
|
4
|
+
from typing import Literal
|
|
5
5
|
|
|
6
6
|
from pydantic import (
|
|
7
7
|
BaseModel,
|
|
8
8
|
ConfigDict,
|
|
9
9
|
Field,
|
|
10
|
-
PositiveInt, # useful if you later want a non-nullable positive int
|
|
11
|
-
conint,
|
|
12
10
|
)
|
|
13
11
|
|
|
14
12
|
|
|
15
13
|
class AtsExitExecutionHistory(BaseModel):
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
model_config = {
|
|
15
|
+
'json_encoders': {
|
|
16
|
+
datetime: lambda v: v.timestamp(),
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
pk: int = Field(description='Primary key of the Exit Execution History', alias='id')
|
|
20
|
+
|
|
21
|
+
from_asset_id: int = Field(
|
|
19
22
|
description='ID of the asset from which the exit is initiated',
|
|
20
23
|
)
|
|
21
|
-
|
|
24
|
+
to_asset_id: int = Field(
|
|
22
25
|
description='ID of the asset to which the exit is directed',
|
|
23
26
|
)
|
|
24
27
|
|
|
25
|
-
status: Literal['PENDING', 'FAILED', 'SUCCESS'] = Field(
|
|
26
|
-
default='PENDING',
|
|
27
|
-
)
|
|
28
|
-
from_app: Optional[Literal['ATSWEB', 'ATSMOBILE', 'NFC']] = Field(
|
|
29
|
-
default=None,
|
|
30
|
-
description='Application from which the exit was initiated',
|
|
31
|
-
)
|
|
28
|
+
status: Literal['PENDING', 'FAILED', 'SUCCESS'] = Field(default='PENDING')
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
from_app: Literal['ATSWEB', 'ATSMOBILE', 'NFC'] | None = Field(
|
|
34
31
|
default=None,
|
|
35
|
-
description='
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
generated_by: int = Field(
|
|
39
|
-
description='ID of the user or system that initiated the exit',
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
queue_id: Optional[int] = Field(
|
|
43
|
-
default=None,
|
|
44
|
-
description='ID of the queue associated with the exit',
|
|
45
|
-
)
|
|
46
|
-
to_asset_mileage: Optional[float] = Field(
|
|
47
|
-
default=None,
|
|
48
|
-
description='Mileage of the asset to which the exit is directed',
|
|
32
|
+
description='Application from which the exit was initiated',
|
|
49
33
|
)
|
|
50
34
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
description='Timestamp when the exit was last updated',
|
|
56
|
-
)
|
|
35
|
+
error_response: str | None = Field(default=None, description='Error response received during the exit process')
|
|
36
|
+
generated_by_id: int = Field(description='ID of the user or system that initiated the exit')
|
|
37
|
+
queue_id: int | None = Field(default=None, description='ID of the queue associated with the exit')
|
|
38
|
+
to_asset_mileage: float | None = Field(default=None, description='Mileage of the asset to which the exit is directed')
|
|
57
39
|
|
|
40
|
+
created_at: datetime = Field(description='Timestamp when the exit was created')
|
|
41
|
+
updated_at: datetime = Field(description='Timestamp when the exit was last updated')
|
|
58
42
|
model_config = ConfigDict(from_attributes=True)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""Entry entity"""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AtsPossibleEntry(BaseModel):
|
|
9
|
+
"""Entry entity"""
|
|
10
|
+
|
|
11
|
+
initial_tank_level: float = Field(description='Initial tank level in liters', default=0.0)
|
|
12
|
+
tank_accumulator: float = Field(description='Tank accumulator in liters', default=0.0)
|
|
13
|
+
is_ready: bool = Field(description='Indicates if the entry is ready', default=False)
|
|
14
|
+
is_validated: bool = Field(description='Indicates if the entry is validated', default=False)
|
|
15
|
+
start_at: datetime = Field(description='Start time of the entry')
|
|
16
|
+
end_at: datetime | None = Field(description='End time of the entry')
|
|
17
|
+
accumulator_history: list[float] = Field(
|
|
18
|
+
default_factory=list, description='History of the tank accumulator in liters'
|
|
19
|
+
)
|
|
20
|
+
is_recalculated: bool = Field(description='Indicates if the entry is recalculated', default=False)
|
|
21
|
+
is_blackbox: bool = Field(description='Indicates if the entry is a black box', default=False)
|
|
22
|
+
is_executed_by_command: bool = Field(description='Indicates if the entry is executed by command', default=False)
|
|
23
|
+
is_ready_by_reception: bool = Field(description='Indicates if the entry is ready by reception', default=False)
|
|
24
|
+
false_positive_count: int = Field(description='Count of false positives for the entry', default=0)
|
|
25
|
+
reception_id: int | None = Field(
|
|
26
|
+
description='Reception ID associated with the entry', default=None, alias='receptionId'
|
|
27
|
+
)
|
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
"""Ats Exit entity"""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
-
from typing import Optional
|
|
5
4
|
|
|
6
|
-
from pydantic import
|
|
7
|
-
BaseModel,
|
|
8
|
-
ConfigDict,
|
|
9
|
-
Field,
|
|
10
|
-
PositiveInt, # useful if you later want a non-nullable positive int
|
|
11
|
-
conint,
|
|
12
|
-
)
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
13
6
|
|
|
14
7
|
|
|
15
8
|
class AtsPossibleExit(BaseModel):
|
|
16
9
|
"""AtsPossibleExit entity"""
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
model_config = {
|
|
12
|
+
'json_encoders': {
|
|
13
|
+
datetime: lambda v: v.timestamp(),
|
|
14
|
+
}
|
|
15
|
+
}
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
pk: int = Field(description='Defines the primary key of the AtsPossibleExit', alias='id')
|
|
18
|
+
|
|
19
|
+
identifier: int | None = Field(
|
|
22
20
|
default=None,
|
|
23
21
|
description='Nullable positive big integer identifier for the exit',
|
|
22
|
+
ge=0,
|
|
24
23
|
)
|
|
25
24
|
|
|
26
25
|
# Volume / gauge snapshots
|
|
27
|
-
initial_tank_volume:
|
|
26
|
+
initial_tank_volume: float | None = Field(
|
|
28
27
|
default=None,
|
|
29
28
|
description='Initial tank volume in liters',
|
|
30
29
|
)
|
|
31
|
-
initial_fluxometer:
|
|
30
|
+
initial_fluxometer: float | None = Field(
|
|
32
31
|
default=None,
|
|
33
32
|
description='Initial fluxometer reading in liters',
|
|
34
33
|
)
|
|
@@ -56,7 +55,7 @@ class AtsPossibleExit(BaseModel):
|
|
|
56
55
|
default_factory=datetime.now,
|
|
57
56
|
description='Timestamp when the exit started',
|
|
58
57
|
)
|
|
59
|
-
end_at:
|
|
58
|
+
end_at: datetime | None = Field(
|
|
60
59
|
default=None,
|
|
61
60
|
description='Timestamp when the exit ended',
|
|
62
61
|
)
|
|
@@ -66,13 +65,11 @@ class AtsPossibleExit(BaseModel):
|
|
|
66
65
|
default=False,
|
|
67
66
|
description='Indicates if the exit has been recalculated',
|
|
68
67
|
)
|
|
69
|
-
is_blackbox:
|
|
68
|
+
is_blackbox: bool | None = Field(
|
|
70
69
|
default=False,
|
|
71
70
|
description='Indicates if the exit is a blackbox',
|
|
72
71
|
)
|
|
73
|
-
false_positive_count:
|
|
72
|
+
false_positive_count: int | None = Field(
|
|
74
73
|
default=0,
|
|
75
74
|
description='Count of false positives detected',
|
|
76
75
|
)
|
|
77
|
-
|
|
78
|
-
model_config = ConfigDict(from_attributes=True) # enables .from_orm()
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"""Ats Reception entity"""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
-
from typing import Optional
|
|
5
4
|
|
|
6
5
|
from pydantic import BaseModel, Field
|
|
7
6
|
|
|
7
|
+
from layrz_sdk.constants import UTC
|
|
8
|
+
|
|
8
9
|
|
|
9
10
|
class AtsReception(BaseModel):
|
|
10
11
|
"""AtsReception entity"""
|
|
@@ -14,12 +15,24 @@ class AtsReception(BaseModel):
|
|
|
14
15
|
description='Volume bought in liters',
|
|
15
16
|
default=0.0,
|
|
16
17
|
)
|
|
17
|
-
real_volume:
|
|
18
|
+
real_volume: float | None = Field(
|
|
18
19
|
description='Real volume in liters',
|
|
19
20
|
default=None,
|
|
20
21
|
)
|
|
21
22
|
|
|
22
23
|
received_at: datetime = Field(
|
|
23
24
|
description='Date and time when the reception was made',
|
|
24
|
-
default_factory=datetime.now,
|
|
25
|
+
default_factory=lambda: datetime.now(UTC),
|
|
26
|
+
)
|
|
27
|
+
fuel_type: str = Field(
|
|
28
|
+
description='Type of fuel used in the reception',
|
|
29
|
+
default='',
|
|
30
|
+
)
|
|
31
|
+
is_merged: bool = Field(
|
|
32
|
+
description='Indicates if the reception is merged with another',
|
|
33
|
+
default=False,
|
|
34
|
+
)
|
|
35
|
+
order_id: int | None = Field(
|
|
36
|
+
description='Order ID associated with the reception',
|
|
37
|
+
default=None,
|
|
25
38
|
)
|
|
@@ -8,6 +8,6 @@ from pydantic import BaseModel, Field
|
|
|
8
8
|
class BroadcastService(BaseModel):
|
|
9
9
|
"""Broadcast Service object"""
|
|
10
10
|
|
|
11
|
-
pk: int = Field(..., description='Service ID')
|
|
11
|
+
pk: int = Field(..., description='Service ID', alias='id')
|
|
12
12
|
name: str = Field(..., description='Service name')
|
|
13
13
|
credentials: dict[str, Any] = Field(default_factory=dict, description='Service credentials')
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Broadcast result Status"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Self
|
|
5
5
|
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
class BroadcastStatus(str, Enum):
|
|
7
|
+
class BroadcastStatus(StrEnum):
|
|
13
8
|
"""Broadcast result status"""
|
|
14
9
|
|
|
15
10
|
OK = 'OK'
|
layrz_sdk/entities/case.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"""Events entities"""
|
|
2
2
|
|
|
3
|
-
import sys
|
|
4
3
|
from datetime import datetime
|
|
5
|
-
from typing import Any, Optional
|
|
4
|
+
from typing import Any, Optional, Self
|
|
6
5
|
|
|
7
6
|
from pydantic import BaseModel, Field, model_validator
|
|
8
7
|
|
|
@@ -11,16 +10,11 @@ from .case_status import CaseStatus
|
|
|
11
10
|
from .comment import Comment
|
|
12
11
|
from .trigger import Trigger
|
|
13
12
|
|
|
14
|
-
if sys.version_info >= (3, 11):
|
|
15
|
-
from typing import Self
|
|
16
|
-
else:
|
|
17
|
-
from typing_extensions import Self
|
|
18
|
-
|
|
19
13
|
|
|
20
14
|
class Case(BaseModel):
|
|
21
15
|
"""Case entity"""
|
|
22
16
|
|
|
23
|
-
pk: int = Field(description='Defines the primary key of the case')
|
|
17
|
+
pk: int = Field(description='Defines the primary key of the case', alias='id')
|
|
24
18
|
trigger: Trigger = Field(description='Defines the trigger of the case')
|
|
25
19
|
asset_id: int = Field(description='Defines the asset ID of the case')
|
|
26
20
|
comments: list[Comment] = Field(default_factory=list, description='Defines the comments of the case')
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
from
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
from typing import Self
|
|
3
3
|
|
|
4
|
-
if sys.version_info >= (3, 11):
|
|
5
|
-
from typing import Self
|
|
6
|
-
else:
|
|
7
|
-
from typing_extensions import Self
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
class CaseIgnoredStatus(str, Enum):
|
|
5
|
+
class CaseIgnoredStatus(StrEnum):
|
|
11
6
|
"""
|
|
12
7
|
Case ignore status, will define what kind ignore happened.
|
|
13
8
|
"""
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
from
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
from typing import Self
|
|
3
3
|
|
|
4
|
-
if sys.version_info >= (3, 11):
|
|
5
|
-
from typing import Self
|
|
6
|
-
else:
|
|
7
|
-
from typing_extensions import Self
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
class CaseStatus(str, Enum):
|
|
5
|
+
class CaseStatus(StrEnum):
|
|
11
6
|
"""Case status enum"""
|
|
12
7
|
|
|
13
8
|
PENDING = 'PENDING'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Bar chart"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from typing import Any
|
|
3
|
+
from typing import Any, Self
|
|
5
4
|
|
|
6
5
|
from pydantic import BaseModel, Field
|
|
7
6
|
|
|
@@ -11,11 +10,6 @@ from .chart_data_serie import ChartDataSerie
|
|
|
11
10
|
from .chart_data_serie_type import ChartDataSerieType
|
|
12
11
|
from .chart_render_technology import ChartRenderTechnology
|
|
13
12
|
|
|
14
|
-
if sys.version_info >= (3, 11):
|
|
15
|
-
from typing import Self
|
|
16
|
-
else:
|
|
17
|
-
from typing_extensions import Self
|
|
18
|
-
|
|
19
13
|
|
|
20
14
|
class BarChart(BaseModel):
|
|
21
15
|
"""Bar chart configuration"""
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Chart alignment"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Self
|
|
5
5
|
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
class ChartAlignment(str, Enum):
|
|
7
|
+
class ChartAlignment(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Chart Alignment
|
|
15
10
|
"""
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Chart alignment"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Self
|
|
5
5
|
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
class ChartColor(str, Enum):
|
|
7
|
+
class ChartColor(StrEnum):
|
|
13
8
|
"""Chart color list, ideal to use to colorize the series"""
|
|
14
9
|
|
|
15
10
|
RED = '#F44336'
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
"""Chart Serie type"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Self
|
|
5
5
|
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
class ChartDataSerieType(Enum):
|
|
7
|
+
class ChartDataSerieType(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Chart data serie type
|
|
15
10
|
"""
|
|
16
11
|
|
|
17
|
-
NONE = None
|
|
12
|
+
NONE = 'None'
|
|
18
13
|
LINE = 'line'
|
|
19
14
|
AREA = 'area'
|
|
20
15
|
SCATTER = 'scatter'
|
|
21
16
|
|
|
22
|
-
def __str__(self) -> str:
|
|
17
|
+
def __str__(self: Self) -> str:
|
|
23
18
|
"""Readable property"""
|
|
24
19
|
return self.name
|
|
25
20
|
|
|
26
|
-
def __repr__(self) -> str:
|
|
21
|
+
def __repr__(self: Self) -> str:
|
|
27
22
|
"""Readable property"""
|
|
28
23
|
return f'ChartDataSerieType.{self.name}'
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Chart Data type"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Self
|
|
5
5
|
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
class ChartDataType(str, Enum):
|
|
7
|
+
class ChartDataType(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Chart Data Type
|
|
15
10
|
"""
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Chart rendering technology / library"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from
|
|
3
|
+
from enum import StrEnum
|
|
4
|
+
from typing import Self
|
|
5
5
|
|
|
6
|
-
if sys.version_info >= (3, 11):
|
|
7
|
-
from typing import Self
|
|
8
|
-
else:
|
|
9
|
-
from typing_extensions import Self
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
class ChartRenderTechnology(str, Enum):
|
|
7
|
+
class ChartRenderTechnology(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Chart Alignment
|
|
15
10
|
"""
|