Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit 75fa4c0

Browse files
committed
objects: add support for parsing InMail objects
1 parent dcae5e9 commit 75fa4c0

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v0.1.5
2+
3+
* Add support for parsing InMail messages
4+
15
# v0.1.4
26

37
* Add `py.typed` file to indicate that the library has type hints.

linkedin_messaging/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from .api_objects import URN
33

44
__title__ = "linkedin_messaging"
5-
__version__ = "0.1.4"
5+
__version__ = "0.1.5"
66
__description__ = "An unofficial API for interacting with LinkedIn Messaging"
77

88
__license__ = "MIT"

linkedin_messaging/api_objects.py

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,42 @@ class ThirdPartyMedia:
200200
title: str
201201

202202

203+
@dataclass_json(letter_case=LetterCase.CAMEL)
204+
@dataclass
205+
class LegalText:
206+
static_legal_text: str
207+
custom_legal_text: str
208+
209+
210+
@dataclass_json(letter_case=LetterCase.CAMEL)
211+
@dataclass
212+
class SpInmailStandardSubContent:
213+
action: str
214+
action_text: str
215+
216+
217+
@dataclass_json(letter_case=LetterCase.CAMEL)
218+
@dataclass
219+
class SpInmailSubContent:
220+
third_party_media: Optional[SpInmailStandardSubContent] = field(
221+
metadata=config(
222+
field_name="com.linkedin.voyager.messaging.event.message.spinmail.SpInmailStandardSubContent" # noqa: E501
223+
),
224+
default=None,
225+
)
226+
227+
228+
@dataclass_json(letter_case=LetterCase.CAMEL)
229+
@dataclass
230+
class SpInmailContent:
231+
status: str
232+
sp_inmail_type: str
233+
advertiser_label: str
234+
body: str
235+
legal_text: Optional[LegalText] = None
236+
sub_content: Optional[SpInmailSubContent] = None
237+
238+
203239
@dataclass_json(letter_case=LetterCase.CAMEL)
204240
@dataclass
205241
class MessageCustomContent:
@@ -209,14 +245,21 @@ class MessageCustomContent:
209245
),
210246
default=None,
211247
)
248+
sp_inmail_content: Optional[SpInmailContent] = field(
249+
metadata=config(
250+
field_name="com.linkedin.voyager.messaging.event.message.spinmail.SpInmailContent" # noqa: E501
251+
),
252+
default=None,
253+
)
212254

213255

214256
@dataclass_json(letter_case=LetterCase.CAMEL)
215257
@dataclass
216258
class MessageEvent:
217-
attributed_body: AttributedBody
218259
body: str
219260
message_body_render_format: str
261+
subject: Optional[str] = None
262+
attributed_body: Optional[AttributedBody] = None
220263
attachments: List[MessageAttachment] = field(default_factory=list)
221264
custom_content: Optional[MessageCustomContent] = None
222265

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "linkedin_messaging"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
description = "An unofficial API for interacting with LinkedIn Messaging"
55
authors = ["Sumner Evans <[email protected]>"]
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)