layrz-sdk 4.0.7__py3-none-any.whl → 4.0.9__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.

@@ -110,13 +110,13 @@ class Operation(BaseModel):
110
110
  description='Defines the color of the operation',
111
111
  )
112
112
 
113
- account_id: int | None = Field(
113
+ account_id: int | str | None = Field(
114
114
  default=None,
115
115
  description='Defines the external account ID of the operation',
116
116
  )
117
117
 
118
118
  @property
119
- def external_account_id(self: Self) -> int | None:
119
+ def external_account_id(self: Self) -> int | str | None:
120
120
  """Get the external account ID of the operation"""
121
121
  return self.account_id
122
122
 
@@ -150,6 +150,17 @@ class Operation(BaseModel):
150
150
  description='Defines the destination phone numbers for Twilio notifications',
151
151
  )
152
152
 
153
+ @field_validator('destination_phones', mode='before')
154
+ def serialize_destination_phones(cls, value: Any) -> list[DestinationPhone]:
155
+ """Serialize destination phones to a list of DestinationPhone"""
156
+ if isinstance(value, list):
157
+ return value
158
+
159
+ if isinstance(value, DestinationPhone):
160
+ return [value]
161
+
162
+ return []
163
+
153
164
  attach_image: bool = Field(
154
165
  default=False,
155
166
  description='Defines if the operation should attach an image',
@@ -151,7 +151,7 @@ class OperationPayload(BaseModel):
151
151
  alias='useAssetContactsInstead',
152
152
  )
153
153
 
154
- account_id: int | None = Field(
154
+ account_id: int | str | None = Field(
155
155
  default=None,
156
156
  description='Defines the external account ID of the operation',
157
157
  alias='accountId',
@@ -204,6 +204,17 @@ class OperationPayload(BaseModel):
204
204
  description='Defines the destination phone numbers for Twilio notifications',
205
205
  )
206
206
 
207
+ @field_validator('destinations', mode='before')
208
+ def serialize_destinations(cls, value: Any) -> list[DestinationPhone]:
209
+ """Serialize destinations to a list of DestinationPhone"""
210
+ if isinstance(value, list):
211
+ return value
212
+
213
+ if isinstance(value, DestinationPhone):
214
+ return [value]
215
+
216
+ return []
217
+
207
218
  twilio_host_phone: DestinationPhone | None = Field(
208
219
  default=None,
209
220
  description='Defines the host phone number for Twilio notifications',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: layrz-sdk
3
- Version: 4.0.7
3
+ Version: 4.0.9
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>
@@ -33,9 +33,9 @@ layrz_sdk/entities/geofence_category.py,sha256=h9elE_NqDXeOPGGjtwI2AQacl2ijCJP05
33
33
  layrz_sdk/entities/last_message.py,sha256=QNgF0xCQ6uLFDMmKQCjSRhGS1Bq7akw5pv6ZIiFlwfY,268
34
34
  layrz_sdk/entities/message.py,sha256=uCfnrDcgZfnfcnRaE2djJcLJK75frIeF3aUhXPj7zco,997
35
35
  layrz_sdk/entities/notification_type.py,sha256=WTAFt8cOczXHsIk4RIDbakbtW_JqlvAg7PdW8EVqDew,669
36
- layrz_sdk/entities/operation.py,sha256=Qw6DHfuziSwMm0Mj2xsvPl78cCMD3svkSagKf3xrfoY,6208
36
+ layrz_sdk/entities/operation.py,sha256=n2WM2hnvzFznXY5HZWRWQwCymQl9DCHrjUrDepDtf7k,6557
37
37
  layrz_sdk/entities/operation_case_payload.py,sha256=NSsZbtP_Iz1At7ok4xlVFzk40Vx_-7wBYMgYNV5Ftu8,2520
38
- layrz_sdk/entities/operation_payload.py,sha256=JXOg3aY0lGYXFfmHSqwwYOGOkZhTsaNTwikV39GdI6g,8579
38
+ layrz_sdk/entities/operation_payload.py,sha256=2tDWeDuV76KqlzrPI9hPjKGs60Rd9WDQZVCa0DEqlFg,8904
39
39
  layrz_sdk/entities/operation_type.py,sha256=NAe_suR3Zfazu5KsYsPya8AtkSaNNjh78XPBEIqMTQU,939
40
40
  layrz_sdk/entities/outbound_service.py,sha256=mDtMwTql8sHmFayP1AnGdMgegF6tsvu-xSC2ftGVNJo,663
41
41
  layrz_sdk/entities/platform.py,sha256=fJQXFwRhG_L9h2h7lm_KYqpssJgYtRbfTWPy7BqOnOE,626
@@ -109,8 +109,8 @@ layrz_sdk/helpers/__init__.py,sha256=5iW3z2m3jrYhvTfxX-p-QTkR9X9oTKfEsbtVOg9jFFY
109
109
  layrz_sdk/helpers/color.py,sha256=dlpMafbM-4Wd9D9hMbbnZJf4ALkpie_ZmBR2Vz_YCmM,1203
110
110
  layrz_sdk/lcl/__init__.py,sha256=U967AWANkL3u_YVxMNAYlh8jkZ6hqHfStacz7yz6sOA,89
111
111
  layrz_sdk/lcl/core.py,sha256=T80A3hL7SeqRNSfl5SrPAgwIEf-enoAVv9ldwJNzqsA,24786
112
- layrz_sdk-4.0.7.dist-info/licenses/LICENSE,sha256=d5ZrU--lIPER7QByXDKcrtOTOMk1JvN_9FdYDuoWi7Y,1057
113
- layrz_sdk-4.0.7.dist-info/METADATA,sha256=yyRQdeDQe9M7pwWFjQKc0BA5VgGpaHkzG6YN8Nm5-Q0,1955
114
- layrz_sdk-4.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
115
- layrz_sdk-4.0.7.dist-info/top_level.txt,sha256=yUTMMzfdZ0HDWQH5TaSlFM4xtwmP1fSGxmlL1dmu4l4,10
116
- layrz_sdk-4.0.7.dist-info/RECORD,,
112
+ layrz_sdk-4.0.9.dist-info/licenses/LICENSE,sha256=d5ZrU--lIPER7QByXDKcrtOTOMk1JvN_9FdYDuoWi7Y,1057
113
+ layrz_sdk-4.0.9.dist-info/METADATA,sha256=4zf4wambgltpUbqVR5qu9yjTcl3Mm7NUrJAZHnOaPYU,1955
114
+ layrz_sdk-4.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
115
+ layrz_sdk-4.0.9.dist-info/top_level.txt,sha256=yUTMMzfdZ0HDWQH5TaSlFM4xtwmP1fSGxmlL1dmu4l4,10
116
+ layrz_sdk-4.0.9.dist-info/RECORD,,