tmflib 0.1.37

Interface library for processing TMF payloads
Documentation
use super::EntityRefMvo;
use crate::TimePeriod;
use serde::{Deserialize, Serialize};

///Feature Relationship MVO
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct FeatureRelationshipMvo {
    ///Base Entity Ref MVO schema
    #[serde(flatten)]
    pub entity_ref_mvo: EntityRefMvo,
    ///This is the name of the target feature.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    ///This is the type of the feature relationship.
    #[serde(rename = "relationshipType")]
    pub relationship_type: String,
    ///A period of time, either as a deadline (endDateTime only) a startDateTime only, or both
    #[serde(rename = "validFor")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub valid_for: Option<TimePeriod>,
}
impl std::fmt::Display for FeatureRelationshipMvo {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
impl std::ops::Deref for FeatureRelationshipMvo {
    type Target = EntityRefMvo;
    fn deref(&self) -> &Self::Target {
        &self.entity_ref_mvo
    }
}
impl std::ops::DerefMut for FeatureRelationshipMvo {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.entity_ref_mvo
    }
}