sdmx_json/structure/
common.rs

1use crate::primitives::{Annotation, Link, LocalizedText};
2use serde::{Deserialize, Serialize};
3use serde_json::Value;
4use std::collections::HashMap;
5
6/// Properties that all SDMX artefacts share.
7#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Default)]
8#[serde(rename_all = "camelCase")]
9pub struct CommonArtefactType {
10	pub id: String,
11	#[serde(skip_serializing_if = "Option::is_none")]
12	pub agency_id: Option<String>,
13	#[serde(skip_serializing_if = "Option::is_none")]
14	pub version: Option<String>,
15	#[serde(skip_serializing_if = "Option::is_none")]
16	pub name: Option<String>,
17	#[serde(skip_serializing_if = "Option::is_none")]
18	pub names: Option<LocalizedText>,
19	#[serde(skip_serializing_if = "Option::is_none")]
20	pub valid_from: Option<String>,
21	#[serde(skip_serializing_if = "Option::is_none")]
22	pub valid_to: Option<String>,
23	#[serde(skip_serializing_if = "Option::is_none")]
24	pub is_external_reference: Option<bool>,
25	#[serde(skip_serializing_if = "Option::is_none")]
26	pub annotations: Option<Vec<Annotation>>,
27	#[serde(skip_serializing_if = "Option::is_none")]
28	pub links: Option<Vec<Link>>,
29	#[serde(skip_serializing_if = "Option::is_none")]
30	#[serde(flatten)]
31	pub other: Option<HashMap<String, Value>>,
32}
33
34impl_extendable!(CommonArtefactType);