use async_trait::async_trait;
use serde_json::Value;
use std::fmt::{Debug, Display};
pub type Query<'a> = Vec<(&'a str, &'a str)>;
#[async_trait]
pub trait HttpClient: Debug + Default + Clone + Send {
type Error: Debug + Display;
async fn get(
&self,
url: &str,
api_key: &str,
query: Option<&Query>,
) -> Result<String, Self::Error>;
async fn post(&self, url: &str, api_key: &str, body: &Value) -> Result<String, Self::Error>;
async fn put(&self, url: &str, api_key: &str, body: &Value) -> Result<String, Self::Error>;
async fn delete(&self, url: &str, api_key: &str, body: &Value) -> Result<String, Self::Error>;
}