Skip to main content

highlevel_api/apis/blogs/
client.rs

1use super::types::*;
2use crate::{error::Result, http::HttpClient};
3use std::sync::Arc;
4
5pub struct BlogsApi {
6    http: Arc<HttpClient>,
7}
8
9impl BlogsApi {
10    pub fn new(http: Arc<HttpClient>) -> Self {
11        Self { http }
12    }
13
14    pub async fn get_posts(&self, params: &GetBlogPostsParams) -> Result<GetBlogPostsResponse> {
15        self.http.get_with_query("/blogs/posts", params).await
16    }
17
18    pub async fn get_sites(&self, params: &GetBlogSitesParams) -> Result<GetBlogSitesResponse> {
19        self.http.get_with_query("/blogs/site", params).await
20    }
21}