use super::{AddressableFvo, ExtensibleFvo};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EntityRefFvo {
#[serde(rename = "@referredType")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub referred_type: Option<String>,
#[serde(flatten)]
pub addressable_fvo: AddressableFvo,
#[serde(flatten)]
pub extensible_fvo: ExtensibleFvo,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
pub id: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
impl std::fmt::Display for EntityRefFvo {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}
impl std::ops::Deref for EntityRefFvo {
type Target = AddressableFvo;
fn deref(&self) -> &Self::Target {
&self.addressable_fvo
}
}
impl std::ops::DerefMut for EntityRefFvo {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.addressable_fvo
}
}