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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use serde::{Serialize, Deserialize};
use super::{RelatedParty, ServiceCategoryRef};
use crate::TimePeriod;
/// The root entity for service catalog management.
/// A service catalog is a group of service specifications made available through service candidates that an organization provides to the consumers (internal consumers like its employees or B2B customers or B2C customers).
/// A service catalog typically includes name, description and time period that is valid for. It will have a list of ServiceCandidate catalog items. A ServiceCandidate is an entity that makes a ServiceSpecification available to a catalog.
/// A ServiceCandidate and its associated ServiceSpecification may be "published" - made visible -in any number of ServiceCatalogs, or in none.
/// Skipped properties: id,href
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ServiceCatalogCreate {
///When sub-classing, this defines the super-class
#[serde(rename = "@baseType")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_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>,
///List of service categories associated with this catalog
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<Vec<ServiceCategoryRef>>,
///Description of this catalog
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
///Date and time of the last update
#[serde(rename = "lastUpdate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_update: Option<crate::DateTime>,
///Used to indicate the current lifecycle status
#[serde(rename = "lifecycleStatus")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub lifecycle_status: Option<String>,
///Name of the service catalog
pub name: String,
///List of parties or party roles related to this category
#[serde(rename = "relatedParty")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub related_party: Option<Vec<RelatedParty>>,
///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>,
///ServiceCatalog version
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
}
impl std::fmt::Display for ServiceCatalogCreate {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}