Add methods for modfifing pages and blocks #59
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 typesPageable
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!