File
file
¶
File and emoji objects for the Notion API.
Emoji(emoji: str)
¶
Emoji object which behaves like str.
obj_ref = objs.EmojiObject.build(emoji)
instance-attribute
¶
__eq__(other: object) -> bool
¶
__hash__()
¶
__repr__() -> str
¶
__str__() -> str
¶
from_code(shortcode: str) -> Emoji
classmethod
¶
Create an Emoji object from a :shortcode:, e.g.
to_code() -> str
¶
Represent the emoji as :shortcode:, e.g.
FileInfo(*, url: str, name: str | None = None)
¶
Information about a web resource e.g. for the files property.
caption: RichText
property
¶
name: str | None
property
¶
obj_ref: objs.FileObject = objs.ExternalFile.build(url=url, name=name)
instance-attribute
¶
url: str
property
¶
__eq__(other: object) -> bool
¶
__hash__()
¶
__repr__() -> str
¶
__str__() -> str
¶
wrap_obj_ref(obj_ref: objs.FileObject) -> FileInfo
classmethod
¶
to_file_or_emoji(obj: FileInfo | Emoji | str) -> FileInfo | Emoji
¶
Convert the object to a FileInfo or Emoji object.
Strings which are an emoji or describing an emoji, e.g. are converted to Emoji objects. Strings which are URLs are converted to FileInfo objects.
wrap_icon(icon_obj: objs.FileObject | objs.EmojiObject | None) -> FileInfo | Emoji | None
¶
Wrap the icon object into the corresponding class.