1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use serde::{Deserialize, Serialize};
/**Resources are physical or non-physical components (or some combination of these) within an enterprise's infrastructure or inventory. They are typically consumed or used by services (for example a physical port assigned to a service) or contribute to the realization of a Product (for example, a SIM card). They can be drawn from the Application, Computing and Network domains, and include, for example, Network Elements, software, IT systems, content and information, and technology components.
A ResourceSpecification is an abstract base class for representing a generic means for implementing a particular type of Resource. In essence, a ResourceSpecification defines the common attributes and relationships of a set of related Resources, while Resource defines a specific instance that is based on a particular ResourceSpecification.*/
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ResourceSpecificationRef {
///When sub-classing, this defines the super-class
#[serde(rename = "@baseType")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_type: Option<String>,
///The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub referred_type: Option<String>,
///A URI to a JSON-Schema file that defines additional attributes and relationships
#[serde(rename = "@schemaLocation")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub schema_location: Option<String>,
///When sub-classing, this defines the sub-class Extensible name
#[serde(rename = "@type")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
///Hyperlink reference
#[serde(default, skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
///unique identifier
pub id: String,
///Name of the related entity.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
///Resource Specification version
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
}
impl std::fmt::Display for ResourceSpecificationRef {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}