parse_sap_odata/sap_annotations/
entity_container.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{
4    sap_annotations::default_entity_container_supported_formats,
5    utils::{de_str_to_bool, de_str_to_list, default_false},
6};
7
8// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
9/// SAP Annotations applicable to `edm:EntityContainer`
10///
11/// See https://sap.github.io/odata-vocabularies/docs/v2-annotations.html#element-edmentitycontainer
12#[derive(Debug, Serialize, Deserialize)]
13#[serde(rename_all = "PascalCase")]
14pub struct SAPAnnotationsEntityContainer {
15    #[serde(
16        rename = "@message-scope-supported",
17        deserialize_with = "de_str_to_bool",
18        default = "default_false"
19    )]
20    pub message_scope_supported: bool,
21    #[serde(
22        rename = "@use-batch",
23        deserialize_with = "de_str_to_bool",
24        default = "default_false"
25    )]
26    pub use_batch: bool,
27    #[serde(
28        rename = "@supported-formats",
29        deserialize_with = "de_str_to_list",
30        default = "default_entity_container_supported_formats"
31    )]
32    pub supported_formats: Vec<String>,
33}