Skip to main content

tmflib/tmf909/
characteristic_specification_relationship.rs

1use crate::TimePeriod;
2use serde::{Deserialize, Serialize};
3///An aggregation, migration, substitution, dependency or exclusivity relationship between/among Characteristic specifications. The specification characteristic is embedded within the specification whose ID and href are in this entity, and identified by its ID.
4#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5pub struct CharacteristicSpecificationRelationship {
6    ///When sub-classing, this defines the super-class
7    #[serde(rename = "@baseType")]
8    #[serde(default, skip_serializing_if = "Option::is_none")]
9    pub base_type: Option<String>,
10    ///A URI to a JSON-Schema file that defines additional attributes and relationships
11    #[serde(rename = "@schemaLocation")]
12    #[serde(default, skip_serializing_if = "Option::is_none")]
13    pub schema_location: Option<String>,
14    ///When sub-classing, this defines the sub-class Extensible name
15    #[serde(rename = "@type")]
16    #[serde(default, skip_serializing_if = "Option::is_none")]
17    pub type_: Option<String>,
18    ///Unique identifier of the characteristic within the specification
19    #[serde(rename = "characteristicSpecificationId")]
20    #[serde(default, skip_serializing_if = "Option::is_none")]
21    pub characteristic_specification_id: Option<String>,
22    ///Name of the target characteristic within the specification
23    #[serde(default, skip_serializing_if = "Option::is_none")]
24    pub name: Option<String>,
25    ///Hyperlink reference to the parent specification containing the target characteristic
26    #[serde(rename = "parentSpecificationHref")]
27    #[serde(default, skip_serializing_if = "Option::is_none")]
28    pub parent_specification_href: Option<String>,
29    ///Unique identifier of the parent specification containing the target characteristic
30    #[serde(rename = "parentSpecificationId")]
31    #[serde(default, skip_serializing_if = "Option::is_none")]
32    pub parent_specification_id: Option<String>,
33    ///Type of relationship such as aggregation, migration, substitution, dependency, exclusivity
34    #[serde(rename = "relationshipType")]
35    #[serde(default, skip_serializing_if = "Option::is_none")]
36    pub relationship_type: Option<String>,
37    ///A period of time, either as a deadline (endDateTime only) a startDateTime only, or both
38    #[serde(rename = "validFor")]
39    #[serde(default, skip_serializing_if = "Option::is_none")]
40    pub valid_for: Option<TimePeriod>,
41}
42impl std::fmt::Display for CharacteristicSpecificationRelationship {
43    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
44        write!(f, "{}", serde_json::to_string(self).unwrap())
45    }
46}