notionapi
notionapi copied to clipboard
Common interface for Block, Page, and Database
It would be very helpful to abstract these objects away in a comment interface, as currently in our code we use a lot of switch/case such as
switch obj.Type{
case "block":
return obj.CreatedAt
case "page":
return obj.CreatedAt
}
It would be much nicer to be able to do
obj.GetCreatedAt()
simplifying the client code greatly. It seems Blocks have a common Block
interface, I am wondering if we can create a common interface shared between Blocks, Pages, and Databases to access these common fields?
Hi! Why not, looks easy to implement