// Auto-generated by automapper-generator. Do not edit.

#![allow(dead_code, unused_imports, non_camel_case_types)]

use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;

/// kontakt.funktion_code for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AnsprechpartnerFunktionCode {
    /// Informationskontakt
    #[serde(rename = "IC")]
    Informationskontakt,
}

/// kommunikationstyp for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Kommunikationstyp {
    /// E-Mail
    #[serde(rename = "EM")]
    ElektronischePost,
    /// Telefax
    #[serde(rename = "FX")]
    Telefax,
    /// Telefon
    #[serde(rename = "TE")]
    Telefon,
    /// weiteres Telefon
    #[serde(rename = "AJ")]
    WeiteresTelefon,
    /// Handy
    #[serde(rename = "AL")]
    Handy,
}

/// marktrolle for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Marktrolle {
    /// Nachrichtenempfänger
    #[serde(rename = "MR")]
    Nachrichtenempfaenger,
    /// Dokumenten-/Nachrichtenaussteller bzw. -absender
    #[serde(rename = "MS")]
    DokumentenNachrichtenausstellerAbsender,
}

/// rollencodetyp for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Rollencodetyp {
    /// GS1
    #[serde(rename = "9")]
    Gs1,
    /// DE, BDEW (Bundesverband der Energie- und Wasserwirtschaft e.V.)
    #[serde(rename = "293")]
    DeBdewBundesverbandEnergieWasserwirtschaftEV,
}

/// dokumenttyp for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Dokumenttyp {
    /// MaBiS Meldung(en)
    #[serde(rename = "Z03")]
    MabisMeldungEn,
    /// WiM Meldung(en)
    #[serde(rename = "Z09")]
    WimMeldungEn,
    /// GPKE Meldung(en)
    #[serde(rename = "Z33")]
    GpkeMeldungEn,
    /// Redispatch Meldung(en)
    #[serde(rename = "Z49")]
    RedispatchMeldungEn,
    /// Beendigung einer Konfiguration
    #[serde(rename = "Z72")]
    BeendigungKonfiguration,
    /// Bestellung einer Konfiguration
    #[serde(rename = "Z73")]
    BestellungKonfiguration,
    /// EnFG Informationen
    #[serde(rename = "Z86")]
    EnfgInformationen,
}

/// acwQualifier for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AcwQualifier {
    /// Prüfidentifikator
    #[serde(rename = "Z13")]
    Pruefidentifikator,
    /// Referenznummer einer vorangegangenen Nachricht
    #[serde(rename = "ACW")]
    ReferenznummerVorangegangenenNachricht,
}

/// ebdNummer for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum EbdNummer {
    /// EBD Nr. E_0573
    #[serde(rename = "E_0573")]
    EbdNrE0573,
    /// EBD Nr. E_0576
    #[serde(rename = "E_0576")]
    EbdNrE0576,
    /// EBD Nr. E_0577
    #[serde(rename = "E_0577")]
    EbdNrE0577,
    /// EBD Nr. E_0584
    #[serde(rename = "E_0584")]
    EbdNrE0584,
    /// EBD Nr. E_0585
    #[serde(rename = "E_0585")]
    EbdNrE0585,
    /// EBD Nr. E_0586
    #[serde(rename = "E_0586")]
    EbdNrE0586,
    /// EBD Nr. E_0587
    #[serde(rename = "E_0587")]
    EbdNrE0587,
    /// EBD Nr. E_0588
    #[serde(rename = "E_0588")]
    EbdNrE0588,
    /// EBD Nr. E_0589
    #[serde(rename = "E_0589")]
    EbdNrE0589,
    /// EBD Nr. E_0595
    #[serde(rename = "E_0595")]
    EbdNrE0595,
    /// EBD Nr. E_0613
    #[serde(rename = "E_0613")]
    EbdNrE0613,
    /// EBD Nr. E_0616
    #[serde(rename = "E_0616")]
    EbdNrE0616,
    /// EBD Nr. E_0618
    #[serde(rename = "E_0618")]
    EbdNrE0618,
    /// EBD Nr. E_0619
    #[serde(rename = "E_0619")]
    EbdNrE0619,
    /// EBD Nr. E_0620
    #[serde(rename = "E_0620")]
    EbdNrE0620,
    /// EBD Nr. E_0626
    #[serde(rename = "E_0626")]
    EbdNrE0626,
    /// EBD Nr. E_0627
    #[serde(rename = "E_0627")]
    EbdNrE0627,
    /// EBD Nr. E_0628
    #[serde(rename = "E_0628")]
    EbdNrE0628,
    /// EBD Nr. E_0629
    #[serde(rename = "E_0629")]
    EbdNrE0629,
    /// EBD Nr. E_0630
    #[serde(rename = "E_0630")]
    EbdNrE0630,
    /// EBD Nr. E_0632
    #[serde(rename = "E_0632")]
    EbdNrE0632,
    /// EBD Nr. E_0633
    #[serde(rename = "E_0633")]
    EbdNrE0633,
    /// EBD Nr. E_0634
    #[serde(rename = "E_0634")]
    EbdNrE0634,
    /// EBD Nr. E_0635
    #[serde(rename = "E_0635")]
    EbdNrE0635,
}

/// pruefidentifikator for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Pruefidentifikator {
    /// GPKE / Bearbeitungsstandsmeldung
    #[serde(rename = "21047")]
    GpkeBearbeitungsstandsmeldung,
}

/// referenz for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Referenz {
    /// GPKE / Bearbeitungsstandsmeldung
    #[serde(rename = "21047")]
    GpkeBearbeitungsstandsmeldung,
}

/// statusCode for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum StatusCode {
    /// Änderung der Daten
    #[serde(rename = "Z47")]
    AenderungDaten,
    /// keine Änderung der Daten
    #[serde(rename = "Z48")]
    KeineAenderungDaten,
}

/// statusKategorie for PID 21047
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum StatusKategorie {
    /// Veränderungsstatus der Daten
    #[serde(rename = "Z43")]
    VeraenderungsstatusDaten,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AnsprechpartnerKontakt {
    /// Required (X). (an..3)
    pub funktion_code: Option<AnsprechpartnerFunktionCode>,
    /// Required (X). (an..256)
    pub name: Option<String>,
    /// Required (X). ()
    pub nummer: Option<String>,
}

/// Ansprechpartner for PID 21047 — Bearbeitungs-standsmeldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Ansprechpartner {
    /// Required (X (([939][146]) ∨ ([940][147])) ∧ [534]). (an..512)
    pub kommunikationsadresse: Option<String>,
    /// Required (X [1P0..1]). (an..3)
    pub kommunikationstyp: Option<Kommunikationstyp>,
    pub kontakt: Option<AnsprechpartnerKontakt>,
}

/// Freitext for PID 21047 — Bearbeitungs-standsmeldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Freitext {
    /// Required (X). (an..512)
    pub freitext1: Option<String>,
    /// Optional. (an..512)
    pub freitext2: Option<String>,
    /// Optional. (an..512)
    pub freitext3: Option<String>,
    /// Optional. (an..512)
    pub freitext4: Option<String>,
    /// Optional. (an..512)
    pub freitext5: Option<String>,
    /// Required (unknown). ()
    pub freitext_code: Option<String>,
    /// Required (X [903]). (an..6)
    pub sendungsposition: Option<String>,
    /// Required (unknown). ()
    pub text_funktion: Option<String>,
}

/// Marktteilnehmer for PID 21047 — Bearbeitungs-standsmeldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// Required (X). (an..3)
    pub marktrolle: Option<Marktrolle>,
    /// Required (X [27]). (an..35)
    pub rollencodenummer: Option<String>,
    /// Required (X). (an..3)
    pub rollencodetyp: Option<Rollencodetyp>,
}

/// Nachricht for PID 21047 — Bearbeitungs-standsmeldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Nachricht {
    /// Optional. (an..70)
    pub dokumentennummer: Option<String>,
    /// Optional. (an..3)
    pub dokumenttyp: Option<Dokumenttyp>,
    /// Optional. (an..35)
    pub erstellungsdatum: Option<String>,
}

/// Status for PID 21047 — Bearbeitungs-standsmeldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Status {
    /// Required (X). (an..3)
    pub acw_qualifier: Option<AcwQualifier>,
    /// Required (X [115] ∧ [20]). (an..17)
    pub ebd_nummer: Option<EbdNummer>,
    /// Required (X). (an..70)
    pub pruefidentifikator: Option<Pruefidentifikator>,
    /// Required (X [100] ⊻ [101]). (an..3)
    pub pruefschritt_code: Option<String>,
    /// Required (X). (an..70)
    pub referenz: Option<Referenz>,
    /// Required (X). (an..3)
    pub status_code: Option<StatusCode>,
    /// Required (X). (an..3)
    pub status_kategorie: Option<StatusKategorie>,
}

/// Vorgang for PID 21047 — Bearbeitungs-standsmeldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Vorgang {
    /// Required (unknown). ()
    pub loc_qualifier: Option<String>,
    /// Required (unknown). ()
    pub meldepunkt_id: Option<String>,
    /// Required (X [911]). (n..5)
    pub vorgangsnummer: Option<String>,
}

/// PID 21047 transaction — Bearbeitungs-standsmeldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
    pub freitext: Option<Freitext>,
    pub status: Option<Status>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub vorgang: Option<Vec<Vorgang>>,
}

/// PID 21047 message-level — Bearbeitungs-standsmeldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Message {
    pub ansprechpartner: Option<Ansprechpartner>,
    pub marktteilnehmer: Option<Marktteilnehmer>,
    pub nachricht: Option<Nachricht>,
}

/// Complete interchange for PID 21047 — Bearbeitungs-standsmeldung.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
