// 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 35004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AnsprechpartnerFunktionCode {
    /// Informationskontakt
    #[serde(rename = "IC")]
    Informationskontakt,
}

/// kommunikationstyp for PID 35004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Kommunikationstyp {
    /// 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,
}

/// lokationsQualifier for PID 35004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LokationsQualifier {
    /// Meldepunkt
    #[serde(rename = "172")]
    Meldepunkt,
}

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

/// rollencodetyp for PID 35004
#[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 35004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Dokumenttyp {
    /// Aufforderung zur Angebotsabgabe (Anfrage)
    #[serde(rename = "311")]
    AufforderungAngebotsabgabeAnfrage,
    /// Abrechnung des Messstellenbetriebs vom MSB an den LF
    #[serde(rename = "Z29")]
    AbrechnungMessstellenbetriebsMsbLf,
    /// Übermittlung von Werten an ESA
    #[serde(rename = "Z57")]
    UebermittlungWertenEsa,
    /// Bestellung eines Angebots einer Konfiguration
    #[serde(rename = "Z74")]
    BestellungAngebotsKonfiguration,
    /// Bestellung eines Angebots einer Konfiguration durch den LF
    #[serde(rename = "Z82")]
    BestellungAngebotsKonfigurationDurchLf,
    /// Bestellung eines Angebots Änderung der Technik der Lokation
    #[serde(rename = "Z93")]
    BestellungAngebotsAenderungTechnikLokation,
}

/// produktLeistungCode for PID 35004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ProduktLeistungCode {
    /// Änderung Konfiguration
    #[serde(rename = "Z55")]
    AenderungKonfiguration,
    /// Neukonfiguration
    #[serde(rename = "Z64")]
    Neukonfiguration,
}

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

/// qualifier for PID 35004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Qualifier {
    /// Prüfidentifikator
    #[serde(rename = "Z13")]
    Pruefidentifikator,
    /// Referenznummer des Vorgangs der Anmeldung nach WiM
    #[serde(rename = "Z41")]
    ReferenznummerVorgangsAnmeldungWim,
    /// Referenznummer der Nachricht der betroffenen Antwort auf Bestellung (Bestellb...
    #[serde(rename = "Z42")]
    ReferenznummerNachrichtBetroffenenAntwortBestellungBestellbestaetigung,
    /// Referenznummer des Vorgangs der betroffenen Antwort auf Bestellung (Bestellbe...
    #[serde(rename = "Z43")]
    ReferenznummerVorgangsBetroffenenAntwortBestellungBestellbestaetigung,
}

/// referenz for PID 35004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ReferenzReferenz {
    /// Anfrage einer Konfiguration
    #[serde(rename = "35004")]
    AnfrageKonfiguration,
}

/// handlungCode for PID 35004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum HandlungCode {
    /// Erforderliches Produkt Schaltzeitdefinitionen
    #[serde(rename = "Z64")]
    ErforderlichesProduktSchaltzeitdefinitionen,
    /// Erforderliches Produkt Leistungskurvendefinitionen
    #[serde(rename = "Z65")]
    ErforderlichesProduktLeistungskurvendefinitionen,
    /// Erforderliches Produkt Ad-hoc-Steuerkanal
    #[serde(rename = "Z66")]
    ErforderlichesProduktAdHocSteuerkanal,
    /// Erforderliches Messprodukt für Werte nach Typ 2 aus Backend
    #[serde(rename = "Z67")]
    ErforderlichesMessproduktWerteTyp2Backend,
    /// Erforderliches Produkt Konfigurationserlaubnis für Werte nach Typ 2 aus SMGW
    #[serde(rename = "Z68")]
    ErforderlichesProduktKonfigurationserlaubnisWerteTyp2Smgw,
}

/// merkmal.code for PID 35004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum VorgangZuordnungCode {
    /// selbstständige Änderungsmöglichkeit erforderlich
    #[serde(rename = "ZF7")]
    SelbststaendigeAenderungsmoeglichkeitErforderlich,
    /// selbstständige Änderungsmöglichkeit nicht erforderlich
    #[serde(rename = "ZF8")]
    SelbststaendigeAenderungsmoeglichkeitNichtErforderlich,
}

/// klassentyp for PID 35004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Klassentyp {
    /// Code der Schaltzeitdefinition
    #[serde(rename = "Z52")]
    CodeSchaltzeitdefinition,
}

#[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>,
}

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

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

/// Ansprechpartner for PID 35004 — Anfrage einer Konfiguration.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Ansprechpartner {
    /// Required (X (([939] [39]) ⊻ ([940] [40])) ∧ [514]). (an..512)
    pub kommunikationsadresse: Option<String>,
    /// Required (X [1P0..1]). (an..3)
    pub kommunikationstyp: Option<Kommunikationstyp>,
    pub kontakt: Option<AnsprechpartnerKontakt>,
}

/// Marktteilnehmer for PID 35004 — Anfrage einer Konfiguration.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// Required (X ([950] [502] ∧ ([20] ∨ [22])) ⊻ ([951] [503] ∧ ([22] ∨ [23])) ⊻ ([960] [510] ∧ ([20] ∨ [21] ∨ [22])) ⊻ ([961] [511] ∧ ([19] ∨ [20] ∨ [21]))). (an..35)
    pub lokations_code: Option<String>,
    /// Required (X). (an..3)
    pub lokations_qualifier: Option<LokationsQualifier>,
    /// Required (X). (an..3)
    pub marktrolle: Option<Marktrolle>,
    /// Required (X [10]). (an..35)
    pub rollencodenummer: Option<String>,
    /// Required (X). (an..3)
    pub rollencodetyp: Option<Rollencodetyp>,
    pub ansprechpartner: Option<Ansprechpartner>,
}

/// Nachricht for PID 35004 — Anfrage einer Konfiguration.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Nachricht {
    /// Required (unknown). ()
    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 (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 freitext_code: Option<String>,
    /// Required (unknown). ()
    pub freitext_funktion: Option<String>,
    /// Required (unknown). ()
    pub freitext_qualifier: Option<String>,
    /// Optional. (an..3)
    pub produkt_leistung_code: Option<ProduktLeistungCode>,
    /// Optional. (an..35)
    pub sperrdatum: Option<String>,
    /// Optional. (a1)
    pub uns_kennung: Option<UnsKennung>,
    /// Optional. (an..35)
    pub vertragsenddatum: Option<String>,
}

/// Referenz for PID 35004 — Anfrage einer Konfiguration.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Referenz {
    /// Required (X). (an..3)
    pub qualifier: Option<Qualifier>,
    /// Required (X). (an..70)
    pub referenz: Option<ReferenzReferenz>,
}

/// Vorgang for PID 35004 — Anfrage einer Konfiguration.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Vorgang {
    /// Required (X). (an..3)
    pub handlung_code: Option<HandlungCode>,
    /// Required (X [516]). (an..512)
    pub issuer_freitext2: Option<String>,
    /// Required (unknown). ()
    pub issuer_freitext3: Option<String>,
    /// Required (unknown). ()
    pub issuer_freitext4: Option<String>,
    /// Required (unknown). ()
    pub issuer_freitext5: Option<String>,
    /// Required (unknown). ()
    pub issuer_freitext_code: Option<String>,
    /// Required (unknown). ()
    pub issuer_textfunktion: Option<String>,
    /// Required (X [903]). (an..6)
    pub positionsnummer: Option<String>,
    pub produkt_identifikation: Option<VorgangProduktIdentifikation>,
    /// Required (X [516]). (an..512)
    pub subject_freitext2: Option<String>,
    /// Required (unknown). ()
    pub subject_freitext3: Option<String>,
    /// Required (unknown). ()
    pub subject_freitext4: Option<String>,
    /// Required (unknown). ()
    pub subject_freitext5: Option<String>,
    /// Required (unknown). ()
    pub subject_freitext_code: Option<String>,
    /// Required (unknown). ()
    pub subject_textfunktion: Option<String>,
    /// Required (unknown). ()
    pub uri_freitext_code: Option<String>,
    /// Required (unknown). ()
    pub uri_textfunktion: Option<String>,
    /// Required (X [515]). (an..512)
    pub zertifikatsaussteller: Option<String>,
    /// Required (X [515]). (an..512)
    pub zertifikatsnutzer: Option<String>,
    /// Required (X [515]). (an..512)
    pub zieladresse_ipv4: Option<String>,
    /// Required (X [516]). (an..512)
    pub zieladresse_ipv6: Option<String>,
}

/// VorgangZuordnung for PID 35004 — Anfrage einer Konfiguration.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct VorgangZuordnung {
    /// Required (X). ()
    pub dimension: Option<String>,
    /// Required (X). (an..3)
    pub klassentyp: Option<Klassentyp>,
    pub merkmal: Option<VorgangZuordnungMerkmal>,
    /// Required (X [906] ∧ [962]). (an..35)
    pub oberer_schwellwert: Option<String>,
    /// Required (X). ()
    pub unterer_schwellwert: Option<String>,
}

/// PID 35004 transaction — Anfrage einer Konfiguration.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub vorgang: Option<Vec<Vorgang>>,
    /// Required (X).
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub vorgang_zuordnung: Option<Vec<VorgangZuordnung>>,
}

/// PID 35004 message-level — Anfrage einer Konfiguration.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Message {
    #[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 35004 — Anfrage einer Konfiguration.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
