use crate::core::{config::Config, trait_system::Service};
use std::sync::Arc;
pub mod v2;
pub mod v3;
pub struct SheetsService {
config: Config,
#[allow(dead_code)] config_arc: Arc<Config>,
pub v2: v2::V2,
pub v3: v3::V3,
}
impl SheetsService {
pub fn new(config: Config) -> Self {
let config_arc = Arc::new(config.clone());
Self {
config: config.clone(),
config_arc: config_arc.clone(),
v2: v2::V2::new(config.clone()),
v3: v3::V3::new(config.clone()),
}
}
pub fn new_from_shared(shared: Arc<Config>) -> Self {
Self {
config: shared.as_ref().clone(),
config_arc: shared.clone(),
v2: v2::V2::new(shared.as_ref().clone()),
v3: v3::V3::new(shared.as_ref().clone()),
}
}
}
impl Service for SheetsService {
fn config(&self) -> &Config {
&self.config
}
fn service_name() -> &'static str {
"sheets"
}
fn service_version() -> &'static str {
"v3"
}
}