use serde_json::Value;
use crate::client::Client;
use crate::error::Error;
#[derive(Debug, Clone, Copy)]
pub struct Locations<'a> {
pub(crate) client: &'a Client,
}
impl Locations<'_> {
pub async fn search(&self, query: &str) -> Result<Value, Error> {
self.client
.get("/locations/search", vec![("q", query.to_owned())])
.await
}
pub async fn validate(&self, id: &str) -> Result<Value, Error> {
self.client
.get("/locations/validate", vec![("id", id.to_owned())])
.await
}
}