use crate::error::DnaResult;
use crate::http::HttpClient;
use crate::{URL_OTE, URL_PROD};
pub struct DnaClient {
pub(crate) http: HttpClient,
}
impl DnaClient {
pub fn new(reseller_id: &str, token: &str) -> DnaResult<Self> {
Ok(Self {
http: HttpClient::new(URL_PROD, reseller_id, token)?,
})
}
pub fn new_ote(reseller_id: &str, token: &str) -> DnaResult<Self> {
Ok(Self {
http: HttpClient::new(URL_OTE, reseller_id, token)?,
})
}
pub fn with_url(reseller_id: &str, token: &str, url: &str) -> DnaResult<Self> {
Ok(Self {
http: HttpClient::new(url, reseller_id, token)?,
})
}
}