#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ScaniiTarget {
pub(crate) url: String,
}
impl ScaniiTarget {
pub fn us1() -> Self {
Self::from_url("https://api-us1.scanii.com")
}
pub fn eu1() -> Self {
Self::from_url("https://api-eu1.scanii.com")
}
pub fn eu2() -> Self {
Self::from_url("https://api-eu2.scanii.com")
}
pub fn ap1() -> Self {
Self::from_url("https://api-ap1.scanii.com")
}
pub fn ap2() -> Self {
Self::from_url("https://api-ap2.scanii.com")
}
pub fn ca1() -> Self {
Self::from_url("https://api-ca1.scanii.com")
}
pub fn from_url(url: impl Into<String>) -> Self {
ScaniiTarget { url: url.into() }
}
pub fn url(&self) -> &str {
&self.url
}
}