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

/// ebdReferenz for PID 19129
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum EbdReferenz {
    /// EBD Nr. E_0468
    #[serde(rename = "E_0468")]
    EbdNrE0468,
    /// EBD Nr. E_1006
    #[serde(rename = "E_1006")]
    EbdNrE1006,
}

/// marktrolle for PID 19129
#[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 19129
#[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,
    /// DE, DVGW Service & Consult GmbH
    #[serde(rename = "332")]
    DeDvgwServiceConsultGmbh,
}

/// dokumenttyp for PID 19129
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Dokumenttyp {
    /// Prozessdatenbericht
    #[serde(rename = "7")]
    Prozessdatenbericht,
    /// Zeitreihen im Rahmen der Bilanzkreisabrechnung
    #[serde(rename = "BK")]
    ZeitreihenRahmenBilanzkreisabrechnung,
    /// Geräteübernahme
    #[serde(rename = "Z10")]
    Geraeteuebernahme,
    /// Weiterverpflichtung zum Betrieb der Messlokation
    #[serde(rename = "Z11")]
    WeiterverpflichtungBetriebMesslokation,
    /// Änderung der Technik der Lokation
    #[serde(rename = "Z12")]
    AenderungTechnikLokation,
    /// Gerätewechselabsicht
    #[serde(rename = "Z13")]
    Geraetewechselabsicht,
    /// Stammdaten der Markt- oder Messlokation
    #[serde(rename = "Z14")]
    StammdatenMarktMesslokation,
    /// Allokationsliste (MMMA)
    #[serde(rename = "Z24")]
    AllokationslisteMmma,
    /// Energiemenge und Leistungsmaximum
    #[serde(rename = "Z28")]
    EnergiemengeLeistungsmaximum,
    /// Abrechnung des Messstellenbetriebs vom MSB an den LF
    #[serde(rename = "Z29")]
    AbrechnungMessstellenbetriebsMsbLf,
    /// Änderung Prognosegrundlage
    #[serde(rename = "Z30")]
    AenderungPrognosegrundlage,
    /// Änderung Gerätekonfiguration
    #[serde(rename = "Z31")]
    AenderungGeraetekonfiguration,
    /// Reklamation von Werten
    #[serde(rename = "Z34")]
    ReklamationWerten,
    /// Lastgang Marktlokation, Tranche
    #[serde(rename = "Z48")]
    LastgangMarktlokationTranche,
    /// Sperrung
    #[serde(rename = "Z51")]
    Sperrung,
    /// Entsperrung
    #[serde(rename = "Z52")]
    Entsperrung,
    /// Reklamation der Übersicht der Definitionen oder einer Definition
    #[serde(rename = "Z55")]
    ReklamationUebersichtDefinitionenDefinition,
    /// Änderung individueller Konfiguration
    #[serde(rename = "Z56")]
    AenderungIndividuellerKonfiguration,
    /// Übermittlung von Werten an ESA
    #[serde(rename = "Z57")]
    UebermittlungWertenEsa,
    /// Änderung
    #[serde(rename = "Z68")]
    Aenderung,
    /// Beendigung einer Konfiguration
    #[serde(rename = "Z72")]
    BeendigungKonfiguration,
    /// Bestellung einer Konfiguration
    #[serde(rename = "Z73")]
    BestellungKonfiguration,
    /// Bestellung eines Angebots einer Konfiguration
    #[serde(rename = "Z74")]
    BestellungAngebotsKonfiguration,
    /// Reklamation einer Konfiguration
    #[serde(rename = "Z76")]
    ReklamationKonfiguration,
    /// Bestellung Änderung Abrechnungsdaten
    #[serde(rename = "Z91")]
    BestellungAenderungAbrechnungsdaten,
    /// Bestellung eines Angebots Änderung der Technik der Lokation
    #[serde(rename = "Z93")]
    BestellungAngebotsAenderungTechnikLokation,
}

/// unsKennung for PID 19129
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum UnsKennung {
    /// Trennung von Positions- und Summenteil
    #[serde(rename = "S")]
    TrennungPositionsSummenteil,
}

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

/// Antwortkategorie for PID 19129 — Ablehnung Stornierung Sperr-/Entsperr- auftrag.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Antwortkategorie {
    /// Required (X [18]). (an..3)
    pub antwort_code: Option<String>,
    /// Required (X [492]). (an..6)
    pub ebd_referenz: Option<EbdReferenz>,
    /// Required (unknown). ()
    pub freitext1: Option<String>,
    /// Required (unknown). ()
    pub freitext2: Option<String>,
    /// Required (unknown). ()
    pub freitext3: Option<String>,
    /// Required (unknown). ()
    pub freitext4: Option<String>,
    /// Required (unknown). ()
    pub freitext5: Option<String>,
    /// Required (unknown). ()
    pub text_funktion: Option<String>,
    /// Required (unknown). ()
    pub text_qualifier: Option<String>,
    /// Required (unknown). ()
    pub text_referenz: Option<String>,
}

/// Marktteilnehmer for PID 19129 — Ablehnung Stornierung Sperr-/Entsperr- auftrag.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// Required (unknown). ()
    pub anrede: Option<String>,
    /// Required (unknown). ()
    pub hausnummer: Option<String>,
    /// Required (unknown). ()
    pub land: Option<String>,
    /// Required (X). (an..3)
    pub marktrolle: Option<Marktrolle>,
    /// Required (unknown). ()
    pub nachname: Option<String>,
    /// Required (unknown). ()
    pub name_format_code: Option<String>,
    /// Required (unknown). ()
    pub namenformat_code: Option<String>,
    /// Required (unknown). ()
    pub ort: Option<String>,
    /// Required (unknown). ()
    pub postleitzahl: Option<String>,
    /// Required (unknown). ()
    pub region: Option<String>,
    /// Required (X). (an..35)
    pub rollencodenummer: Option<String>,
    /// Required (X). (an..3)
    pub rollencodetyp: Option<Rollencodetyp>,
    /// Required (unknown). ()
    pub strasse: Option<String>,
    /// Required (unknown). ()
    pub strasse2: Option<String>,
    /// Required (unknown). ()
    pub strasse4: Option<String>,
    /// Required (unknown). ()
    pub titel: Option<String>,
    /// Required (unknown). ()
    pub vorname: Option<String>,
    /// Required (unknown). ()
    pub zusatzinfo: Option<String>,
    /// Required (unknown). ()
    pub zusatzinfo2: Option<String>,
    /// Required (unknown). ()
    pub zusatzinfo3: Option<String>,
    /// Required (unknown). ()
    pub zusatzinfo4: Option<String>,
    /// Required (unknown). ()
    pub zusatzinfo5: Option<String>,
}

/// Nachricht for PID 19129 — Ablehnung Stornierung Sperr-/Entsperr- auftrag.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Nachricht {
    /// Required (Muss). ()
    pub abonnement: Option<String>,
    /// Optional. (an..35)
    pub auftragsdatum: Option<String>,
    /// Required (Muss). ()
    pub beschreibungsformat: Option<String>,
    /// Optional. (an..70)
    pub dokumentennummer: Option<String>,
    /// Optional. (an..3)
    pub dokumenttyp: Option<Dokumenttyp>,
    /// Optional. (an..35)
    pub erstellungsdatum: Option<String>,
    /// Required (Muss). ()
    pub geldbetrag: Option<String>,
    /// Required (Muss). ()
    pub geldbetrag_qualifier: Option<String>,
    /// Optional. (an..35)
    pub sperrdatum: Option<String>,
    /// Optional. (a1)
    pub uns_kennung: Option<UnsKennung>,
    /// Optional. (an..35)
    pub vertragsenddatum: Option<String>,
}

/// Referenz for PID 19129 — Ablehnung Stornierung Sperr-/Entsperr- auftrag.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Referenz {
    /// Required (X). (an..3)
    pub qualifier: Option<Qualifier>,
    /// Required (X ([24] ∧ [533]) ⊻ ([25] ∧ [534])). (an..70)
    pub referenz: Option<String>,
}

/// PID 19129 transaction — Ablehnung Stornierung Sperr-/Entsperr- auftrag.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
}

/// PID 19129 message-level — Ablehnung Stornierung Sperr-/Entsperr- auftrag.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Message {
    pub antwortkategorie: Option<Antwortkategorie>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub marktteilnehmer: Option<Vec<Marktteilnehmer>>,
    pub nachricht: Option<Nachricht>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub referenz: Option<Vec<Referenz>>,
}

/// Complete interchange for PID 19129 — Ablehnung Stornierung Sperr-/Entsperr- auftrag.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
