<aside> 👉 Links (Property base class)
Notion Ruby Mapping Public API Reference
</aside>
<aside> 💡
[P] means methods for Page Property, [DB/DS] means methods for Database or DataSource Property.
</aside>
UniqueIdProperty handles the Notion unique_id property. Page values are read-only. The auto-incremented number is assigned by Notion. Database / DataSource schema can set prefix.
unique_id of Page property returns the unique ID Hash, including prefix and number.
unique_id of Database or DataSource property returns the schema Hash. When prefix is not set, it is an empty Hash {} or a Hash whose prefix is nil.
Page unique ID values cannot be updated. Page#save does not send this property unless will_update is true, and UniqueIdProperty has no Page setter that sets will_update.
page.properties["ID"].unique_id
# => {"prefix"=>"ST", "number"=>3}
ds.properties["ID"].unique_id
# => {}
prefix reads @json["prefix"].
Page property returns the prefix of the unique ID, or nil when it is not set.
Database / DataSource property returns the schema prefix, or nil when it is not set.
page.properties["ID"].prefix
# => "ST"
ds.properties["ID"].prefix
# => nil
number reads @json["number"].
Page property returns the auto-incremented number assigned by Notion.
Database / DataSource schema has no number, so this usually returns nil.
number cannot be set. Notion assigns it automatically.
page.properties["ID"].number
# => 3
ds.properties["ID"].number
# => nil
String), or nilprefix= of Database / DataSource property sets the schema prefix and sets will_update to true.