Struct notion::NotionApi [−][src]
pub struct NotionApi { /* fields omitted */ }
Expand description
An API client for Notion. Create a client by using new(api_token: String).
Implementations
Creates an instance of NotionApi. May fail if the provided api_token is an improper value.
List all the databases shared with the supplied integration token.
This method is apparently deprecated/“not recommended” and search() should be used instead.
pub async fn search<T: Into<SearchRequest>>(
&self,
query: T
) -> Result<ListResponse<Object>, Error>
pub async fn search<T: Into<SearchRequest>>(
&self,
query: T
) -> Result<ListResponse<Object>, Error>
Search all pages in notion. Query: can either be a SearchRequest or a NotionSearch query.
pub async fn get_database<T: AsIdentifier<DatabaseId>>(
&self,
database_id: T
) -> Result<Database, Error>
pub async fn get_database<T: AsIdentifier<DatabaseId>>(
&self,
database_id: T
) -> Result<Database, Error>
Get a database by DatabaseId.
pub async fn query_database<D, T>(
&self,
database: D,
query: T
) -> Result<ListResponse<Page>, Error> where
T: Into<DatabaseQuery>,
D: AsIdentifier<DatabaseId>,
pub async fn query_database<D, T>(
&self,
database: D,
query: T
) -> Result<ListResponse<Page>, Error> 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>, Error>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for NotionApi
impl !UnwindSafe for NotionApi
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more