parse_sap_odata/sap_annotations/association_set/
mod.rs

1#[cfg(feature = "parser")]
2pub mod metadata;
3
4use serde::{Deserialize, Serialize};
5
6use crate::{
7    sap_annotations::default_sap_content_version,
8    utils::{de_str_to_bool, default_true},
9};
10
11// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
12/// SAP Annotations applicable to `edm:AssociationSet`
13///
14/// See https://sap.github.io/odata-vocabularies/docs/v2-annotations.html#element-edmassociationset
15#[derive(Clone, Debug, Serialize, Deserialize, Ord, Eq, PartialOrd, PartialEq)]
16#[serde(rename_all = "PascalCase")]
17pub struct SAPAnnotationsAssociationSet {
18    #[serde(rename = "@content-version", default = "default_sap_content_version")]
19    pub content_version: String,
20    #[serde(
21        rename = "@creatable",
22        deserialize_with = "de_str_to_bool",
23        default = "default_true"
24    )]
25    pub is_creatable: bool,
26    #[serde(
27        rename = "@deletable",
28        deserialize_with = "de_str_to_bool",
29        default = "default_true"
30    )]
31    pub is_deletable: bool,
32    #[serde(
33        rename = "@updatable",
34        deserialize_with = "de_str_to_bool",
35        default = "default_true"
36    )]
37    pub is_updatable: bool,
38}