use anyhow::Result;
use crate::Client;
pub struct NotaryJournals {
pub client: Client,
}
impl NotaryJournals {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
NotaryJournals { client }
}
pub async fn get(
&self,
count: &str,
search_text: &str,
start_position: &str,
) -> Result<crate::types::NotaryJournalList> {
let mut query_args: Vec<(String, String)> = Default::default();
if !count.is_empty() {
query_args.push(("count".to_string(), count.to_string()));
}
if !search_text.is_empty() {
query_args.push(("search_text".to_string(), search_text.to_string()));
}
if !start_position.is_empty() {
query_args.push(("start_position".to_string(), start_position.to_string()));
}
let query_ = serde_urlencoded::to_string(&query_args).unwrap();
let url = format!("/v2.1/current_user/notary/journals?{}", query_);
self.client.get(&url, None).await
}
}