use crate::common::related_place::PlaceRef;
use serde::{Deserialize, Serialize};
#[cfg(all(feature = "tmf620", feature = "build-V4"))]
const MOD_PATH: &str = "productCatalogManagement/v4";
#[cfg(all(feature = "tmf620", feature = "build-V5"))]
const MOD_PATH: &str = "productCatalogManagement/v5";
pub mod bundled_product_offering;
pub mod catalog;
pub mod category;
#[cfg(all(feature = "tmf620", feature = "build-V4"))]
pub mod product_offering;
pub mod product_offering_price;
#[cfg(all(feature = "tmf620", feature = "build-V5"))]
pub mod product_offering_v5;
pub mod product_specification;
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct ChannelRef {
href: String,
id: String,
name: String,
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct MarketSegmentRef {
id: String,
name: String,
href: String,
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct SLARef {}
#[cfg(test)]
mod test {
use super::*;
const EMPTY_JSON: &str = "{}";
const REF_JSON: &str = "{
\"id\" : \"id123\",
\"href\" : \"href123\",
\"name\" : \"namew123\"
}";
#[test]
fn test_channelref_deserialise() {
let channel = ChannelRef::default();
let channel_str = serde_json::to_string(&channel);
assert_eq!(channel_str.is_ok(), true);
}
#[test]
fn test_marketsegment_deserialise() {
let segment = MarketSegmentRef::default();
let segment_str = serde_json::to_string(&segment);
assert_eq!(segment_str.is_ok(), true);
}
#[test]
fn test_placeref_deserialise() {
let place = PlaceRef::default();
let place_str = serde_json::to_string(&place);
assert_eq!(place_str.is_ok(), true);
}
#[test]
fn test_slaref_deserialise() {
let sla = SLARef::default();
let sla_str = serde_json::to_string(&sla);
assert_eq!(sla_str.is_ok(), true);
}
#[test]
fn test_channelref_deserialize() {
let _channelref: ChannelRef =
serde_json::from_str(REF_JSON).expect("Could not parse Empty JSON");
}
#[test]
fn test_marketsegmentref_deserialize() {
let _marketsegmentref: MarketSegmentRef =
serde_json::from_str(REF_JSON).expect("Could not parse Emoty JSON");
}
#[test]
fn test_placeref_deserialize() {
let _placeref: PlaceRef =
serde_json::from_str(REF_JSON).expect("Could not parse Empty JSON");
}
#[test]
fn test_slafef_deserialize() {
let _slaref: SLARef = serde_json::from_str(EMPTY_JSON).expect("Could not parse Emoty JSON");
}
}