-
-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Describe your use-case or problem
The ultimate-notion high level API doesn't have a Page.update
or Session.update_page
or Database.update_page
or Schema.update
method, to allow updating the values of multiple properties of a page at once. When I want to update all properties of a page (which I read from another source, like a CSV or another web API), I need to use the setter for each property for each page I want to update (which uses more API calls and therefore takes longer) or use the obj_api directly, as PagesEndpoint
does have an update
method that accepts a dict of properties.
And even the obj_api create
/update
methods don't take advantage of the fact that the notion-sdk-py
's underlying create
/update
methods accept icon
and cover
as parameters, which allows setting both in the same API call used to create the page or update it.
Proposed solution / feature
-
Include update methods in the high level API that use the obj_api
s
PagesEndpoint.update` method, allowing to update all properties of a page with a single API call. -
Expose
icon
andcover
parameters fromnotion-sdk-py
'sPagesEndpoint
methods to the obj_api 'create' and 'update' methods, and then to the high level API methods that use them.
Additional context or examples
Exposing 'icon' and 'cover' parameters would allow the application to trade this:
page = my_schema.create(**my_properties)
page.icon = icon # separate API call
page.cover = cover # separate API call
for this:
page = my_schema.create(**my_properties, icon=icon, cover=cover)
Also, implementing methods to update all properties of a page at once would allow the application to trade this:
page.props.p0 = my_properties["p0"]
page.props.p1 = my_properties["p1"]
page.props.p2 = my_properties["p2"]
page.props.p3 = my_properties["p3"]
page.props.p4 = my_properties["p4"]
page.props.p5 = my_properties["p5"]
page.props.p6 = my_properties["p6"]
page.props.p7 = my_properties["p7"]
page.props.p8 = my_properties["p8"]
page.props.p9 = my_properties["p9"]
...
page.props.pn = my_properties["pn"]
page.icon = icon
page.cover = cover
for this:
my_schema.update(page, **my_properties, icon=icon, cover=cover)