// 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;

/// textReferenz for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum TextReferenz {
    /// Ankündigung, dass per MSCONS noch der Zählerstand übermittelt wird
    #[serde(rename = "Z01")]
    AnkuendigungDassPerMsconsZaehlerstandUebermittelt,
}

/// textbezug for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Textbezug {
    /// Zusätzliche Informationen (für allgemeine Hinweise)
    #[serde(rename = "ACB")]
    ZusaetzlicheInformationenAllgemeineHinweise,
    /// Information zum Zählerstand
    #[serde(rename = "ADM")]
    InformationZaehlerstand,
}

/// anredeCode for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AnredeCode {
    /// Struktur von Personennamen
    #[serde(rename = "Z01")]
    StrukturPersonennamen,
    /// Struktur der Firmenbezeichnung
    #[serde(rename = "Z02")]
    StrukturFirmenbezeichnung,
}

/// partnerrolle for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Partnerrolle {
    /// Lieferanschrift
    #[serde(rename = "DP")]
    Lieferanschrift,
}

/// kommunikationsart for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Kommunikationsart {
    /// Elektronische Post
    #[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,
}

/// kontaktfunktion for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Kontaktfunktion {
    /// Informationskontakt
    #[serde(rename = "IC")]
    Informationskontakt,
}

/// konzession.merkmal for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum KonzessionDatenMerkmal {
    /// Konzessionsabgabe
    #[serde(rename = "Z08")]
    Konzessionsabgabe,
}

/// kavGruppe for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum KavGruppe {
    /// für alle konzessionsvertraglichen Sonderregelungen, die nicht in die Systemat...
    #[serde(rename = "KAS")]
    AlleKonzessionsvertraglichenSonderregelungenNichtSystematikKav,
    /// Sondervertragskunden < 1 kV nach § 2 (7) und > 1 kV, Preis nach § 2 (3) (für ...
    #[serde(rename = "SA")]
    Sondervertragskunden1KvParagraph271KvPreisParagraph23Strom011Ct,
    /// Kennzeichnung, dass ein abweichender Preis für Sondervertragskunden vorliegt
    #[serde(rename = "SAS")]
    KennzeichnungDassAbweichenderPreisSondervertragskundenVorliegt,
    /// Kennzeichnung, dass ein abweichender Preis für Tarifkunden vorliegt
    #[serde(rename = "TAS")]
    KennzeichnungDassAbweichenderPreisTarifkundenVorliegt,
    /// für Gas nach KAV § 2 (2) 2a bei ausschließlicher Nutzung zum Kochen und Warmw...
    #[serde(rename = "TK")]
    GasKavParagraph222aAusschliesslicherNutzungKochenWarmwassererzeugung,
    /// Kennzeichnung, wenn nach KAV § 2 (2) 2a ein anderer Preis zu verwenden ist
    #[serde(rename = "TKS")]
    KennzeichnungKavParagraph222aAndererPreisVerwenden,
}

/// merkmal.code for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LastprofilDatenZuordnungCode {
    /// synthetisches Verfahren
    #[serde(rename = "E01")]
    SynthetischesVerfahren,
    /// analytisches Verfahren
    #[serde(rename = "Z10")]
    AnalytischesVerfahren,
}

/// merkmal.codepflege for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LastprofilDatenZuordnungCodepflege {
    /// Vergeben vom Händler (hier Netzbetreiber)
    #[serde(rename = "89")]
    VergebenHaendlerHierNetzbetreiber,
    /// DE, BDEW (Bundesverband der Energie- und Wasserwirtschaft e.V.)
    #[serde(rename = "293")]
    DeBdewBundesverbandEnergieWasserwirtschaftEV,
}

/// merkmal.klasse for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LastprofilDatenZuordnungKlasse {
    /// Lastprofil
    #[serde(rename = "Z12")]
    Lastprofil,
}

/// merkmal.qualifier for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LastprofilDatenZuordnungQualifier {
    /// Dieser Code ist in der Anwendung durch einen zulässigen Code zu ersetzen!
    #[serde(rename = "XYZ")]
    DieserCodeAnwendungDurchZulaessigenCodeNbGueltigenListe,
}

/// sg10.bilanzierungsgebiet.qualifier for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum MarktlokationZuordnungSg10Qualifier {
    /// 1. Priorität
    #[serde(rename = "Z75")]
    Code1Prioritaet,
    /// 2. Priorität
    #[serde(rename = "Z76")]
    Code2Prioritaet,
    /// 3. Priorität
    #[serde(rename = "Z77")]
    Code3Prioritaet,
    /// 4. Priorität
    #[serde(rename = "Z78")]
    Code4Prioritaet,
    /// 5. Priorität
    #[serde(rename = "Z79")]
    Code5Prioritaet,
    /// Netznutzungsvertrag
    #[serde(rename = "Z74")]
    Netznutzungsvertrag,
    /// Zahlung der Netznutzung
    #[serde(rename = "Z73")]
    ZahlungNetznutzung,
}

/// sg10.merkmal.klasse for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum MarktlokationZuordnungSg10Klasse {
    /// Bilanzkreis
    #[serde(rename = "Z19")]
    Bilanzkreis,
}

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

/// rollencodetyp for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Rollencodetyp {
    /// GS1
    #[serde(rename = "9")]
    Gs1,
    /// DE, DVGW Service & Consult GmbH
    #[serde(rename = "332")]
    DeDvgwServiceConsultGmbh,
}

/// befristungGrund for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum BefristungGrund {
    /// Kunde verlässt oder bezieht eine schon bestehende Marktlokation
    #[serde(rename = "E01")]
    KundeVerlaesstBestehendeMarktlokation,
    /// Kunde bezieht erstmals eine Marktlokation (z. B. Neubau)
    #[serde(rename = "E02")]
    KundeBeziehtErstmalsMarktlokationZBNeubau,
    /// - Kunde bleibt an der Marktlokation, hat nur den Marktpartner gewechselt
    #[serde(rename = "E03")]
    KundeBleibtMarktlokationMarktpartnerGewechseltMarktpartnerKunden,
}

/// marktlokationRef for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum MarktlokationRef {
    /// GeLi Gas / Anmeldung NN
    #[serde(rename = "44001")]
    GeliGasAnmeldungNn,
}

/// pruefidentifikator for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Pruefidentifikator {
    /// GeLi Gas / Anmeldung NN
    #[serde(rename = "44001")]
    GeliGasAnmeldungNn,
}

/// transaktionsgrund for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Transaktionsgrund {
    /// Kunde verlässt oder bezieht eine schon bestehende Marktlokation
    #[serde(rename = "E01")]
    KundeVerlaesstBestehendeMarktlokation,
    /// Kunde bezieht erstmals eine Marktlokation (z. B. Neubau)
    #[serde(rename = "E02")]
    KundeBeziehtErstmalsMarktlokationZBNeubau,
    /// - Kunde bleibt an der Marktlokation, hat nur den Marktpartner gewechselt
    #[serde(rename = "E03")]
    KundeBleibtMarktlokationMarktpartnerGewechseltMarktpartnerKunden,
}

/// geraetnummer.qualifier for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ZaehlerZuordnungQualifier {
    /// Gerätenummer
    #[serde(rename = "Z30")]
    Geraetenummer,
}

/// merkmal.code for PID 44001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ZaehlerZuordnungCode {
    /// Zählertyp
    #[serde(rename = "E13")]
    Zaehlertyp,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GeschaeftspartnerReferenz {
    /// Required (X [951]). (an..70)
    pub id: Option<String>,
}

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

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct KonzessionDatenKonzession {
    /// Required (unknown). ()
    pub dimension: Option<String>,
    /// Required (unknown). ()
    pub klasse: Option<String>,
    /// Required (X). (an..17)
    pub merkmal: Option<KonzessionDatenMerkmal>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LastprofilDatenZuordnungMerkmal {
    /// Required (X). (an..17)
    pub code: Option<LastprofilDatenZuordnungCode>,
    /// Required (unknown). ()
    pub code_codepflege: Option<String>,
    /// Required (unknown). ()
    pub codeliste: Option<String>,
    /// Required (X). (an..3)
    pub codepflege: Option<LastprofilDatenZuordnungCodepflege>,
    /// Required (unknown). ()
    pub dimension: Option<String>,
    /// Required (X). (an..3)
    pub klasse: Option<LastprofilDatenZuordnungKlasse>,
    /// Required (X). (an..3)
    pub qualifier: Option<LastprofilDatenZuordnungQualifier>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarktlokationZuordnungSg10Bilanzierungsgebiet {
    /// Required (X [66]). (an..3)
    pub qualifier: Option<MarktlokationZuordnungSg10Qualifier>,
    /// Required (unknown). ()
    pub wert: Option<String>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarktlokationZuordnungSg10Marktgebiet {
    /// Required (X [66]). (an..3)
    pub qualifier: Option<MarktlokationZuordnungSg10Qualifier>,
    /// Required (unknown). ()
    pub wert: Option<String>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarktlokationZuordnungSg10Merkmal {
    /// Required (X). (an..17)
    pub code: Option<String>,
    /// Required (unknown). ()
    pub codeliste: Option<String>,
    /// Required (unknown). ()
    pub dimension: Option<String>,
    /// Required (X). (an..3)
    pub klasse: Option<MarktlokationZuordnungSg10Klasse>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarktlokationZuordnungSg10Regelzone {
    /// Required (X [66]). (an..3)
    pub qualifier: Option<MarktlokationZuordnungSg10Qualifier>,
    /// Required (unknown). ()
    pub wert: Option<String>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarktlokationZuordnungSg10 {
    pub bilanzierungsgebiet: Option<MarktlokationZuordnungSg10Bilanzierungsgebiet>,
    pub marktgebiet: Option<MarktlokationZuordnungSg10Marktgebiet>,
    pub merkmal: Option<MarktlokationZuordnungSg10Merkmal>,
    pub regelzone: Option<MarktlokationZuordnungSg10Regelzone>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ZaehlerReferenz {
    /// Required (X). ()
    pub id: Option<String>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ZaehlerZuordnungGeraetnummer {
    /// Required (unknown). ()
    pub codeliste_code: Option<String>,
    /// Required (unknown). ()
    pub codepflege: Option<String>,
    /// Required (X). (an..35)
    pub nummer: Option<String>,
    /// Required (X). (an..3)
    pub qualifier: Option<ZaehlerZuordnungQualifier>,
    /// Optional. (an..35)
    pub teil2: Option<String>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ZaehlerZuordnungMerkmal {
    /// Required (X). (an..17)
    pub code: Option<ZaehlerZuordnungCode>,
    /// Required (unknown). ()
    pub dimension: Option<String>,
    /// Required (unknown). ()
    pub klasse: Option<String>,
}

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ZaehlerZuordnungVolumenerfassung {
    /// Required (unknown). ()
    pub codeliste_code: Option<String>,
    /// Required (unknown). ()
    pub codepflege: Option<String>,
    /// Required (X). (an..3)
    pub qualifier: Option<ZaehlerZuordnungQualifier>,
    /// Required (X). (an..35)
    pub wert: Option<String>,
}

/// Map key for Geschaeftspartner instances.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
pub enum GeschaeftspartnerKey {
    #[serde(rename = "DP")]
    Dp,
    #[serde(rename = "Z04")]
    Z04,
    #[serde(rename = "Z05")]
    Z05,
    #[serde(rename = "Z09")]
    Z09,
}

impl std::fmt::Display for GeschaeftspartnerKey {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Self::Dp => write!(f, "DP"),
            Self::Z04 => write!(f, "Z04"),
            Self::Z05 => write!(f, "Z05"),
            Self::Z09 => write!(f, "Z09"),
        }
    }
}

/// Map key for Marktteilnehmer instances.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
pub enum MarktteilnehmerKey {
    /// Dokumenten-/Nachrichtenaussteller bzw. -absender
    #[serde(rename = "MS")]
    Ms,
    /// Nachrichtenempfänger
    #[serde(rename = "MR")]
    Mr,
}

impl std::fmt::Display for MarktteilnehmerKey {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Self::Ms => write!(f, "MS"),
            Self::Mr => write!(f, "MR"),
        }
    }
}

/// Freitext for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Freitext {
    /// Required (X). (an..512)
    pub text: Option<String>,
    /// Required (X). (an..17)
    pub text_referenz: Option<TextReferenz>,
    /// Optional. (an..512)
    pub text_zeile2: Option<String>,
    /// Optional. (an..512)
    pub text_zeile3: Option<String>,
    /// Optional. (an..512)
    pub text_zeile4: Option<String>,
    /// Optional. (an..512)
    pub text_zeile5: Option<String>,
    /// Required (X). (an..3)
    pub textbezug: Option<Textbezug>,
    /// Required (unknown). ()
    pub textfunktion: Option<String>,
}

/// GemeindeDaten for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct GemeindeDaten {
    /// Required (X [902] ∧ [930] ∧ [938]). (an..35)
    pub gemeinderabatt_prozent: Option<String>,
}

/// Geschaeftspartner for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Geschaeftspartner {
    /// Optional. (an..35)
    pub adresszusatz: Option<String>,
    /// Optional. (an..70)
    pub anrede: Option<String>,
    /// Required (X). (an..3)
    pub anrede_code: Option<AnredeCode>,
    /// Required (Soll [165]). ()
    pub codelist_code: Option<String>,
    /// Required (Soll [165]). ()
    pub codepflege_code: Option<String>,
    /// Required (Soll [165]). ()
    pub geschaeftspartner_id: Option<String>,
    /// Optional. (an..35)
    pub hausnummer: Option<String>,
    /// Required (X [951]). (an..70)
    pub kundennummer_alt_lf: Option<String>,
    /// Required (X [951]). (an..70)
    pub kundennummer_lf: Option<String>,
    /// Required (X). (an..3)
    pub land: Option<String>,
    /// Required (X). (an..70)
    pub name1: Option<String>,
    /// Optional. (an..70)
    pub name2: Option<String>,
    /// Optional. (an..70)
    pub name_zeile4: Option<String>,
    /// Optional. (an..70)
    pub namenszusatz1: Option<String>,
    /// Required (X). (an..35)
    pub ort: Option<String>,
    /// Required (X). (an..3)
    pub partnerrolle: Option<Partnerrolle>,
    /// Required (X). (an..17)
    pub postleitzahl: Option<String>,
    pub referenz: Option<GeschaeftspartnerReferenz>,
    /// Required (Soll [165]). ()
    pub region: Option<String>,
    /// Required (S [165] M [212]). (an..35)
    pub strasse: Option<String>,
    /// Optional. (an..35)
    pub strasse_zusatz: Option<String>,
    /// Required (K). (an..35)
    pub zusatzinfo: Option<String>,
    /// Optional. (an..35)
    pub zusatzinfo_zeile2: Option<String>,
    /// Optional. (an..35)
    pub zusatzinfo_zeile3: Option<String>,
    /// Optional. (an..35)
    pub zusatzinfo_zeile4: Option<String>,
    /// Optional. (an..35)
    pub zusatzinfo_zeile5: Option<String>,
}

/// Kontakt for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Kontakt {
    /// Required (X [1P0..1]). (an..3)
    pub kommunikationsart: Option<Kommunikationsart>,
    /// Required (X). (an..512)
    pub kommunikationsnummer: Option<String>,
    pub kontakt: Option<KontaktKontakt>,
    /// Required (X). (an..3)
    pub kontaktfunktion: Option<Kontaktfunktion>,
}

/// KonzessionDaten for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct KonzessionDaten {
    /// Required (Soll [912] ∧ [902] [128] ∧ [129]). (an..35)
    pub kav_betrag: Option<String>,
    /// Required (unknown). ()
    pub kav_codeliste_code: Option<String>,
    /// Required (X). (an..3)
    pub kav_gruppe: Option<KavGruppe>,
    /// Required (Kann). (an..35)
    pub kav_zusatzinfo: Option<String>,
    pub konzession: Option<KonzessionDatenKonzession>,
    /// Required (Soll [127]). ()
    pub obis_kennzahl_ref: Option<String>,
}

/// LastprofilDaten for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct LastprofilDaten {
}

/// LastprofilDatenZuordnung for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct LastprofilDatenZuordnung {
    pub merkmal: Option<LastprofilDatenZuordnungMerkmal>,
    /// Required (unknown). ()
    pub zugeordneter_mp: Option<String>,
}

/// Marktlokation for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktlokation {
    /// Required (X [902] ∧ [937]). (an..35)
    pub jahresmenge_gesamt: Option<String>,
    /// Required (X [902] ∧ [937]). (an..35)
    pub kundenwert: Option<String>,
}

/// MarktlokationZuordnung for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct MarktlokationZuordnung {
    pub sg10: Option<Vec<MarktlokationZuordnungSg10>>,
}

/// Marktteilnehmer for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// Required (unknown). ()
    pub codeliste_code: Option<String>,
    /// Required (X). (an..3)
    pub marktrolle: Option<Marktrolle>,
    /// Required (X). (an..35)
    pub rollencodenummer: Option<String>,
    /// Required (X). (an..3)
    pub rollencodetyp: Option<Rollencodetyp>,
    pub kontakt: Option<Kontakt>,
}

/// Messlokation for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Messlokation {
    /// Required (X [953]). (an..35)
    pub meldepunkt_id: Option<String>,
}

/// Nachricht for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Nachricht {
    /// Required (X [931] [494]). (an..35)
    pub erstellungsdatum: Option<String>,
    /// Optional. ()
    pub nachrichtennummer: Option<String>,
    /// Optional. ()
    pub nachrichtentyp: Option<String>,
}

/// Prozessdaten for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Prozessdaten {
    /// Required (X). (an..3)
    pub befristung_grund: Option<BefristungGrund>,
    /// Required (unknown). ()
    pub befristung_status_code: Option<String>,
    /// Required (X [UB2]). (an..35)
    pub gueltig_ab: Option<String>,
    /// Required (X [UB2]). (an..35)
    pub gueltig_bis: Option<String>,
    /// Required (X). (an..70)
    pub marktlokation_ref: Option<MarktlokationRef>,
    /// Required (X). (an..70)
    pub pruefidentifikator: Option<Pruefidentifikator>,
    /// Required (unknown). ()
    pub status_code: Option<String>,
    /// Required (X). (an..3)
    pub transaktionsgrund: Option<Transaktionsgrund>,
    /// Required (X). (an..35)
    pub vorgang_id: Option<String>,
}

/// Zaehler for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Zaehler {
    pub referenz: Option<ZaehlerReferenz>,
}

/// ZaehlerZuordnung for PID 44001 — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct ZaehlerZuordnung {
    pub geraetnummer: Option<ZaehlerZuordnungGeraetnummer>,
    pub merkmal: Option<ZaehlerZuordnungMerkmal>,
    pub volumenerfassung: Option<ZaehlerZuordnungVolumenerfassung>,
}

/// PID 44001 transaction — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
    pub freitext: Option<Freitext>,
    /// Required (X).
    pub gemeinde_daten: Option<GemeindeDaten>,
    /// Required (Soll [165]).
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_map_or_vec")]
    pub geschaeftspartner: Option<BTreeMap<GeschaeftspartnerKey, Geschaeftspartner>>,
    /// Required (Soll [127]).
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub konzession_daten: Option<Vec<KonzessionDaten>>,
    /// Required (X).
    pub lastprofil_daten: Option<LastprofilDaten>,
    pub lastprofil_daten_zuordnung: Option<LastprofilDatenZuordnung>,
    /// Required (X).
    pub marktlokation: Option<Marktlokation>,
    pub marktlokation_zuordnung: Option<MarktlokationZuordnung>,
    /// Required (Soll [165] ∧ (([2061] ∧ [583]) ∨ [584])).
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub messlokation: Option<Vec<Messlokation>>,
    pub prozessdaten: Option<Prozessdaten>,
    /// Required (X).
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub zaehler: Option<Vec<Zaehler>>,
    pub zaehler_zuordnung: Option<ZaehlerZuordnung>,
}

/// PID 44001 message-level — Anmeldung NN.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Message {
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_map_or_vec")]
    pub marktteilnehmer: Option<BTreeMap<MarktteilnehmerKey, Marktteilnehmer>>,
    pub nachricht: Option<Nachricht>,
}

/// Complete interchange for PID 44001 — Anmeldung NN.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
