Struct notion_wasi::NotionApi
source · pub struct NotionApi { /* private fields */ }
Implementations§
source§impl NotionApi
impl NotionApi
sourcepub async fn list_databases(&self) -> Result<ListResponse<Database>>
pub async fn list_databases(&self) -> Result<ListResponse<Database>>
List all the databases shared with the supplied integration token.
This method is apparently deprecated/“not recommended” and search() should be used instead.
sourcepub async fn search<T: Into<SearchRequest>>(
&self,
query: T
) -> Result<ListResponse<Object>>
pub async fn search<T: Into<SearchRequest>>( &self, query: T ) -> Result<ListResponse<Object>>
Search all pages in notion.
query
can either be a SearchRequest or a slightly more convenient
NotionSearch query.
sourcepub async fn get_database<T: AsIdentifier<DatabaseId>>(
&self,
database_id: T
) -> Result<Database>
pub async fn get_database<T: AsIdentifier<DatabaseId>>( &self, database_id: T ) -> Result<Database>
Get a database by DatabaseId.
sourcepub async fn get_page<T: AsIdentifier<PageId>>(
&self,
page_id: T
) -> Result<Page>
pub async fn get_page<T: AsIdentifier<PageId>>( &self, page_id: T ) -> Result<Page>
Get a page by PageId.
sourcepub async fn create_page<T: Into<PageCreateRequest>>(
&self,
page: T
) -> Result<Page>
pub async fn create_page<T: Into<PageCreateRequest>>( &self, page: T ) -> Result<Page>
Creates a new page and return the created page
sourcepub async fn query_database<D, T>(
&self,
database: D,
query: T
) -> Result<ListResponse<Page>>where
T: Into<DatabaseQuery>,
D: AsIdentifier<DatabaseId>,
pub async fn query_database<D, T>( &self, database: D, query: T ) -> Result<ListResponse<Page>>where T: Into<DatabaseQuery>, D: AsIdentifier<DatabaseId>,
Query a database and return the matching pages.
pub async fn get_block_children<T: AsIdentifier<BlockId>>( &self, block_id: T ) -> Result<ListResponse<Block>>
Auto Trait Implementations§
impl !RefUnwindSafe for NotionApi
impl Send for NotionApi
impl Sync for NotionApi
impl Unpin for NotionApi
impl !UnwindSafe for NotionApi
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more