feat: made most methods not consume the client itself
This commit is contained in:
parent
cb2295e780
commit
19db7a6731
1 changed files with 6 additions and 3 deletions
|
@ -181,7 +181,7 @@ impl<'a> Client {
|
|||
}
|
||||
|
||||
pub async fn search<'b, T: std::fmt::Debug + for<'de> serde::Deserialize<'de>>(
|
||||
self,
|
||||
&self,
|
||||
options: SearchOptions<'b>,
|
||||
) -> Result<QueryResponse<T>> {
|
||||
let request = self
|
||||
|
@ -212,7 +212,7 @@ pub struct Pages {
|
|||
}
|
||||
|
||||
impl Pages {
|
||||
pub async fn retrieve(self, options: PageOptions<'_>) -> Result<Page> {
|
||||
pub async fn retrieve(&self, options: PageOptions<'_>) -> Result<Page> {
|
||||
let url = format!(
|
||||
"https://api.notion.com/v1/pages/{page_id}",
|
||||
page_id = options.page_id
|
||||
|
@ -253,7 +253,10 @@ pub struct BlockChildrenListOptions<'a> {
|
|||
}
|
||||
|
||||
impl BlockChildren {
|
||||
pub async fn list(self, options: BlockChildrenListOptions<'_>) -> Result<QueryResponse<Block>> {
|
||||
pub async fn list(
|
||||
&self,
|
||||
options: BlockChildrenListOptions<'_>,
|
||||
) -> Result<QueryResponse<Block>> {
|
||||
let url = format!(
|
||||
"https://api.notion.com/v1/blocks/{block_id}/children",
|
||||
block_id = options.block_id
|
||||
|
|
Loading…
Reference in a new issue