pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
pub fn new() -> Self
Sourcepub fn secret<T>(self, notion_api_key: T) -> Self
pub fn secret<T>(self, notion_api_key: T) -> Self
This method sets the token used for calling the Notion API.
If you don’t set it, the client will automatically read
and use the environment variable named NOTION_TOKEN
during initialization.
For details on obtaining a Notion token, please refer to the Notion Developer Documentation.
use notionrs::client::Client;
// ...
let client = Client::new().secret("secret_XXXXXXXXXXXXXX");
pub fn list_users(&self) -> ListUsersClient
pub fn get_user(&self) -> GetUserClient
pub fn get_self(&self) -> GetSelfClient
pub fn get_page(&self) -> GetPageClient
pub fn get_page_property_item(&self) -> GetPagePropertyItemClient
pub fn create_page(&self) -> CreatePageClient
pub fn update_page(&self) -> UpdatePageClient
pub fn query_database(&self) -> QueryDatabaseClient
pub fn create_database(&self) -> CreateDatabaseClient
pub fn update_database(&self) -> UpdateDatabaseClient
pub fn retrieve_database(&self) -> RetrieveDatabaseClient
pub fn get_block(&self) -> GetBlockClient
pub fn get_block_children(&self) -> GetBlockChildrenClient
pub fn delete_block(&self) -> DeleteBlockClient
pub fn append_block_children(&self) -> AppendBlockChildrenClient
pub fn update_block(&self) -> UpdateBlockClient
pub fn search(&self) -> SearchClient
pub fn search_database(&self) -> SearchDatabaseClient
pub fn search_page(&self) -> SearchPageClient
pub fn create_comment(&self) -> CreateCommentClient
pub fn retrieve_comments(&self) -> RetrieveCommentsClient
pub fn create_file_upload(&self) -> CreateFileUploadClient
pub fn send_file_upload(&self) -> SendFileUploadClient
pub fn complete_file_upload(&self) -> CompleteFileUploadClient
pub fn retrieve_file_upload(&self) -> RetrieveFileUploadClient
pub fn list_file_uploads(&self) -> ListFileUploadClient
pub async fn paginate<C, T>(client: C) -> Result<Vec<T>, Error>
pub fn paginate_stream<C, T>( client: C, ) -> Pin<Box<dyn Stream<Item = Result<T, Error>> + Send>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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