// 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 29001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum EbdReferenz {
    /// EBD Nr. E_0265
    #[serde(rename = "E_0265")]
    EbdNrE0265,
    /// EBD Nr. E_0504
    #[serde(rename = "E_0504")]
    EbdNrE0504,
    /// EBD Nr. E_0516
    #[serde(rename = "E_0516")]
    EbdNrE0516,
    /// EBD Nr. E_0520
    #[serde(rename = "E_0520")]
    EbdNrE0520,
    /// EBD Nr. E_0567
    #[serde(rename = "E_0567")]
    EbdNrE0567,
    /// EBD Nr. E_1008
    #[serde(rename = "E_1008")]
    EbdNrE1008,
    /// Codeliste Strom Nr. S_0109
    #[serde(rename = "S_0109")]
    CodelisteStromNrS0109,
}

/// dokumenttyp for PID 29001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DokumentDokumenttyp {
    /// Handelsrechnung
    #[serde(rename = "380")]
    Handelsrechnung,
}

/// kommunikationstyp for PID 29001
#[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,
}

/// kontaktFunktion for PID 29001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum KontaktFunktion {
    /// Informationsstelle
    #[serde(rename = "IC")]
    Informationskontakt,
}

/// marktrolle for PID 29001
#[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 29001
#[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 29001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum NachrichtDokumenttyp {
    /// Belastungsanzeige
    #[serde(rename = "456")]
    Belastungsanzeige,
    /// MSCONS, die eine INVOIC unterstützt
    #[serde(rename = "739")]
    MsconsInvoicUnterstuetzt,
}

/// pruefidentifikator for PID 29001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Pruefidentifikator {
    /// Prüfidentifikator
    #[serde(rename = "29001")]
    Pruefidentifikator,
    /// Prüfidentifikator
    #[serde(rename = "29002")]
    Pruefidentifikator2,
}

/// waehrungCode for PID 29001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum WaehrungCode {
    /// Euro
    #[serde(rename = "EUR")]
    Euro,
}

/// waehrungQualifier for PID 29001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum WaehrungQualifier {
    /// Währung der Rechnung
    #[serde(rename = "4")]
    WaehrungRechnung,
}

/// waehrungsverwendung for PID 29001
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Waehrungsverwendung {
    /// Referenzwährung
    #[serde(rename = "2")]
    Referenzwaehrung,
}

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

/// Abweichung for PID 29001 — Ablehnung REMADV.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Abweichung {
    /// Required (unknown). ()
    pub aperak_nachrichtennummer: Option<String>,
    /// Required (unknown). ()
    pub datenaustauschreferenz: Option<String>,
    /// Required (X [492] ∧ [23] ∧ [24]). (an..6)
    pub ebd_referenz: Option<EbdReferenz>,
    /// Required (unknown). ()
    pub empfangsbestaetigung_ref: Option<String>,
    /// Required (unknown). ()
    pub freitext: Option<String>,
    /// Required (unknown). ()
    pub freitext_funktion: Option<String>,
    /// Required (unknown). ()
    pub freitext_qualifier: Option<String>,
    /// Required (unknown). ()
    pub freitext_referenz: Option<String>,
    /// Required (unknown). ()
    pub nachrichtennummer: Option<String>,
    /// Required (X). (an..3)
    pub pruefschritt_code: Option<String>,
    /// Required (unknown). ()
    pub referenz_code: Option<String>,
    /// Required (unknown). ()
    pub referenz_funktion: Option<String>,
}

/// Dokument for PID 29001 — Ablehnung REMADV.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Dokument {
    /// Required (X [505]). (an..70)
    pub dokumentennummer: Option<String>,
    /// Required (X). (an..3)
    pub dokumenttyp: Option<DokumentDokumenttyp>,
    /// Required (X [930]). (n..35)
    pub faelliger_betrag: Option<String>,
}

/// Marktteilnehmer for PID 29001 — Ablehnung REMADV.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// Required (X (([939][21]) ∨ ([940][22])) ∧ [508]). (an..512)
    pub kommunikationsadresse: Option<String>,
    /// Required (X [1P0..1]). (an..3)
    pub kommunikationstyp: Option<Kommunikationstyp>,
    pub kontakt: Option<MarktteilnehmerKontakt>,
    /// Required (X). (an..3)
    pub kontakt_funktion: Option<KontaktFunktion>,
    /// Required (X). (an..3)
    pub marktrolle: Option<Marktrolle>,
    /// Required (X). (an..35)
    pub rollencodenummer: Option<String>,
    /// Required (X). (an..3)
    pub rollencodetyp: Option<Rollencodetyp>,
}

/// Nachricht for PID 29001 — Ablehnung REMADV.
#[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<NachrichtDokumenttyp>,
    /// Optional. (an..35)
    pub erstellungsdatum: Option<String>,
    /// Optional. (an..70)
    pub pruefidentifikator: Option<Pruefidentifikator>,
    /// Optional. (an..3)
    pub waehrung_code: Option<WaehrungCode>,
    /// Optional. (an..3)
    pub waehrung_qualifier: Option<WaehrungQualifier>,
    /// Optional. (an..3)
    pub waehrungsverwendung: Option<Waehrungsverwendung>,
}

/// PID 29001 transaction — Ablehnung REMADV.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
    pub abweichung: Option<Abweichung>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub dokument: Option<Vec<Dokument>>,
}

/// PID 29001 message-level — Ablehnung REMADV.
#[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>,
}

/// Complete interchange for PID 29001 — Ablehnung REMADV.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
