This is a larger PR because it wasn't originally meant to be a single PR. I was trying to use your library for something and I couldn't figure out how to modify things so I forked it and ended up making multiple changes.
Together thought they effectively add an API for modifying pages and blocks which as far as I could tell originally wansn't possible. So they might make sense as a signgle PR.
Let me know what you think. If you like all of it I am happy to do some changes, add tests,... whatever else. But if you think only some subsets of this PR should be considered please let me know and I am happy to break it up into separate PRs.
Individual things done:
Add update_page to update contents of an existing page
Add get_block get block by block id (which can be a page id as pages are also blocks as far as contents are concerned?)
Add get_block_children_with_cursor which lets you iterate over children of a block. I wans't sure how to use the existing cursor to iterate without this
Add append_block_children which allows user to attach more block under a block or a page
Add delete_block which is pretty self explanatory
Add update_block which is useful for doing things like changing text content or status of a checkbox but can't do things like change block types
Implement Pageable for SearchRequest because I couldn't figure out how to page over results of a serach for pages
Lastly I also changed some API types by adding skip_serializing_if on None, Default, or Clone. This was all just to make working with them easier and because I think we were generating json that notion wasn't happy in some cases.
Hey!
This is a larger PR because it wasn't originally meant to be a single PR. I was trying to use your library for something and I couldn't figure out how to modify things so I forked it and ended up making multiple changes.
Together thought they effectively add an API for modifying pages and blocks which as far as I could tell originally wansn't possible. So they might make sense as a signgle PR.
Let me know what you think. If you like all of it I am happy to do some changes, add tests,... whatever else. But if you think only some subsets of this PR should be considered please let me know and I am happy to break it up into separate PRs.
Individual things done:
update_page
to update contents of an existing pageget_block
get block by block id (which can be a page id as pages are also blocks as far as contents are concerned?)get_block_children_with_cursor
which lets you iterate over children of a block. I wans't sure how to use the existing cursor to iterate without thisappend_block_children
which allows user to attach more block under a block or a pagedelete_block
which is pretty self explanatoryupdate_block
which is useful for doing things like changing text content or status of a checkbox but can't do things like change block typesImplement
Pageable
forSearchRequest
because I couldn't figure out how to page over results of a serach for pagesLastly I also changed some API types by adding
skip_serializing_if
on None, Default, or Clone. This was all just to make working with them easier and because I think we were generating json that notion wasn't happy in some cases.Thanks!