Notion Ruby Mapping Public API Reference
<aside> 💡
[P] means methods for Page Property, [DB/DS] means methods for Database or DataSource Property, and [DS] means methods for DataSource Property only.
</aside>
Property is the abstract base class of all property classes such as TitleProperty and CheckboxProperty. It keeps the property name, the raw JSON body, the update flag, and the base type (Page, Database, or DataSource), and provides the API shared by all property classes.
Property is not instantiated directly. Property objects are obtained from Page#properties, Database#properties, DataSource#properties, or Property.create_from_json.
String, Symbol)Hash)"page", "database", or "data_source" (String, default "page")nilnilcreate_from_json creates the property object that matches the type of the given JSON."type" => "property_item"), the results are expanded through List before the property object is created. people, relation, rich_text, rollup, and title are supported in this form."has_more" => true, the property item list is retrieved again so that all relations are included.Property.create_from_json "np", nil
# => ...:in `create_from_json': Property not found: np: (StandardError)
Property.create_from_json "np", {"id" => "SQeZ"}
# => ...:in `create_from_json': Property value is not returned: np (StandardError)
Property.create_from_json "np", {"id" => "SQeZ", "type" => "brand_new", "brand_new" => {}}
# => ...:in `create_from_json': Unsupported property type: brand_new (np). Please update notion_ruby_mapping. (StandardError)
Property not found : input_json is nil.Property value is not returned : the JSON has no type key. Notion API returned this form between 2022-06-28 and 2022-08-31, and it is not expected now.Unsupported property type : NotionRubyMapping does not support this property type yet. Update notion_ruby_mapping to the latest version.