use openlark_core::config::Config;
#[derive(Debug, Clone)]
pub struct CcmSheetV2 {
config: Config,
}
impl CcmSheetV2 {
pub fn new(config: Config) -> Self {
Self { config }
}
pub fn config(&self) -> &Config {
&self.config
}
pub fn data_io(&self) -> crate::ccm::sheets_v2::v2::data_io::DataIOApi {
crate::ccm::sheets_v2::v2::data_io::DataIOApi::new(self.config.clone())
}
pub fn sheet_operations(
&self,
) -> crate::ccm::sheets_v2::v2::sheet_operations::SheetOperationsApi {
crate::ccm::sheets_v2::v2::sheet_operations::SheetOperationsApi::new(self.config.clone())
}
pub fn filter(&self) -> crate::ccm::sheets_v2::v2::filter::FilterApi {
crate::ccm::sheets_v2::v2::filter::FilterApi::new(self.config.clone())
}
pub fn float_image(&self) -> crate::ccm::sheets_v2::v2::float_image::FloatImageApi {
crate::ccm::sheets_v2::v2::float_image::FloatImageApi::new(self.config.clone())
}
pub fn spreadsheet(&self) -> crate::ccm::sheets_v2::v2::spreadsheet::SpreadsheetApi {
crate::ccm::sheets_v2::v2::spreadsheet::SpreadsheetApi::new(self.config.clone())
}
pub fn sheet(&self) -> crate::ccm::sheets_v2::v2::sheet::SheetApi {
crate::ccm::sheets_v2::v2::sheet::SheetApi::new(self.config.clone())
}
}
pub mod data_io;
pub mod filter;
pub mod float_image;
pub mod sheet;
pub mod sheet_operations;
pub mod spreadsheet;
pub use data_io::DataIOApi;
pub use filter::FilterApi;
pub use float_image::FloatImageApi;
pub use sheet::SheetApi;
pub use sheet_operations::SheetOperationsApi;
#[cfg(test)]
mod tests {
use serde_json;
#[test]
fn test_serialization_roundtrip() {
let json = r#"{"test": "value"}"#;
assert!(serde_json::from_str::<serde_json::Value>(json).is_ok());
}
#[test]
fn test_deserialization_from_json() {
let json = r#"{"field": "data"}"#;
let value: serde_json::Value = serde_json::from_str(json).unwrap();
assert_eq!(value["field"], "data");
}
}