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

/// marktrolle for PID 21004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Marktrolle {
    /// Nachrichtenempfänger
    #[serde(rename = "MR")]
    Nachrichtenempfaenger,
}

/// rollencodetyp for PID 21004
#[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 21004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Dokumenttyp {
    /// MaBiS Meldung(en)
    #[serde(rename = "Z03")]
    MabisMeldungEn,
    /// WiM Meldung(en)
    #[serde(rename = "Z09")]
    WimMeldungEn,
    /// GPKE Meldung(en)
    #[serde(rename = "Z33")]
    GpkeMeldungEn,
    /// Redispatch Meldung(en)
    #[serde(rename = "Z49")]
    RedispatchMeldungEn,
    /// Beendigung einer Konfiguration
    #[serde(rename = "Z72")]
    BeendigungKonfiguration,
    /// Bestellung einer Konfiguration
    #[serde(rename = "Z73")]
    BestellungKonfiguration,
    /// EnFG Informationen
    #[serde(rename = "Z86")]
    EnfgInformationen,
}

/// ebdNummer for PID 21004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum StatusZ04EbdNummer {
    /// EBD Nr. E_0026
    #[serde(rename = "E_0026")]
    EbdNrE0026,
    /// EBD Nr. E_0042
    #[serde(rename = "E_0042")]
    EbdNrE0042,
    /// EBD Nr. E_0043
    #[serde(rename = "E_0043")]
    EbdNrE0043,
    /// EBD Nr. E_0053
    #[serde(rename = "E_0053")]
    EbdNrE0053,
    /// EBD Nr. E_0054
    #[serde(rename = "E_0054")]
    EbdNrE0054,
    /// EBD Nr. E_0055
    #[serde(rename = "E_0055")]
    EbdNrE0055,
    /// EBD Nr. E_0056
    #[serde(rename = "E_0056")]
    EbdNrE0056,
    /// EBD Nr. E_0057
    #[serde(rename = "E_0057")]
    EbdNrE0057,
    /// EBD Nr. E_0058
    #[serde(rename = "E_0058")]
    EbdNrE0058,
    /// EBD Nr. E_0059
    #[serde(rename = "E_0059")]
    EbdNrE0059,
    /// EBD Nr. E_0060
    #[serde(rename = "E_0060")]
    EbdNrE0060,
    /// EBD Nr. E_0061
    #[serde(rename = "E_0061")]
    EbdNrE0061,
    /// EBD Nr. E_0066
    #[serde(rename = "E_0066")]
    EbdNrE0066,
    /// EBD Nr. E_0067
    #[serde(rename = "E_0067")]
    EbdNrE0067,
    /// EBD Nr. E_0075
    #[serde(rename = "E_0075")]
    EbdNrE0075,
    /// EBD Nr. E_0076
    #[serde(rename = "E_0076")]
    EbdNrE0076,
    /// EBD Nr. E_0077
    #[serde(rename = "E_0077")]
    EbdNrE0077,
    /// EBD Nr. E_0082
    #[serde(rename = "E_0082")]
    EbdNrE0082,
    /// EBD Nr. E_0083
    #[serde(rename = "E_0083")]
    EbdNrE0083,
    /// EBD Nr. E_0084
    #[serde(rename = "E_0084")]
    EbdNrE0084,
}

/// statusKategorie for PID 21004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum StatusZ04StatusKategorie {
    /// Datenstatus zur Summenzeitreihe
    #[serde(rename = "Z04")]
    DatenstatusSummenzeitreihe,
}

/// ebdNummer for PID 21004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum StatusZ13EbdNummer {
    /// EBD Nr. E_0019
    #[serde(rename = "E_0019")]
    EbdNrE0019,
    /// EBD Nr. E_0021
    #[serde(rename = "E_0021")]
    EbdNrE0021,
    /// EBD Nr. E_0025
    #[serde(rename = "E_0025")]
    EbdNrE0025,
    /// EBD Nr. E_0030
    #[serde(rename = "E_0030")]
    EbdNrE0030,
    /// EBD Nr. E_0074
    #[serde(rename = "E_0074")]
    EbdNrE0074,
    /// EBD Nr. E_0081
    #[serde(rename = "E_0081")]
    EbdNrE0081,
}

/// statusKategorie for PID 21004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum StatusZ13StatusKategorie {
    /// Datenstatus zur Summenzeitreihe
    #[serde(rename = "Z04")]
    DatenstatusSummenzeitreihe,
}

/// pruefidentifikator for PID 21004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Pruefidentifikator {
    /// MaBiS / Statusmeldung vom BIKO an BKV/NB
    #[serde(rename = "21004")]
    MabisStatusmeldungBikoBkvNb,
}

/// zeitreihenVersion for PID 21004
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ZeitreihenVersion {
    /// MaBiS / Statusmeldung vom BIKO an BKV/NB
    #[serde(rename = "21004")]
    MabisStatusmeldungBikoBkvNb,
}

/// Marktteilnehmer for PID 21004 — Status-meldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Marktteilnehmer {
    /// Required (X). (an..3)
    pub marktrolle: Option<Marktrolle>,
    /// Required (X [27]). (an..35)
    pub rollencodenummer: Option<String>,
    /// Required (X). (an..3)
    pub rollencodetyp: Option<Rollencodetyp>,
}

/// Messlokation for PID 21004 — Status-meldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Messlokation {
    /// Required (X). (an..35)
    pub bilanzierungsperiode: Option<String>,
    /// Required (X [951] [504]). (an..35)
    pub meldepunkt_id: Option<String>,
    /// Required (X). (an..35)
    pub statusaenderung_zeitstempel: Option<String>,
}

/// Nachricht for PID 21004 — Status-meldung.
#[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<Dokumenttyp>,
    /// Optional. (an..35)
    pub erstellungsdatum: Option<String>,
}

/// StatusZ04 for PID 21004 — Status-meldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct StatusZ04 {
    /// Required (X [16]). (an..17)
    pub ebd_nummer: Option<StatusZ04EbdNummer>,
    /// Required (X). (an..3)
    pub pruefschritt_code: Option<String>,
    /// Required (X). (an..3)
    pub status_kategorie: Option<StatusZ04StatusKategorie>,
}

/// StatusZ13 for PID 21004 — Status-meldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct StatusZ13 {
    /// Required (X). (an..17)
    pub ebd_nummer: Option<StatusZ13EbdNummer>,
    /// Required (X). (an..3)
    pub pruefschritt_code: Option<String>,
    /// Required (X). (an..3)
    pub status_code: Option<String>,
    /// Required (X). (an..3)
    pub status_kategorie: Option<StatusZ13StatusKategorie>,
}

/// Vorgang for PID 21004 — Status-meldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Vorgang {
    /// Required (X). (an..70)
    pub pruefidentifikator: Option<Pruefidentifikator>,
    /// Required (X [911]). (an..17)
    pub vorgangsnummer: Option<String>,
    /// Required (X). (an..70)
    pub zeitreihen_version: Option<ZeitreihenVersion>,
}

/// PID 21004 transaction — Status-meldung.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
    /// Required (X).
    pub messlokation: Option<Messlokation>,
    pub status_z04: Option<StatusZ04>,
    pub status_z13: Option<StatusZ13>,
    pub vorgang: Option<Vorgang>,
}

/// PID 21004 message-level — Status-meldung.
#[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 21004 — Status-meldung.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
