parse_sap_atom_feed/atom/feed/entry/
content.rs

1use crate::xml::{default_xml_namespace_d, default_xml_namespace_m};
2use serde::{Deserialize, Serialize};
3
4// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5/// Represents an Atom `<content>` tag
6///
7/// # Child Nodes
8/// `1:1 m:properties: <T>` where `<T>` is the entity type of this particular entity set
9#[derive(Debug, Serialize, Deserialize)]
10pub struct Content<T> {
11    #[serde(rename = "@type")]
12    pub content_type: Option<String>,
13
14    #[serde(rename = "@m", default = "default_xml_namespace_m")]
15    pub namespace_m: String,
16
17    #[serde(rename = "@d", default = "default_xml_namespace_d")]
18    pub namespace_d: String,
19
20    // If the `src` attribute is populated, then the `properties` element exists as a sibling of <content>
21    // If the `src` attribute is missing, then the `properties` element exists as a child within <content>
22    #[serde(rename = "@src")]
23    pub src: Option<String>,
24
25    // Will only be populated if the above `src` attribute is missing
26    pub properties: Option<T>,
27}