layrz-sdk 3.1.50__py3-none-any.whl → 4.0.0__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/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_exit_history.py +16 -32
- layrz_sdk/entities/ats_possible_exit.py +15 -18
- layrz_sdk/entities/ats_reception.py +4 -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.0.dist-info}/METADATA +2 -5
- layrz_sdk-4.0.0.dist-info/RECORD +114 -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.0.dist-info}/WHEEL +0 -0
- {layrz_sdk-3.1.50.dist-info → layrz_sdk-4.0.0.dist-info}/licenses/LICENSE +0 -0
- {layrz_sdk-3.1.50.dist-info → layrz_sdk-4.0.0.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Map chart"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from typing import Any, Optional, Tuple
|
|
3
|
+
from typing import Any, Optional, Self, Tuple
|
|
5
4
|
|
|
6
5
|
from pydantic import BaseModel, Field
|
|
7
6
|
|
|
@@ -9,11 +8,6 @@ from .chart_render_technology import ChartRenderTechnology
|
|
|
9
8
|
from .map_center_type import MapCenterType
|
|
10
9
|
from .map_point import MapPoint
|
|
11
10
|
|
|
12
|
-
if sys.version_info >= (3, 11):
|
|
13
|
-
from typing import Self
|
|
14
|
-
else:
|
|
15
|
-
from typing_extensions import Self
|
|
16
|
-
|
|
17
11
|
|
|
18
12
|
class MapChart(BaseModel):
|
|
19
13
|
"""Map chart configuration"""
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
"""Number chart"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from typing import Any, Dict
|
|
3
|
+
from typing import Any, Dict, Self
|
|
5
4
|
|
|
6
5
|
from pydantic import BaseModel, Field
|
|
7
6
|
|
|
8
7
|
from .chart_render_technology import ChartRenderTechnology
|
|
9
8
|
|
|
10
|
-
if sys.version_info >= (3, 11):
|
|
11
|
-
from typing import Self
|
|
12
|
-
else:
|
|
13
|
-
from typing_extensions import Self
|
|
14
|
-
|
|
15
9
|
|
|
16
10
|
class NumberChart(BaseModel):
|
|
17
11
|
"""Number chart configuration"""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Pie 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
|
|
|
@@ -9,11 +8,6 @@ from .chart_alignment import ChartAlignment
|
|
|
9
8
|
from .chart_data_serie import ChartDataSerie
|
|
10
9
|
from .chart_render_technology import ChartRenderTechnology
|
|
11
10
|
|
|
12
|
-
if sys.version_info >= (3, 11):
|
|
13
|
-
from typing import Self
|
|
14
|
-
else:
|
|
15
|
-
from typing_extensions import Self
|
|
16
|
-
|
|
17
11
|
|
|
18
12
|
class PieChart(BaseModel):
|
|
19
13
|
"""Pie chart configuration"""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Radar 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
|
|
|
@@ -9,11 +8,6 @@ from .chart_alignment import ChartAlignment
|
|
|
9
8
|
from .chart_data_serie import ChartDataSerie
|
|
10
9
|
from .chart_data_serie_type import ChartDataSerieType
|
|
11
10
|
|
|
12
|
-
if sys.version_info >= (3, 11):
|
|
13
|
-
from typing import Self
|
|
14
|
-
else:
|
|
15
|
-
from typing_extensions import Self
|
|
16
|
-
|
|
17
11
|
|
|
18
12
|
class RadarChart(BaseModel):
|
|
19
13
|
"""Radar chart configuration"""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Radial 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
|
|
|
@@ -9,11 +8,6 @@ from .chart_alignment import ChartAlignment
|
|
|
9
8
|
from .chart_data_serie import ChartDataSerie
|
|
10
9
|
from .chart_render_technology import ChartRenderTechnology
|
|
11
10
|
|
|
12
|
-
if sys.version_info >= (3, 11):
|
|
13
|
-
from typing import Self
|
|
14
|
-
else:
|
|
15
|
-
from typing_extensions import Self
|
|
16
|
-
|
|
17
11
|
|
|
18
12
|
class RadialBarChart(BaseModel):
|
|
19
13
|
"""Radial Bar chart configuration"""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Scatter 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_type import ChartDataSerieType
|
|
|
11
10
|
from .chart_render_technology import ChartRenderTechnology
|
|
12
11
|
from .scatter_serie import ScatterSerie
|
|
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 ScatterChart(BaseModel):
|
|
21
15
|
"""Scatter chart configuration"""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Number 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
|
|
|
@@ -9,11 +8,6 @@ from .chart_render_technology import ChartRenderTechnology
|
|
|
9
8
|
from .table_header import TableHeader
|
|
10
9
|
from .table_row import TableRow
|
|
11
10
|
|
|
12
|
-
if sys.version_info >= (3, 11):
|
|
13
|
-
from typing import Self
|
|
14
|
-
else:
|
|
15
|
-
from typing_extensions import Self
|
|
16
|
-
|
|
17
11
|
|
|
18
12
|
class TableChart(BaseModel):
|
|
19
13
|
"""Table chart configuration"""
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
"""Timeline chart entities"""
|
|
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
|
|
|
8
7
|
from .chart_alignment import ChartAlignment
|
|
9
8
|
from .timeline_serie import TimelineSerie
|
|
10
9
|
|
|
11
|
-
if sys.version_info >= (3, 11):
|
|
12
|
-
from typing import Self
|
|
13
|
-
else:
|
|
14
|
-
from typing_extensions import Self
|
|
15
|
-
|
|
16
10
|
|
|
17
11
|
class TimelineChart(BaseModel):
|
|
18
12
|
"""Timeline chart configuration"""
|
layrz_sdk/entities/checkpoint.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"""Command Series Ticket entity"""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from enum import StrEnum
|
|
4
5
|
from typing import Any
|
|
5
6
|
|
|
6
7
|
from pydantic import BaseModel, Field
|
|
7
8
|
|
|
8
|
-
from layrz_sdk.backwards import StrEnum
|
|
9
9
|
from layrz_sdk.constants import UTC
|
|
10
10
|
from layrz_sdk.entities.action import Action
|
|
11
11
|
from layrz_sdk.entities.asset import Asset
|
layrz_sdk/entities/comment.py
CHANGED
|
@@ -10,7 +10,7 @@ from .user import User
|
|
|
10
10
|
class Comment(BaseModel):
|
|
11
11
|
"""Comment entity"""
|
|
12
12
|
|
|
13
|
-
pk: int = Field(description='Comment ID')
|
|
13
|
+
pk: int = Field(description='Comment ID', alias='id')
|
|
14
14
|
content: str = Field(description='Comment content')
|
|
15
15
|
user: User = Field(description='Operator/User what commented the case')
|
|
16
16
|
submitted_at: datetime = Field(description='Date of comment submission')
|
layrz_sdk/entities/device.py
CHANGED
|
@@ -8,7 +8,7 @@ from .modbus import ModbusConfig
|
|
|
8
8
|
class Device(BaseModel):
|
|
9
9
|
"""Device entity"""
|
|
10
10
|
|
|
11
|
-
pk: int = Field(description='Defines the primary key of the device')
|
|
11
|
+
pk: int = Field(description='Defines the primary key of the device', alias='id')
|
|
12
12
|
name: str = Field(description='Defines the name of the device')
|
|
13
13
|
ident: str = Field(description='Defines the identifier of the device')
|
|
14
14
|
protocol_id: int | None = Field(
|
layrz_sdk/entities/event.py
CHANGED
|
@@ -13,7 +13,7 @@ from .trigger import Trigger
|
|
|
13
13
|
class Event(BaseModel):
|
|
14
14
|
"""Event entity definition"""
|
|
15
15
|
|
|
16
|
-
pk: int = Field(description='Event ID')
|
|
16
|
+
pk: int = Field(description='Event ID', alias='id')
|
|
17
17
|
trigger: Trigger = Field(description='Event trigger')
|
|
18
18
|
asset_id: int = Field(description='Asset ID')
|
|
19
19
|
message: Message = Field(description='Message')
|
layrz_sdk/entities/function.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Geofence entity"""
|
|
2
2
|
|
|
3
3
|
from datetime import timedelta
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
|
-
from pydantic import BaseModel, Field
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
7
|
|
|
8
8
|
from .asset import Asset
|
|
9
9
|
|
|
@@ -11,19 +11,36 @@ from .asset import Asset
|
|
|
11
11
|
class Function(BaseModel):
|
|
12
12
|
"""Function entity"""
|
|
13
13
|
|
|
14
|
-
pk: int = Field(description='Defines the primary key of the Function')
|
|
14
|
+
pk: int = Field(description='Defines the primary key of the Function', alias='id')
|
|
15
15
|
name: str = Field(description='Name of the function')
|
|
16
16
|
|
|
17
|
-
maximum_time:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
maximum_time: timedelta | None = Field(
|
|
18
|
+
default=None,
|
|
19
|
+
description='Maximum time for the function to run',
|
|
20
|
+
)
|
|
21
|
+
minutes_delta: timedelta | None = Field(
|
|
22
|
+
default=None,
|
|
23
|
+
description='Time delta in minutes for the function to run',
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
external_identifiers: list[str] = Field(
|
|
27
|
+
default_factory=list,
|
|
28
|
+
description='List of external identifiers for the function',
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
credentials: dict[str, Any] = Field(
|
|
32
|
+
default_factory=dict,
|
|
33
|
+
description='Credentials for the function',
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
assets: list[Asset] = Field(
|
|
37
|
+
default_factory=list,
|
|
38
|
+
description='List of assets associated with the function',
|
|
39
|
+
)
|
|
26
40
|
|
|
27
41
|
# Foreign keys – normally expose only the FK id to keep the payload small.
|
|
28
|
-
owner_id:
|
|
29
|
-
|
|
42
|
+
owner_id: int | None = Field(
|
|
43
|
+
default=None,
|
|
44
|
+
description='Owner ID of the function',
|
|
45
|
+
)
|
|
46
|
+
algorithm_id: int = Field(..., description='Algorithm ID of the function')
|
layrz_sdk/entities/geofence.py
CHANGED
|
@@ -6,6 +6,6 @@ from pydantic import BaseModel, Field
|
|
|
6
6
|
class Geofence(BaseModel):
|
|
7
7
|
"""Geofence entity"""
|
|
8
8
|
|
|
9
|
-
pk: int = Field(description='Defines the primary key of the geofence')
|
|
9
|
+
pk: int = Field(description='Defines the primary key of the geofence', alias='id')
|
|
10
10
|
name: str = Field(description='Defines the name of the geofence')
|
|
11
11
|
color: str = Field(description='Defines the color of the geofence')
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Geofence category"""
|
|
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 GeofenceCategory(str, Enum):
|
|
7
|
+
class GeofenceCategory(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Geofence category definition
|
|
15
10
|
"""
|
layrz_sdk/entities/message.py
CHANGED
|
@@ -15,9 +15,27 @@ PayloadType: TypeAlias = dict[str, Any]
|
|
|
15
15
|
class Message(BaseModel):
|
|
16
16
|
"""Message definition"""
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
model_config = {
|
|
19
|
+
'json_encoders': {
|
|
20
|
+
datetime: lambda v: v.timestamp(),
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
pk: int = Field(..., description='Message ID', alias='id')
|
|
25
|
+
asset_id: int = Field(..., description='Asset ID')
|
|
26
|
+
position: Position = Field(
|
|
27
|
+
default_factory=lambda: Position(),
|
|
28
|
+
description='Current position of the device',
|
|
29
|
+
)
|
|
30
|
+
payload: PayloadType = Field(
|
|
31
|
+
default_factory=dict,
|
|
32
|
+
description='Payload data of the device message',
|
|
33
|
+
)
|
|
34
|
+
sensors: PayloadType = Field(
|
|
35
|
+
default_factory=dict,
|
|
36
|
+
description='Sensor data of the device message',
|
|
37
|
+
)
|
|
38
|
+
received_at: datetime = Field(
|
|
39
|
+
default_factory=lambda: datetime.now(UTC),
|
|
40
|
+
description='Timestamp when the message was received',
|
|
41
|
+
)
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Twilio Notification Type Enum"""
|
|
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 TwilioNotificationType(str, Enum):
|
|
7
|
+
class TwilioNotificationType(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Twilio Notification Type Enum definition
|
|
15
10
|
"""
|
layrz_sdk/entities/operation.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Operation entity"""
|
|
2
2
|
|
|
3
3
|
from datetime import time, timedelta
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any, Self
|
|
5
5
|
|
|
6
6
|
from pydantic import BaseModel, Field
|
|
7
7
|
|
|
@@ -36,18 +36,26 @@ class Operation(BaseModel):
|
|
|
36
36
|
description='Defines the cooldown time of the trigger',
|
|
37
37
|
)
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
operation_type: OperationType = Field(
|
|
40
40
|
...,
|
|
41
41
|
description='Defines the kind of the operation',
|
|
42
|
-
alias='operation_type',
|
|
43
42
|
)
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
@property
|
|
45
|
+
def kind(self: Self) -> OperationType:
|
|
46
|
+
"""Get the kind of the operation"""
|
|
47
|
+
return self.operation_type
|
|
48
|
+
|
|
49
|
+
request_type: HttpRequestType | None = Field(
|
|
46
50
|
default=None,
|
|
47
51
|
description='Defines the HTTP method of the operation',
|
|
48
|
-
alias='request_type',
|
|
49
52
|
)
|
|
50
53
|
|
|
54
|
+
@property
|
|
55
|
+
def http_method(self: Self) -> HttpRequestType | None:
|
|
56
|
+
"""Get the HTTP method of the operation"""
|
|
57
|
+
return self.request_type
|
|
58
|
+
|
|
51
59
|
url: str | None = Field(
|
|
52
60
|
default=None,
|
|
53
61
|
description='Defines the URL of the operation',
|
|
@@ -88,18 +96,26 @@ class Operation(BaseModel):
|
|
|
88
96
|
description='Defines the color of the operation',
|
|
89
97
|
)
|
|
90
98
|
|
|
91
|
-
|
|
99
|
+
account_id: int | None = Field(
|
|
92
100
|
default=None,
|
|
93
101
|
description='Defines the external account ID of the operation',
|
|
94
|
-
alias='account_id',
|
|
95
102
|
)
|
|
96
103
|
|
|
97
|
-
|
|
104
|
+
@property
|
|
105
|
+
def external_account_id(self: Self) -> int | None:
|
|
106
|
+
"""Get the external account ID of the operation"""
|
|
107
|
+
return self.account_id
|
|
108
|
+
|
|
109
|
+
notification_type: TwilioNotificationType = Field(
|
|
98
110
|
default=TwilioNotificationType.SMS,
|
|
99
111
|
description='Defines the Twilio notification type of the operation',
|
|
100
|
-
alias='notification_type',
|
|
101
112
|
)
|
|
102
113
|
|
|
114
|
+
@property
|
|
115
|
+
def twilio_notification_type(self: Self) -> TwilioNotificationType:
|
|
116
|
+
"""Get the Twilio notification type of the operation"""
|
|
117
|
+
return self.notification_type
|
|
118
|
+
|
|
103
119
|
host_phone: DestinationPhone | None = Field(
|
|
104
120
|
default=None,
|
|
105
121
|
description='Defines the host phone number for Twilio notifications',
|
|
@@ -18,7 +18,6 @@ class OperationCaseCommentPayload(BaseModel):
|
|
|
18
18
|
created_at: datetime = Field(
|
|
19
19
|
default_factory=lambda: datetime.now(UTC),
|
|
20
20
|
description='Defines the creation date of the operation case comment',
|
|
21
|
-
alias='createdAt',
|
|
22
21
|
)
|
|
23
22
|
|
|
24
23
|
|
|
@@ -37,12 +36,10 @@ class OperationCasePayload(BaseModel):
|
|
|
37
36
|
created_at: datetime = Field(
|
|
38
37
|
default_factory=lambda: datetime.now(UTC),
|
|
39
38
|
description='Defines the creation date of the operation case payload',
|
|
40
|
-
alias='createdAt',
|
|
41
39
|
)
|
|
42
40
|
updated_at: datetime = Field(
|
|
43
41
|
default_factory=lambda: datetime.now(UTC),
|
|
44
42
|
description='Defines the last update date of the operation case payload',
|
|
45
|
-
alias='updatedAt',
|
|
46
43
|
)
|
|
47
44
|
|
|
48
45
|
trigger: Trigger = Field(
|
|
@@ -55,7 +52,7 @@ class OperationCasePayload(BaseModel):
|
|
|
55
52
|
"""Serialize trigger to a dictionary"""
|
|
56
53
|
if isinstance(value, Trigger):
|
|
57
54
|
return Trigger(
|
|
58
|
-
|
|
55
|
+
id=value.pk,
|
|
59
56
|
name=value.name,
|
|
60
57
|
code=value.code,
|
|
61
58
|
)
|
|
@@ -67,17 +64,14 @@ class OperationCasePayload(BaseModel):
|
|
|
67
64
|
file_id: int | None = Field(
|
|
68
65
|
default=None,
|
|
69
66
|
description='Defines the file ID associated with the operation case payload',
|
|
70
|
-
alias='fileId',
|
|
71
67
|
)
|
|
72
68
|
|
|
73
69
|
file_created_at: datetime | None = Field(
|
|
74
70
|
default=None,
|
|
75
71
|
description='Defines the creation date of the file associated with the operation case payload',
|
|
76
|
-
alias='fileCreatedAt',
|
|
77
72
|
)
|
|
78
73
|
|
|
79
74
|
comment: OperationCaseCommentPayload | None = Field(
|
|
80
75
|
default=None,
|
|
81
76
|
description='Defines the comment associated with the operation case payload',
|
|
82
|
-
alias='comment',
|
|
83
77
|
)
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
"""Operation Payload entity"""
|
|
2
2
|
|
|
3
|
-
import sys
|
|
4
3
|
from datetime import datetime, timedelta
|
|
5
|
-
from typing import Any
|
|
6
|
-
|
|
7
|
-
from layrz_sdk.entities.destination_phone import DestinationPhone
|
|
8
|
-
|
|
9
|
-
if sys.version_info >= (3, 11):
|
|
10
|
-
from typing import Self
|
|
11
|
-
else:
|
|
12
|
-
from typing_extensions import Self
|
|
4
|
+
from typing import Any, Self
|
|
13
5
|
|
|
14
6
|
from pydantic import BaseModel, Field, field_validator
|
|
15
7
|
|
|
16
8
|
from layrz_sdk.entities.asset import Asset
|
|
9
|
+
from layrz_sdk.entities.destination_phone import DestinationPhone
|
|
17
10
|
from layrz_sdk.entities.geofence import Geofence
|
|
18
11
|
from layrz_sdk.entities.notification_type import TwilioNotificationType
|
|
19
12
|
from layrz_sdk.entities.operation import Operation
|
|
@@ -59,7 +52,7 @@ class OperationPayload(BaseModel):
|
|
|
59
52
|
"""Serialize asset to a dictionary"""
|
|
60
53
|
if isinstance(value, Asset):
|
|
61
54
|
return Asset(
|
|
62
|
-
|
|
55
|
+
id=value.pk,
|
|
63
56
|
name=value.name,
|
|
64
57
|
operation_mode=value.operation_mode,
|
|
65
58
|
vin=value.vin,
|
|
@@ -80,7 +73,7 @@ class OperationPayload(BaseModel):
|
|
|
80
73
|
"""Serialize trigger to a dictionary"""
|
|
81
74
|
if isinstance(value, Trigger):
|
|
82
75
|
return Trigger(
|
|
83
|
-
|
|
76
|
+
id=value.pk,
|
|
84
77
|
name=value.name,
|
|
85
78
|
code=value.code,
|
|
86
79
|
)
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Operation 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 OperationType(str, Enum):
|
|
7
|
+
class OperationType(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Operation type definition
|
|
15
10
|
"""
|
|
@@ -8,7 +8,7 @@ from pydantic import BaseModel, Field
|
|
|
8
8
|
class OutboundService(BaseModel):
|
|
9
9
|
"""Outbound service definition"""
|
|
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
|
|
|
14
14
|
protocol_name: str | None = Field(
|
layrz_sdk/entities/platform.py
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""Platform"""
|
|
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 Platform(str, Enum):
|
|
7
|
+
class Platform(StrEnum):
|
|
13
8
|
"""
|
|
14
9
|
Platform definition
|
|
15
10
|
"""
|
layrz_sdk/entities/position.py
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
"""Position entity"""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from typing import Any, Optional
|
|
3
|
+
from typing import Any, Self
|
|
5
4
|
|
|
6
5
|
from pydantic import BaseModel, Field, field_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
|
|
|
14
8
|
class Position(BaseModel):
|
|
15
9
|
"""Geographic position definition"""
|
|
16
10
|
|
|
17
|
-
latitude:
|
|
18
|
-
longitude:
|
|
19
|
-
altitude:
|
|
20
|
-
hdop:
|
|
21
|
-
speed:
|
|
22
|
-
direction:
|
|
23
|
-
satellites:
|
|
11
|
+
latitude: float | None = Field(default=None, description='Defines the latitude of the position')
|
|
12
|
+
longitude: float | None = Field(default=None, description='Defines the longitude of the position')
|
|
13
|
+
altitude: float | None = Field(default=None, description='Defines the altitude of the position')
|
|
14
|
+
hdop: float | None = Field(default=None, description='Defines the horizontal dilution of precision')
|
|
15
|
+
speed: float | None = Field(default=None, description='Defines the speed of the position')
|
|
16
|
+
direction: float | None = Field(default=None, description='Defines the direction of the position')
|
|
17
|
+
satellites: int | None = Field(
|
|
24
18
|
default=None,
|
|
25
19
|
description='Defines the number of satellites used to calculate the position',
|
|
26
20
|
)
|
|
@@ -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 PresenceType(str, Enum):
|
|
5
|
+
class PresenceType(StrEnum):
|
|
11
6
|
"""Presence type enum"""
|
|
12
7
|
|
|
13
8
|
ENTRANCE = 'ENTRANCE'
|