use crate::api::*;
use crate::{ApiError, ClientConfig, HttpClient, RequestOptions};
use reqwest::Method;
pub struct CatalogClient {
pub http_client: HttpClient,
}
impl CatalogClient {
pub fn new(config: ClientConfig) -> Result<Self, ApiError> {
Ok(Self {
http_client: HttpClient::new(config.clone())?,
})
}
pub async fn get_branches(
&self,
options: Option<RequestOptions>,
) -> Result<BranchesResponse, ApiError> {
self.http_client
.execute_request(Method::GET, "v1/branches", None, None, options)
.await
}
pub async fn get_databases(
&self,
options: Option<RequestOptions>,
) -> Result<DatabasesResponse, ApiError> {
self.http_client
.execute_request(Method::GET, "v1/databases", None, None, options)
.await
}
}