MilanoteUnofficialApi.elements.link
1from .element import Element 2from .meta import Meta 3from .location import Location 4 5 6class Link(Element): 7 """ 8 A Milanote link. 9 """ 10 11 id: str 12 """ID of the element.""" 13 element_type: str 14 """Type of the element.""" 15 meta: Meta 16 """Metadata of the element.""" 17 location: Location 18 """Location of the element.""" 19 url: str = None 20 """URL of the link.""" 21 title: str = None 22 """Title of the link.""" 23 link_type: str = None 24 """Type of the link.""" 25 26 def __init__(self, data: dict): 27 super().__init__(data) 28 if "link" in data["content"]: 29 self.url = data["content"]["link"]["url"] 30 self.title = data["content"]["link"]["title"] 31 self.link_type = data["content"].get("linkType", None) 32 33 def __repr__(self): 34 return f"Link(id='{self.id}', title='{self.title}', link_type='{self.link_type}')"
7class Link(Element): 8 """ 9 A Milanote link. 10 """ 11 12 id: str 13 """ID of the element.""" 14 element_type: str 15 """Type of the element.""" 16 meta: Meta 17 """Metadata of the element.""" 18 location: Location 19 """Location of the element.""" 20 url: str = None 21 """URL of the link.""" 22 title: str = None 23 """Title of the link.""" 24 link_type: str = None 25 """Type of the link.""" 26 27 def __init__(self, data: dict): 28 super().__init__(data) 29 if "link" in data["content"]: 30 self.url = data["content"]["link"]["url"] 31 self.title = data["content"]["link"]["title"] 32 self.link_type = data["content"].get("linkType", None) 33 34 def __repr__(self): 35 return f"Link(id='{self.id}', title='{self.title}', link_type='{self.link_type}')"
A Milanote link.