use crate::PlatformConfig;
use std::sync::Arc;
pub mod app;
pub mod directory;
#[derive(Debug, Clone)]
pub struct SparkV1 {
config: Arc<PlatformConfig>,
}
impl SparkV1 {
pub fn new(config: Arc<PlatformConfig>) -> Self {
Self { config }
}
pub fn directory(&self) -> directory::SparkDirectoryService {
directory::SparkDirectoryService::new(self.config.clone())
}
pub fn app(&self) -> app::SparkAppService {
app::SparkAppService::new(self.config.clone())
}
}
#[cfg(test)]
mod tests {
use super::SparkV1;
#[test]
fn test_spark_v1_directory_access() {
let config = openlark_core::config::Config::builder()
.app_id("test_app")
.app_secret("test_secret")
.build();
let api = SparkV1::new(std::sync::Arc::new(config));
let _ = api.directory();
}
#[test]
fn spark_app_issue_194_app_access() {
let config = openlark_core::config::Config::builder()
.app_id("test_app")
.app_secret("test_secret")
.build();
let api = SparkV1::new(std::sync::Arc::new(config));
let _ = api.app();
}
}