Skip to main content

ftm_types/generated/
ftm_entity.rs

1#![allow(missing_docs)]
2use super::entities::*;
3use serde::{Deserialize, Serialize};
4use serde_json::Value;
5/// FTM Entity enum for runtime polymorphism
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(untagged)]
8#[allow(clippy::large_enum_variant)]
9pub enum FtmEntity {
10    Address(Address),
11    Airplane(Airplane),
12    Article(Article),
13    Asset(Asset),
14    Associate(Associate),
15    Audio(Audio),
16    BankAccount(BankAccount),
17    Call(Call),
18    CallForTenders(CallForTenders),
19    Company(Company),
20    Contract(Contract),
21    ContractAward(ContractAward),
22    CourtCase(CourtCase),
23    CourtCaseParty(CourtCaseParty),
24    CryptoWallet(CryptoWallet),
25    Debt(Debt),
26    Directorship(Directorship),
27    Document(Document),
28    Documentation(Documentation),
29    EconomicActivity(EconomicActivity),
30    Email(Email),
31    Employment(Employment),
32    Event(Event),
33    Family(Family),
34    Folder(Folder),
35    HyperText(HyperText),
36    Identification(Identification),
37    Image(Image),
38    LegalEntity(LegalEntity),
39    License(License),
40    Membership(Membership),
41    Mention(Mention),
42    Message(Message),
43    Note(Note),
44    Occupancy(Occupancy),
45    Organization(Organization),
46    Ownership(Ownership),
47    Package(Package),
48    Page(Page),
49    Pages(Pages),
50    Passport(Passport),
51    Payment(Payment),
52    Person(Person),
53    PlainText(PlainText),
54    Position(Position),
55    Project(Project),
56    ProjectParticipant(ProjectParticipant),
57    PublicBody(PublicBody),
58    RealEstate(RealEstate),
59    Representation(Representation),
60    Risk(Risk),
61    Sanction(Sanction),
62    Security(Security),
63    Similar(Similar),
64    Succession(Succession),
65    Table(Table),
66    TaxRoll(TaxRoll),
67    Trip(Trip),
68    UnknownLink(UnknownLink),
69    UserAccount(UserAccount),
70    Vehicle(Vehicle),
71    Vessel(Vessel),
72    Video(Video),
73    Workbook(Workbook),
74}
75impl FtmEntity {
76    /// Get the schema name for this entity
77    pub fn schema(&self) -> &str {
78        match self {
79            FtmEntity::Address(_) => "Address",
80            FtmEntity::Airplane(_) => "Airplane",
81            FtmEntity::Article(_) => "Article",
82            FtmEntity::Asset(_) => "Asset",
83            FtmEntity::Associate(_) => "Associate",
84            FtmEntity::Audio(_) => "Audio",
85            FtmEntity::BankAccount(_) => "BankAccount",
86            FtmEntity::Call(_) => "Call",
87            FtmEntity::CallForTenders(_) => "CallForTenders",
88            FtmEntity::Company(_) => "Company",
89            FtmEntity::Contract(_) => "Contract",
90            FtmEntity::ContractAward(_) => "ContractAward",
91            FtmEntity::CourtCase(_) => "CourtCase",
92            FtmEntity::CourtCaseParty(_) => "CourtCaseParty",
93            FtmEntity::CryptoWallet(_) => "CryptoWallet",
94            FtmEntity::Debt(_) => "Debt",
95            FtmEntity::Directorship(_) => "Directorship",
96            FtmEntity::Document(_) => "Document",
97            FtmEntity::Documentation(_) => "Documentation",
98            FtmEntity::EconomicActivity(_) => "EconomicActivity",
99            FtmEntity::Email(_) => "Email",
100            FtmEntity::Employment(_) => "Employment",
101            FtmEntity::Event(_) => "Event",
102            FtmEntity::Family(_) => "Family",
103            FtmEntity::Folder(_) => "Folder",
104            FtmEntity::HyperText(_) => "HyperText",
105            FtmEntity::Identification(_) => "Identification",
106            FtmEntity::Image(_) => "Image",
107            FtmEntity::LegalEntity(_) => "LegalEntity",
108            FtmEntity::License(_) => "License",
109            FtmEntity::Membership(_) => "Membership",
110            FtmEntity::Mention(_) => "Mention",
111            FtmEntity::Message(_) => "Message",
112            FtmEntity::Note(_) => "Note",
113            FtmEntity::Occupancy(_) => "Occupancy",
114            FtmEntity::Organization(_) => "Organization",
115            FtmEntity::Ownership(_) => "Ownership",
116            FtmEntity::Package(_) => "Package",
117            FtmEntity::Page(_) => "Page",
118            FtmEntity::Pages(_) => "Pages",
119            FtmEntity::Passport(_) => "Passport",
120            FtmEntity::Payment(_) => "Payment",
121            FtmEntity::Person(_) => "Person",
122            FtmEntity::PlainText(_) => "PlainText",
123            FtmEntity::Position(_) => "Position",
124            FtmEntity::Project(_) => "Project",
125            FtmEntity::ProjectParticipant(_) => "ProjectParticipant",
126            FtmEntity::PublicBody(_) => "PublicBody",
127            FtmEntity::RealEstate(_) => "RealEstate",
128            FtmEntity::Representation(_) => "Representation",
129            FtmEntity::Risk(_) => "Risk",
130            FtmEntity::Sanction(_) => "Sanction",
131            FtmEntity::Security(_) => "Security",
132            FtmEntity::Similar(_) => "Similar",
133            FtmEntity::Succession(_) => "Succession",
134            FtmEntity::Table(_) => "Table",
135            FtmEntity::TaxRoll(_) => "TaxRoll",
136            FtmEntity::Trip(_) => "Trip",
137            FtmEntity::UnknownLink(_) => "UnknownLink",
138            FtmEntity::UserAccount(_) => "UserAccount",
139            FtmEntity::Vehicle(_) => "Vehicle",
140            FtmEntity::Vessel(_) => "Vessel",
141            FtmEntity::Video(_) => "Video",
142            FtmEntity::Workbook(_) => "Workbook",
143        }
144    }
145    /// Get the entity ID
146    pub fn id(&self) -> &str {
147        match self {
148            FtmEntity::Address(entity) => &entity.id,
149            FtmEntity::Airplane(entity) => &entity.id,
150            FtmEntity::Article(entity) => &entity.id,
151            FtmEntity::Asset(entity) => &entity.id,
152            FtmEntity::Associate(entity) => &entity.id,
153            FtmEntity::Audio(entity) => &entity.id,
154            FtmEntity::BankAccount(entity) => &entity.id,
155            FtmEntity::Call(entity) => &entity.id,
156            FtmEntity::CallForTenders(entity) => &entity.id,
157            FtmEntity::Company(entity) => &entity.id,
158            FtmEntity::Contract(entity) => &entity.id,
159            FtmEntity::ContractAward(entity) => &entity.id,
160            FtmEntity::CourtCase(entity) => &entity.id,
161            FtmEntity::CourtCaseParty(entity) => &entity.id,
162            FtmEntity::CryptoWallet(entity) => &entity.id,
163            FtmEntity::Debt(entity) => &entity.id,
164            FtmEntity::Directorship(entity) => &entity.id,
165            FtmEntity::Document(entity) => &entity.id,
166            FtmEntity::Documentation(entity) => &entity.id,
167            FtmEntity::EconomicActivity(entity) => &entity.id,
168            FtmEntity::Email(entity) => &entity.id,
169            FtmEntity::Employment(entity) => &entity.id,
170            FtmEntity::Event(entity) => &entity.id,
171            FtmEntity::Family(entity) => &entity.id,
172            FtmEntity::Folder(entity) => &entity.id,
173            FtmEntity::HyperText(entity) => &entity.id,
174            FtmEntity::Identification(entity) => &entity.id,
175            FtmEntity::Image(entity) => &entity.id,
176            FtmEntity::LegalEntity(entity) => &entity.id,
177            FtmEntity::License(entity) => &entity.id,
178            FtmEntity::Membership(entity) => &entity.id,
179            FtmEntity::Mention(entity) => &entity.id,
180            FtmEntity::Message(entity) => &entity.id,
181            FtmEntity::Note(entity) => &entity.id,
182            FtmEntity::Occupancy(entity) => &entity.id,
183            FtmEntity::Organization(entity) => &entity.id,
184            FtmEntity::Ownership(entity) => &entity.id,
185            FtmEntity::Package(entity) => &entity.id,
186            FtmEntity::Page(entity) => &entity.id,
187            FtmEntity::Pages(entity) => &entity.id,
188            FtmEntity::Passport(entity) => &entity.id,
189            FtmEntity::Payment(entity) => &entity.id,
190            FtmEntity::Person(entity) => &entity.id,
191            FtmEntity::PlainText(entity) => &entity.id,
192            FtmEntity::Position(entity) => &entity.id,
193            FtmEntity::Project(entity) => &entity.id,
194            FtmEntity::ProjectParticipant(entity) => &entity.id,
195            FtmEntity::PublicBody(entity) => &entity.id,
196            FtmEntity::RealEstate(entity) => &entity.id,
197            FtmEntity::Representation(entity) => &entity.id,
198            FtmEntity::Risk(entity) => &entity.id,
199            FtmEntity::Sanction(entity) => &entity.id,
200            FtmEntity::Security(entity) => &entity.id,
201            FtmEntity::Similar(entity) => &entity.id,
202            FtmEntity::Succession(entity) => &entity.id,
203            FtmEntity::Table(entity) => &entity.id,
204            FtmEntity::TaxRoll(entity) => &entity.id,
205            FtmEntity::Trip(entity) => &entity.id,
206            FtmEntity::UnknownLink(entity) => &entity.id,
207            FtmEntity::UserAccount(entity) => &entity.id,
208            FtmEntity::Vehicle(entity) => &entity.id,
209            FtmEntity::Vessel(entity) => &entity.id,
210            FtmEntity::Video(entity) => &entity.id,
211            FtmEntity::Workbook(entity) => &entity.id,
212        }
213    }
214    /// Parse FTM entity from nested JSON format
215    ///
216    /// The standard FTM JSON format has a nested structure:
217    /// ```json
218    /// {
219    ///   "id": "...",
220    ///   "schema": "Payment",
221    ///   "properties": {
222    ///     "amount": ["100"],
223    ///     "date": ["2024-01-01"]
224    ///   }
225    /// }
226    /// ```
227    ///
228    /// This function flattens the structure to match the generated Rust types.
229    /// Dispatch is done on the `"schema"` field, so the correct variant is always
230    /// selected regardless of declaration order in the enum.
231    pub fn from_ftm_json(json_str: &str) -> Result<Self, serde_json::Error> {
232        let mut value: Value = serde_json::from_str(json_str)?;
233        if let Some(obj) = value.as_object_mut()
234            && let Some(properties) = obj.remove("properties")
235            && let Some(props_obj) = properties.as_object()
236        {
237            for (key, val) in props_obj {
238                obj.insert(key.clone(), val.clone());
239            }
240        }
241        let schema = value.get("schema").and_then(|v| v.as_str()).unwrap_or("");
242        match schema {
243            "Address" => Ok(FtmEntity::Address(serde_json::from_value(value)?)),
244            "Airplane" => Ok(FtmEntity::Airplane(serde_json::from_value(value)?)),
245            "Article" => Ok(FtmEntity::Article(serde_json::from_value(value)?)),
246            "Asset" => Ok(FtmEntity::Asset(serde_json::from_value(value)?)),
247            "Associate" => Ok(FtmEntity::Associate(serde_json::from_value(value)?)),
248            "Audio" => Ok(FtmEntity::Audio(serde_json::from_value(value)?)),
249            "BankAccount" => Ok(FtmEntity::BankAccount(serde_json::from_value(value)?)),
250            "Call" => Ok(FtmEntity::Call(serde_json::from_value(value)?)),
251            "CallForTenders" => Ok(FtmEntity::CallForTenders(serde_json::from_value(value)?)),
252            "Company" => Ok(FtmEntity::Company(serde_json::from_value(value)?)),
253            "Contract" => Ok(FtmEntity::Contract(serde_json::from_value(value)?)),
254            "ContractAward" => Ok(FtmEntity::ContractAward(serde_json::from_value(value)?)),
255            "CourtCase" => Ok(FtmEntity::CourtCase(serde_json::from_value(value)?)),
256            "CourtCaseParty" => Ok(FtmEntity::CourtCaseParty(serde_json::from_value(value)?)),
257            "CryptoWallet" => Ok(FtmEntity::CryptoWallet(serde_json::from_value(value)?)),
258            "Debt" => Ok(FtmEntity::Debt(serde_json::from_value(value)?)),
259            "Directorship" => Ok(FtmEntity::Directorship(serde_json::from_value(value)?)),
260            "Document" => Ok(FtmEntity::Document(serde_json::from_value(value)?)),
261            "Documentation" => Ok(FtmEntity::Documentation(serde_json::from_value(value)?)),
262            "EconomicActivity" => Ok(FtmEntity::EconomicActivity(serde_json::from_value(value)?)),
263            "Email" => Ok(FtmEntity::Email(serde_json::from_value(value)?)),
264            "Employment" => Ok(FtmEntity::Employment(serde_json::from_value(value)?)),
265            "Event" => Ok(FtmEntity::Event(serde_json::from_value(value)?)),
266            "Family" => Ok(FtmEntity::Family(serde_json::from_value(value)?)),
267            "Folder" => Ok(FtmEntity::Folder(serde_json::from_value(value)?)),
268            "HyperText" => Ok(FtmEntity::HyperText(serde_json::from_value(value)?)),
269            "Identification" => Ok(FtmEntity::Identification(serde_json::from_value(value)?)),
270            "Image" => Ok(FtmEntity::Image(serde_json::from_value(value)?)),
271            "LegalEntity" => Ok(FtmEntity::LegalEntity(serde_json::from_value(value)?)),
272            "License" => Ok(FtmEntity::License(serde_json::from_value(value)?)),
273            "Membership" => Ok(FtmEntity::Membership(serde_json::from_value(value)?)),
274            "Mention" => Ok(FtmEntity::Mention(serde_json::from_value(value)?)),
275            "Message" => Ok(FtmEntity::Message(serde_json::from_value(value)?)),
276            "Note" => Ok(FtmEntity::Note(serde_json::from_value(value)?)),
277            "Occupancy" => Ok(FtmEntity::Occupancy(serde_json::from_value(value)?)),
278            "Organization" => Ok(FtmEntity::Organization(serde_json::from_value(value)?)),
279            "Ownership" => Ok(FtmEntity::Ownership(serde_json::from_value(value)?)),
280            "Package" => Ok(FtmEntity::Package(serde_json::from_value(value)?)),
281            "Page" => Ok(FtmEntity::Page(serde_json::from_value(value)?)),
282            "Pages" => Ok(FtmEntity::Pages(serde_json::from_value(value)?)),
283            "Passport" => Ok(FtmEntity::Passport(serde_json::from_value(value)?)),
284            "Payment" => Ok(FtmEntity::Payment(serde_json::from_value(value)?)),
285            "Person" => Ok(FtmEntity::Person(serde_json::from_value(value)?)),
286            "PlainText" => Ok(FtmEntity::PlainText(serde_json::from_value(value)?)),
287            "Position" => Ok(FtmEntity::Position(serde_json::from_value(value)?)),
288            "Project" => Ok(FtmEntity::Project(serde_json::from_value(value)?)),
289            "ProjectParticipant" => Ok(FtmEntity::ProjectParticipant(serde_json::from_value(
290                value,
291            )?)),
292            "PublicBody" => Ok(FtmEntity::PublicBody(serde_json::from_value(value)?)),
293            "RealEstate" => Ok(FtmEntity::RealEstate(serde_json::from_value(value)?)),
294            "Representation" => Ok(FtmEntity::Representation(serde_json::from_value(value)?)),
295            "Risk" => Ok(FtmEntity::Risk(serde_json::from_value(value)?)),
296            "Sanction" => Ok(FtmEntity::Sanction(serde_json::from_value(value)?)),
297            "Security" => Ok(FtmEntity::Security(serde_json::from_value(value)?)),
298            "Similar" => Ok(FtmEntity::Similar(serde_json::from_value(value)?)),
299            "Succession" => Ok(FtmEntity::Succession(serde_json::from_value(value)?)),
300            "Table" => Ok(FtmEntity::Table(serde_json::from_value(value)?)),
301            "TaxRoll" => Ok(FtmEntity::TaxRoll(serde_json::from_value(value)?)),
302            "Trip" => Ok(FtmEntity::Trip(serde_json::from_value(value)?)),
303            "UnknownLink" => Ok(FtmEntity::UnknownLink(serde_json::from_value(value)?)),
304            "UserAccount" => Ok(FtmEntity::UserAccount(serde_json::from_value(value)?)),
305            "Vehicle" => Ok(FtmEntity::Vehicle(serde_json::from_value(value)?)),
306            "Vessel" => Ok(FtmEntity::Vessel(serde_json::from_value(value)?)),
307            "Video" => Ok(FtmEntity::Video(serde_json::from_value(value)?)),
308            "Workbook" => Ok(FtmEntity::Workbook(serde_json::from_value(value)?)),
309            _ => Err(serde::de::Error::custom(format!(
310                "unknown FTM schema: {schema:?}"
311            ))),
312        }
313    }
314    /// Serialize to standard FTM nested JSON format
315    ///
316    /// Produces `{"id": "...", "schema": "...", "properties": {...}}`
317    pub fn to_ftm_json(&self) -> Result<String, serde_json::Error> {
318        let mut value = serde_json::to_value(self)?;
319        if let Some(obj) = value.as_object_mut() {
320            let id = obj.remove("id");
321            let schema = obj.remove("schema");
322            let properties = serde_json::Value::Object(std::mem::take(obj));
323            if let Some(id) = id {
324                obj.insert("id".into(), id);
325            }
326            if let Some(schema) = schema {
327                obj.insert("schema".into(), schema);
328            }
329            obj.insert("properties".into(), properties);
330        }
331        serde_json::to_string(&value)
332    }
333}
334impl TryFrom<String> for FtmEntity {
335    type Error = serde_json::Error;
336    fn try_from(s: String) -> Result<Self, Self::Error> {
337        Self::from_ftm_json(&s)
338    }
339}
340impl TryFrom<&str> for FtmEntity {
341    type Error = serde_json::Error;
342    fn try_from(s: &str) -> Result<Self, Self::Error> {
343        Self::from_ftm_json(s)
344    }
345}
346impl From<Address> for FtmEntity {
347    fn from(entity: Address) -> Self {
348        FtmEntity::Address(entity)
349    }
350}
351impl From<Airplane> for FtmEntity {
352    fn from(entity: Airplane) -> Self {
353        FtmEntity::Airplane(entity)
354    }
355}
356impl From<Article> for FtmEntity {
357    fn from(entity: Article) -> Self {
358        FtmEntity::Article(entity)
359    }
360}
361impl From<Asset> for FtmEntity {
362    fn from(entity: Asset) -> Self {
363        FtmEntity::Asset(entity)
364    }
365}
366impl From<Associate> for FtmEntity {
367    fn from(entity: Associate) -> Self {
368        FtmEntity::Associate(entity)
369    }
370}
371impl From<Audio> for FtmEntity {
372    fn from(entity: Audio) -> Self {
373        FtmEntity::Audio(entity)
374    }
375}
376impl From<BankAccount> for FtmEntity {
377    fn from(entity: BankAccount) -> Self {
378        FtmEntity::BankAccount(entity)
379    }
380}
381impl From<Call> for FtmEntity {
382    fn from(entity: Call) -> Self {
383        FtmEntity::Call(entity)
384    }
385}
386impl From<CallForTenders> for FtmEntity {
387    fn from(entity: CallForTenders) -> Self {
388        FtmEntity::CallForTenders(entity)
389    }
390}
391impl From<Company> for FtmEntity {
392    fn from(entity: Company) -> Self {
393        FtmEntity::Company(entity)
394    }
395}
396impl From<Contract> for FtmEntity {
397    fn from(entity: Contract) -> Self {
398        FtmEntity::Contract(entity)
399    }
400}
401impl From<ContractAward> for FtmEntity {
402    fn from(entity: ContractAward) -> Self {
403        FtmEntity::ContractAward(entity)
404    }
405}
406impl From<CourtCase> for FtmEntity {
407    fn from(entity: CourtCase) -> Self {
408        FtmEntity::CourtCase(entity)
409    }
410}
411impl From<CourtCaseParty> for FtmEntity {
412    fn from(entity: CourtCaseParty) -> Self {
413        FtmEntity::CourtCaseParty(entity)
414    }
415}
416impl From<CryptoWallet> for FtmEntity {
417    fn from(entity: CryptoWallet) -> Self {
418        FtmEntity::CryptoWallet(entity)
419    }
420}
421impl From<Debt> for FtmEntity {
422    fn from(entity: Debt) -> Self {
423        FtmEntity::Debt(entity)
424    }
425}
426impl From<Directorship> for FtmEntity {
427    fn from(entity: Directorship) -> Self {
428        FtmEntity::Directorship(entity)
429    }
430}
431impl From<Document> for FtmEntity {
432    fn from(entity: Document) -> Self {
433        FtmEntity::Document(entity)
434    }
435}
436impl From<Documentation> for FtmEntity {
437    fn from(entity: Documentation) -> Self {
438        FtmEntity::Documentation(entity)
439    }
440}
441impl From<EconomicActivity> for FtmEntity {
442    fn from(entity: EconomicActivity) -> Self {
443        FtmEntity::EconomicActivity(entity)
444    }
445}
446impl From<Email> for FtmEntity {
447    fn from(entity: Email) -> Self {
448        FtmEntity::Email(entity)
449    }
450}
451impl From<Employment> for FtmEntity {
452    fn from(entity: Employment) -> Self {
453        FtmEntity::Employment(entity)
454    }
455}
456impl From<Event> for FtmEntity {
457    fn from(entity: Event) -> Self {
458        FtmEntity::Event(entity)
459    }
460}
461impl From<Family> for FtmEntity {
462    fn from(entity: Family) -> Self {
463        FtmEntity::Family(entity)
464    }
465}
466impl From<Folder> for FtmEntity {
467    fn from(entity: Folder) -> Self {
468        FtmEntity::Folder(entity)
469    }
470}
471impl From<HyperText> for FtmEntity {
472    fn from(entity: HyperText) -> Self {
473        FtmEntity::HyperText(entity)
474    }
475}
476impl From<Identification> for FtmEntity {
477    fn from(entity: Identification) -> Self {
478        FtmEntity::Identification(entity)
479    }
480}
481impl From<Image> for FtmEntity {
482    fn from(entity: Image) -> Self {
483        FtmEntity::Image(entity)
484    }
485}
486impl From<LegalEntity> for FtmEntity {
487    fn from(entity: LegalEntity) -> Self {
488        FtmEntity::LegalEntity(entity)
489    }
490}
491impl From<License> for FtmEntity {
492    fn from(entity: License) -> Self {
493        FtmEntity::License(entity)
494    }
495}
496impl From<Membership> for FtmEntity {
497    fn from(entity: Membership) -> Self {
498        FtmEntity::Membership(entity)
499    }
500}
501impl From<Mention> for FtmEntity {
502    fn from(entity: Mention) -> Self {
503        FtmEntity::Mention(entity)
504    }
505}
506impl From<Message> for FtmEntity {
507    fn from(entity: Message) -> Self {
508        FtmEntity::Message(entity)
509    }
510}
511impl From<Note> for FtmEntity {
512    fn from(entity: Note) -> Self {
513        FtmEntity::Note(entity)
514    }
515}
516impl From<Occupancy> for FtmEntity {
517    fn from(entity: Occupancy) -> Self {
518        FtmEntity::Occupancy(entity)
519    }
520}
521impl From<Organization> for FtmEntity {
522    fn from(entity: Organization) -> Self {
523        FtmEntity::Organization(entity)
524    }
525}
526impl From<Ownership> for FtmEntity {
527    fn from(entity: Ownership) -> Self {
528        FtmEntity::Ownership(entity)
529    }
530}
531impl From<Package> for FtmEntity {
532    fn from(entity: Package) -> Self {
533        FtmEntity::Package(entity)
534    }
535}
536impl From<Page> for FtmEntity {
537    fn from(entity: Page) -> Self {
538        FtmEntity::Page(entity)
539    }
540}
541impl From<Pages> for FtmEntity {
542    fn from(entity: Pages) -> Self {
543        FtmEntity::Pages(entity)
544    }
545}
546impl From<Passport> for FtmEntity {
547    fn from(entity: Passport) -> Self {
548        FtmEntity::Passport(entity)
549    }
550}
551impl From<Payment> for FtmEntity {
552    fn from(entity: Payment) -> Self {
553        FtmEntity::Payment(entity)
554    }
555}
556impl From<Person> for FtmEntity {
557    fn from(entity: Person) -> Self {
558        FtmEntity::Person(entity)
559    }
560}
561impl From<PlainText> for FtmEntity {
562    fn from(entity: PlainText) -> Self {
563        FtmEntity::PlainText(entity)
564    }
565}
566impl From<Position> for FtmEntity {
567    fn from(entity: Position) -> Self {
568        FtmEntity::Position(entity)
569    }
570}
571impl From<Project> for FtmEntity {
572    fn from(entity: Project) -> Self {
573        FtmEntity::Project(entity)
574    }
575}
576impl From<ProjectParticipant> for FtmEntity {
577    fn from(entity: ProjectParticipant) -> Self {
578        FtmEntity::ProjectParticipant(entity)
579    }
580}
581impl From<PublicBody> for FtmEntity {
582    fn from(entity: PublicBody) -> Self {
583        FtmEntity::PublicBody(entity)
584    }
585}
586impl From<RealEstate> for FtmEntity {
587    fn from(entity: RealEstate) -> Self {
588        FtmEntity::RealEstate(entity)
589    }
590}
591impl From<Representation> for FtmEntity {
592    fn from(entity: Representation) -> Self {
593        FtmEntity::Representation(entity)
594    }
595}
596impl From<Risk> for FtmEntity {
597    fn from(entity: Risk) -> Self {
598        FtmEntity::Risk(entity)
599    }
600}
601impl From<Sanction> for FtmEntity {
602    fn from(entity: Sanction) -> Self {
603        FtmEntity::Sanction(entity)
604    }
605}
606impl From<Security> for FtmEntity {
607    fn from(entity: Security) -> Self {
608        FtmEntity::Security(entity)
609    }
610}
611impl From<Similar> for FtmEntity {
612    fn from(entity: Similar) -> Self {
613        FtmEntity::Similar(entity)
614    }
615}
616impl From<Succession> for FtmEntity {
617    fn from(entity: Succession) -> Self {
618        FtmEntity::Succession(entity)
619    }
620}
621impl From<Table> for FtmEntity {
622    fn from(entity: Table) -> Self {
623        FtmEntity::Table(entity)
624    }
625}
626impl From<TaxRoll> for FtmEntity {
627    fn from(entity: TaxRoll) -> Self {
628        FtmEntity::TaxRoll(entity)
629    }
630}
631impl From<Trip> for FtmEntity {
632    fn from(entity: Trip) -> Self {
633        FtmEntity::Trip(entity)
634    }
635}
636impl From<UnknownLink> for FtmEntity {
637    fn from(entity: UnknownLink) -> Self {
638        FtmEntity::UnknownLink(entity)
639    }
640}
641impl From<UserAccount> for FtmEntity {
642    fn from(entity: UserAccount) -> Self {
643        FtmEntity::UserAccount(entity)
644    }
645}
646impl From<Vehicle> for FtmEntity {
647    fn from(entity: Vehicle) -> Self {
648        FtmEntity::Vehicle(entity)
649    }
650}
651impl From<Vessel> for FtmEntity {
652    fn from(entity: Vessel) -> Self {
653        FtmEntity::Vessel(entity)
654    }
655}
656impl From<Video> for FtmEntity {
657    fn from(entity: Video) -> Self {
658        FtmEntity::Video(entity)
659    }
660}
661impl From<Workbook> for FtmEntity {
662    fn from(entity: Workbook) -> Self {
663        FtmEntity::Workbook(entity)
664    }
665}