layrz-sdk 4.0.21__py3-none-any.whl → 4.0.23__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.
- layrz_sdk/entities/case.py +11 -0
- layrz_sdk/entities/case_ignored_status.py +1 -0
- layrz_sdk/entities/comment.py +7 -1
- layrz_sdk/entities/trigger.py +59 -12
- {layrz_sdk-4.0.21.dist-info → layrz_sdk-4.0.23.dist-info}/METADATA +1 -1
- {layrz_sdk-4.0.21.dist-info → layrz_sdk-4.0.23.dist-info}/RECORD +9 -9
- {layrz_sdk-4.0.21.dist-info → layrz_sdk-4.0.23.dist-info}/WHEEL +0 -0
- {layrz_sdk-4.0.21.dist-info → layrz_sdk-4.0.23.dist-info}/licenses/LICENSE +0 -0
- {layrz_sdk-4.0.21.dist-info → layrz_sdk-4.0.23.dist-info}/top_level.txt +0 -0
layrz_sdk/entities/case.py
CHANGED
|
@@ -30,6 +30,11 @@ class Case(BaseModel):
|
|
|
30
30
|
description='Defines the sequence of the case. This is a unique identifier for the case',
|
|
31
31
|
)
|
|
32
32
|
|
|
33
|
+
stack_count: int = Field(
|
|
34
|
+
default=1,
|
|
35
|
+
description='Defines how many cases are stacked together. Only applicable if the trigger allows stacking',
|
|
36
|
+
)
|
|
37
|
+
|
|
33
38
|
@model_validator(mode='before')
|
|
34
39
|
def _validate_model(cls: Self, data: dict[str, Any]) -> dict[str, Any]:
|
|
35
40
|
"""Validate model"""
|
|
@@ -48,4 +53,10 @@ class Case(BaseModel):
|
|
|
48
53
|
else:
|
|
49
54
|
data['sequence'] = f'GENERIC/{data["pk"]}'
|
|
50
55
|
|
|
56
|
+
if stack_count := data.get('stack_count'):
|
|
57
|
+
if not isinstance(stack_count, int) or stack_count < 1:
|
|
58
|
+
data['stack_count'] = 1
|
|
59
|
+
else:
|
|
60
|
+
data['stack_count'] = 1
|
|
61
|
+
|
|
51
62
|
return data
|
layrz_sdk/entities/comment.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Comment entity"""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from typing import Any
|
|
4
5
|
|
|
5
6
|
from pydantic import BaseModel, Field
|
|
6
7
|
|
|
@@ -12,5 +13,10 @@ class Comment(BaseModel):
|
|
|
12
13
|
|
|
13
14
|
pk: int = Field(description='Comment ID', alias='id')
|
|
14
15
|
content: str = Field(description='Comment content')
|
|
15
|
-
user: User = Field(description='Operator/User what commented the case')
|
|
16
|
+
user: User | None = Field(description='Operator/User what commented the case. None if system generated')
|
|
16
17
|
submitted_at: datetime = Field(description='Date of comment submission')
|
|
18
|
+
|
|
19
|
+
metadata: dict[str, Any] = Field(
|
|
20
|
+
default_factory=dict,
|
|
21
|
+
description='Additional metadata associated with the comment',
|
|
22
|
+
)
|
layrz_sdk/entities/trigger.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from datetime import time, timedelta
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
|
-
from pydantic import BaseModel, Field, field_validator
|
|
6
|
+
from pydantic import BaseModel, Field, field_serializer, field_validator
|
|
7
7
|
|
|
8
8
|
from .trigger_kind import TriggerCaseKind, TriggerCommentPattern, TriggerGeofenceKind, TriggerKind
|
|
9
9
|
from .weekday import Weekday
|
|
@@ -12,17 +12,6 @@ from .weekday import Weekday
|
|
|
12
12
|
class Trigger(BaseModel):
|
|
13
13
|
"""Trigger entity"""
|
|
14
14
|
|
|
15
|
-
model_config = {
|
|
16
|
-
'json_encoders': {
|
|
17
|
-
timedelta: lambda v: v.total_seconds(),
|
|
18
|
-
TriggerCaseKind: lambda v: v.value,
|
|
19
|
-
TriggerGeofenceKind: lambda v: v.value,
|
|
20
|
-
TriggerKind: lambda v: v.value,
|
|
21
|
-
TriggerCommentPattern: lambda v: v.value,
|
|
22
|
-
Weekday: lambda v: v.value,
|
|
23
|
-
},
|
|
24
|
-
}
|
|
25
|
-
|
|
26
15
|
pk: int = Field(description='Defines the primary key of the trigger', alias='id')
|
|
27
16
|
name: str = Field(description='Defines the name of the trigger')
|
|
28
17
|
code: str = Field(description='Defines the code of the trigger')
|
|
@@ -32,27 +21,52 @@ class Trigger(BaseModel):
|
|
|
32
21
|
description='Defines the cooldown time of the trigger',
|
|
33
22
|
)
|
|
34
23
|
|
|
24
|
+
@field_serializer('cooldown_time', when_used='always')
|
|
25
|
+
def serialize_cooldown_time(self, value: timedelta) -> float:
|
|
26
|
+
"""Serialize cooldown_time to total seconds."""
|
|
27
|
+
return value.total_seconds()
|
|
28
|
+
|
|
35
29
|
type_: TriggerKind | None = Field(
|
|
36
30
|
default=None,
|
|
37
31
|
description='Defines the kind of the trigger',
|
|
38
32
|
alias='type',
|
|
39
33
|
)
|
|
40
34
|
|
|
35
|
+
@field_serializer('type_', when_used='always')
|
|
36
|
+
def serialize_type(self, value: TriggerKind | None) -> str | None:
|
|
37
|
+
"""Serialize type_ to its value."""
|
|
38
|
+
return value.value if value else None
|
|
39
|
+
|
|
41
40
|
presence_type: TriggerGeofenceKind | None = Field(
|
|
42
41
|
default=None,
|
|
43
42
|
description='Defines the geofence kind of the trigger',
|
|
44
43
|
)
|
|
45
44
|
|
|
45
|
+
@field_serializer('presence_type', when_used='always')
|
|
46
|
+
def serialize_presence_type(self, value: TriggerGeofenceKind | None) -> str | None:
|
|
47
|
+
"""Serialize presence_type to its value."""
|
|
48
|
+
return value.value if value else None
|
|
49
|
+
|
|
46
50
|
case_type: TriggerCaseKind | None = Field(
|
|
47
51
|
default=None,
|
|
48
52
|
description='Defines the case kind of the trigger',
|
|
49
53
|
)
|
|
50
54
|
|
|
55
|
+
@field_serializer('case_type', when_used='always')
|
|
56
|
+
def serialize_case_type(self, value: TriggerCaseKind | None) -> str | None:
|
|
57
|
+
"""Serialize case_type to its value."""
|
|
58
|
+
return value.value if value else None
|
|
59
|
+
|
|
51
60
|
case_comment_pattern: TriggerCommentPattern | None = Field(
|
|
52
61
|
default=None,
|
|
53
62
|
description='Defines the comment pattern of the trigger',
|
|
54
63
|
)
|
|
55
64
|
|
|
65
|
+
@field_serializer('case_comment_pattern', when_used='always')
|
|
66
|
+
def serialize_case_comment_pattern(self, value: TriggerCommentPattern | None) -> str | None:
|
|
67
|
+
"""Serialize case_comment_pattern to its value."""
|
|
68
|
+
return value.value if value else None
|
|
69
|
+
|
|
56
70
|
case_comment_value: str | None = Field(
|
|
57
71
|
default=None,
|
|
58
72
|
description='Defines the comment pattern value of the trigger',
|
|
@@ -72,6 +86,11 @@ class Trigger(BaseModel):
|
|
|
72
86
|
description='Defines the weekdays of the trigger',
|
|
73
87
|
)
|
|
74
88
|
|
|
89
|
+
@field_serializer('weekdays', when_used='always')
|
|
90
|
+
def serialize_weekdays(self, value: list[Weekday]) -> list[str]:
|
|
91
|
+
"""Serialize weekdays to their values."""
|
|
92
|
+
return [day.value for day in value]
|
|
93
|
+
|
|
75
94
|
is_plain_crontab: bool = Field(
|
|
76
95
|
default=False,
|
|
77
96
|
description='Defines if the trigger is a plain crontab',
|
|
@@ -145,6 +164,29 @@ class Trigger(BaseModel):
|
|
|
145
164
|
default=None,
|
|
146
165
|
description='Defines the care protocol ID of the trigger',
|
|
147
166
|
)
|
|
167
|
+
has_case_expirity: bool = Field(
|
|
168
|
+
default=False,
|
|
169
|
+
description='Defines if the trigger has case expiry',
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
when_case_expires_delta: timedelta | None = Field(
|
|
173
|
+
default=None,
|
|
174
|
+
description='Defines when the trigger expires delta',
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
@field_serializer('when_case_expires_delta', when_used='always')
|
|
178
|
+
def serialize_when_case_expires_delta(self, value: timedelta | None) -> float | None:
|
|
179
|
+
"""Serialize when_case_expires_delta to total seconds."""
|
|
180
|
+
return value.total_seconds() if value else None
|
|
181
|
+
|
|
182
|
+
should_stack: bool = Field(
|
|
183
|
+
default=False,
|
|
184
|
+
description='Defines if the trigger cases should stack',
|
|
185
|
+
)
|
|
186
|
+
stack_upper_limit: int | None = Field(
|
|
187
|
+
default=None,
|
|
188
|
+
description='Defines the stack upper limit of the trigger cases. None means no limit',
|
|
189
|
+
)
|
|
148
190
|
|
|
149
191
|
owner_id: int | None = Field(
|
|
150
192
|
default=None,
|
|
@@ -155,3 +197,8 @@ class Trigger(BaseModel):
|
|
|
155
197
|
default=None,
|
|
156
198
|
description='Defines the search time delta of the trigger',
|
|
157
199
|
)
|
|
200
|
+
|
|
201
|
+
@field_serializer('search_time_delta', when_used='always')
|
|
202
|
+
def serialize_search_time_delta(self, value: timedelta | None) -> float | None:
|
|
203
|
+
"""Serialize search_time_delta to total seconds."""
|
|
204
|
+
return value.total_seconds() if value else None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: layrz-sdk
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.23
|
|
4
4
|
Summary: Layrz SDK for Python
|
|
5
5
|
Author-email: "Golden M, Inc." <software@goldenm.com>
|
|
6
6
|
Maintainer-email: Kenny Mochizuki <kenny@goldenm.com>, Luis Reyes <lreyes@goldenm.com>, Kasen Li <kli@goldenm.com>, Miguel Zauzich <miguel@goldenm.com>, Angel Prieto <aprieto@goldenm.com>
|
|
@@ -19,12 +19,12 @@ layrz_sdk/entities/ats_possible_entry.py,sha256=Z6gcGyzX0XTYoTQvFDeN2ggkyjBDiX-3
|
|
|
19
19
|
layrz_sdk/entities/ats_possible_exit.py,sha256=gCibHlXicrs7dsACVWIBZ-I7RqEbdbKJQllxkjHNHoY,1822
|
|
20
20
|
layrz_sdk/entities/ats_purchaseorder.py,sha256=4zT59cIbJ45706jRnyASQP6J-q8PWaZ0vJB0J-ibEeE,2615
|
|
21
21
|
layrz_sdk/entities/ats_reception.py,sha256=1zzeUvUqSCYP1cBlBNWNgOrdBQ-5SUky2tuA5_EYiKI,958
|
|
22
|
-
layrz_sdk/entities/case.py,sha256=
|
|
23
|
-
layrz_sdk/entities/case_ignored_status.py,sha256=
|
|
22
|
+
layrz_sdk/entities/case.py,sha256=FHY7k-53jYuv3-EMz6xGoJynqpWYtFgUOQggQ96LntA,2317
|
|
23
|
+
layrz_sdk/entities/case_ignored_status.py,sha256=RWu3pK_BN5Hu35wCg03nnY7xqznACY_m7v8bXbJbZxE,451
|
|
24
24
|
layrz_sdk/entities/case_status.py,sha256=XdlgfOm1OZmHVvlarJuf7CDPPlV80-2koXSSzcdWnt4,355
|
|
25
25
|
layrz_sdk/entities/checkpoint.py,sha256=RYS-_FnlFoMEtbIWlFX-u5ecwQZsQEyZyaOCer770XY,1401
|
|
26
26
|
layrz_sdk/entities/command_series_ticket.py,sha256=m0E20u_b9kJeOAIKu7IIGLmkErPCkigzc4qDSn8WZE4,2225
|
|
27
|
-
layrz_sdk/entities/comment.py,sha256=
|
|
27
|
+
layrz_sdk/entities/comment.py,sha256=_mQSlqXLLo-I8kXm6yJRPouJl8J-87ZY-dNFlSvIjyE,616
|
|
28
28
|
layrz_sdk/entities/custom_field.py,sha256=ToaQPHP8dmY8MkFLkgxnAyDoyBByExifCu_mpH78Xwc,474
|
|
29
29
|
layrz_sdk/entities/custom_report_page.py,sha256=eqtoFOgip0z4_cMql1tHgaR4JiVEYlfbzd9ZJ7ZLyrM,1231
|
|
30
30
|
layrz_sdk/entities/destination_phone.py,sha256=IFQFtM_wQjlTdsBc-lXnbcJSwNv-yhL1PzTCexw4nNk,556
|
|
@@ -61,7 +61,7 @@ layrz_sdk/entities/sound_effect.py,sha256=4dy9BOUzzYAByr-ROwONJSFBXsFyrYsgBIAU1g
|
|
|
61
61
|
layrz_sdk/entities/static_position.py,sha256=xTbTWRPQLZqTgPQnyIMOoMHiNi42AzmVRfgDMM4m03c,365
|
|
62
62
|
layrz_sdk/entities/text_alignment.py,sha256=YX2iz6Tm5Qn2iFFD86mju-wFR3bia_auRJCK_MA6TuU,408
|
|
63
63
|
layrz_sdk/entities/timezone.py,sha256=VhS3o9miktQmThz22KJfatjvqzSONHy73_eBUtjI8iA,375
|
|
64
|
-
layrz_sdk/entities/trigger.py,sha256=
|
|
64
|
+
layrz_sdk/entities/trigger.py,sha256=lOsM8f5HCreE-8LYQuCjJYcB_i59j_N29O_PwZNcnhI,6433
|
|
65
65
|
layrz_sdk/entities/trigger_kind.py,sha256=qbAhoS56X8-xh7cMxWhC7IJfocLaXmO53Yt-6f56lXw,1718
|
|
66
66
|
layrz_sdk/entities/user.py,sha256=-j15Q3nDqd1eYEtkId_Cj5bjIRJAapt6et_ny8fW6xw,248
|
|
67
67
|
layrz_sdk/entities/waypoint.py,sha256=ZZMIZet5y_cspEQp8ToIkrM0f1ljnkXgnReMB09DDvU,1736
|
|
@@ -114,8 +114,8 @@ layrz_sdk/helpers/__init__.py,sha256=5iW3z2m3jrYhvTfxX-p-QTkR9X9oTKfEsbtVOg9jFFY
|
|
|
114
114
|
layrz_sdk/helpers/color.py,sha256=dlpMafbM-4Wd9D9hMbbnZJf4ALkpie_ZmBR2Vz_YCmM,1203
|
|
115
115
|
layrz_sdk/lcl/__init__.py,sha256=U967AWANkL3u_YVxMNAYlh8jkZ6hqHfStacz7yz6sOA,89
|
|
116
116
|
layrz_sdk/lcl/core.py,sha256=_3uK05I0iwJl63cVWKxt-qFkq0DWggCj5M680GHH5uQ,25161
|
|
117
|
-
layrz_sdk-4.0.
|
|
118
|
-
layrz_sdk-4.0.
|
|
119
|
-
layrz_sdk-4.0.
|
|
120
|
-
layrz_sdk-4.0.
|
|
121
|
-
layrz_sdk-4.0.
|
|
117
|
+
layrz_sdk-4.0.23.dist-info/licenses/LICENSE,sha256=d5ZrU--lIPER7QByXDKcrtOTOMk1JvN_9FdYDuoWi7Y,1057
|
|
118
|
+
layrz_sdk-4.0.23.dist-info/METADATA,sha256=QVNMndqUFiXnD34_4OsLA2-cS-uu6XDiU209D7casR8,2045
|
|
119
|
+
layrz_sdk-4.0.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
120
|
+
layrz_sdk-4.0.23.dist-info/top_level.txt,sha256=yUTMMzfdZ0HDWQH5TaSlFM4xtwmP1fSGxmlL1dmu4l4,10
|
|
121
|
+
layrz_sdk-4.0.23.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|