pub struct DetaClient {
api_key: String,
}
impl DetaClient {
pub fn new(api_key: &str) -> Self {
Self {
api_key: api_key.to_owned(),
}
}
pub fn api_key(&self) -> &str {
&self.api_key
}
pub fn project_id(&self) -> &str {
&self.api_key.split('_').next().unwrap()
}
}