// 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 33002
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum EbdReferenz {
    /// EBD Nr. E_0243
    #[serde(rename = "E_0243")]
    EbdNrE0243,
    /// EBD Nr. E_0259
    #[serde(rename = "E_0259")]
    EbdNrE0259,
    /// EBD Nr. E_0261
    #[serde(rename = "E_0261")]
    EbdNrE0261,
    /// EBD Nr. E_0267
    #[serde(rename = "E_0267")]
    EbdNrE0267,
    /// EBD Nr. E_0272
    #[serde(rename = "E_0272")]
    EbdNrE0272,
    /// EBD Nr. E_0275
    #[serde(rename = "E_0275")]
    EbdNrE0275,
    /// EBD Nr. E_0459
    #[serde(rename = "E_0459")]
    EbdNrE0459,
    /// EBD Nr. E_0503
    #[serde(rename = "E_0503")]
    EbdNrE0503,
    /// EBD Nr. E_0505
    #[serde(rename = "E_0505")]
    EbdNrE0505,
    /// EBD Nr. E_0506
    #[serde(rename = "E_0506")]
    EbdNrE0506,
    /// EBD Nr. E_0518
    #[serde(rename = "E_0518")]
    EbdNrE0518,
    /// EBD Nr. E_0522
    #[serde(rename = "E_0522")]
    EbdNrE0522,
    /// EBD Nr. E_0569
    #[serde(rename = "E_0569")]
    EbdNrE0569,
    /// EBD Nr. E_0804
    #[serde(rename = "E_0804")]
    EbdNrE0804,
    /// EBD Nr. E_0806
    #[serde(rename = "E_0806")]
    EbdNrE0806,
    /// EBD Nr. E_1007
    #[serde(rename = "E_1007")]
    EbdNrE1007,
    /// EBD Nr. E_1009
    #[serde(rename = "E_1009")]
    EbdNrE1009,
    /// EBD Nr. E_1010
    #[serde(rename = "E_1010")]
    EbdNrE1010,
    /// Codeliste Gas Nr. G_0079
    #[serde(rename = "G_0079")]
    CodelisteGasNrG0079,
    /// Codeliste Gas Nr. G_0080
    #[serde(rename = "G_0080")]
    CodelisteGasNrG0080,
    /// Codeliste Gas Nr. G_0081
    #[serde(rename = "G_0081")]
    CodelisteGasNrG0081,
    /// Codeliste Gas Nr. G_0083
    #[serde(rename = "G_0083")]
    CodelisteGasNrG0083,
    /// Codeliste Gas Nr. G_0084
    #[serde(rename = "G_0084")]
    CodelisteGasNrG0084,
    /// Codeliste Gas Nr. G_0085
    #[serde(rename = "G_0085")]
    CodelisteGasNrG0085,
    /// Codeliste Gas Nr. G_0086
    #[serde(rename = "G_0086")]
    CodelisteGasNrG0086,
    /// Codeliste Gas Nr. G_0087
    #[serde(rename = "G_0087")]
    CodelisteGasNrG0087,
    /// Codeliste Gas und Strom Nr. GS_002
    #[serde(rename = "GS_002")]
    CodelisteGasStromNrGs002,
}

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

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

/// dokumenttyp for PID 33002
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DokumentDokumenttyp {
    /// Handelsrechnung
    #[serde(rename = "380")]
    Handelsrechnung,
    /// Selbst ausgestellte Rechnung (engl.: "Self-billed invoice")
    #[serde(rename = "389")]
    SelbstAusgestellteRechnungEnglSelfBilledInvoice,
    /// Storno einer Belastung.
    #[serde(rename = "457")]
    StornoBelastung,
    /// Storno für selbst ausgestellte Rechnung (Gutschrift im Gutschriftsverfahren)
    #[serde(rename = "Z25")]
    StornoSelbstAusgestellteRechnungGutschriftGutschriftsverfahren,
}

/// marktrolle for PID 33002
#[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 33002
#[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 33002
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum NachrichtDokumenttyp {
    /// Abgelehnte Forderung (Nicht-Zahlungsavis)
    #[serde(rename = "239")]
    AbgelehnteForderungNichtZahlungsavis,
    /// Zahlungsavis
    #[serde(rename = "481")]
    Zahlungsavis,
}

/// pruefidentifikator for PID 33002
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Pruefidentifikator {
    /// Prüfidentifikator
    #[serde(rename = "33001")]
    Bestaetigung,
    /// Prüfidentifikator
    #[serde(rename = "33002")]
    Abweisung,
    /// Prüfidentifikator
    #[serde(rename = "33003")]
    AbweisungKopfSumme,
    /// Prüfidentifikator
    #[serde(rename = "33004")]
    AbweisungPosition,
}

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

/// waehrungCode for PID 33002
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum WaehrungCode {
    /// ISO 4217 3-Alpha Code
    #[serde(rename = "EUR")]
    Euro,
}

/// waehrungQualifier for PID 33002
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum WaehrungQualifier {
    /// Zahlungswährung
    #[serde(rename = "11")]
    Zahlungswaehrung,
}

/// waehrungsverwendung for PID 33002
#[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 AnsprechpartnerKontakt {
    /// Required (X). (an..3)
    pub funktion_code: Option<AnsprechpartnerFunktionCode>,
}

/// Abweichung for PID 33002 — Abweisung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Abweichung {
    /// 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 (X). (an..3)
    pub pruefschritt_code: Option<String>,
    /// Required (unknown). ()
    pub text_funktion: Option<String>,
    /// Required (unknown). ()
    pub text_qualifier: Option<String>,
    /// Required (unknown). ()
    pub text_referenz: Option<String>,
}

/// Ansprechpartner for PID 33002 — Abweisung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Ansprechpartner {
    /// Required (X (([939][89]) ∨ ([940][90])) ∧ [549]). (an..512)
    pub kommunikationsadresse: Option<String>,
    /// Required (X [1P0..1]). (an..3)
    pub kommunikationstyp: Option<Kommunikationstyp>,
    pub kontakt: Option<AnsprechpartnerKontakt>,
    /// Required (X). ()
    pub name: Option<String>,
    /// Required (X). (an..35)
    pub telefonnummer: Option<String>,
}

/// Dokument for PID 33002 — Abweisung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Dokument {
    /// Required (X [512]). (an..70)
    pub abrechnungsreferenz: Option<String>,
    /// Required (X [931]). (an..35)
    pub dokumentdatum: Option<String>,
    /// Required (X [511]). (an..35)
    pub dokumentennummer: Option<String>,
    /// Required (X). (an..3)
    pub dokumenttyp: Option<DokumentDokumenttyp>,
    /// Required (X [930] [501]). (n..35)
    pub faelliger_betrag: Option<String>,
    /// Required (X [930] [501]). (n..35)
    pub ueberweisungsbetrag: Option<String>,
}

/// Marktteilnehmer for PID 33002 — Abweisung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// 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 33002 — Abweisung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Nachricht {
    /// Optional. (an..35)
    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. (n..35)
    pub ueberweisungsbetrag: Option<String>,
    /// Optional. (a1)
    pub uns_kennung: Option<UnsKennung>,
}

/// Waehrung for PID 33002 — Abweisung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Waehrung {
    /// Required (X). (an..3)
    pub waehrung_code: Option<WaehrungCode>,
    /// Required (X). (an..3)
    pub waehrung_qualifier: Option<WaehrungQualifier>,
    /// Required (X). (an..3)
    pub waehrungsverwendung: Option<Waehrungsverwendung>,
}

/// PID 33002 transaction — Abweisung.
#[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 abweichung: Option<Vec<Abweichung>>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub dokument: Option<Vec<Dokument>>,
}

/// PID 33002 message-level — Abweisung.
#[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>,
    pub waehrung: Option<Waehrung>,
}

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