// 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 21033
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Marktrolle {
    /// Nachrichtenempfänger
    #[serde(rename = "MR")]
    Nachrichtenempfaenger,
}

/// rollencodetyp for PID 21033
#[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 21033
#[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,
}

/// aavQualifier for PID 21033
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AavQualifier {
    /// Prüfidentifikator
    #[serde(rename = "Z13")]
    Pruefidentifikator,
}

/// ebdNummer for PID 21033
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum EbdNummer {
    /// EBD Nr. E_0207
    #[serde(rename = "E_0207")]
    EbdNrE0207,
    /// EBD Nr. E_0252
    #[serde(rename = "E_0252")]
    EbdNrE0252,
    /// EBD Nr. E_0524
    #[serde(rename = "E_0524")]
    EbdNrE0524,
    /// EBD Nr. E_0531
    #[serde(rename = "E_0531")]
    EbdNrE0531,
    /// EBD Nr. E_0278
    #[serde(rename = "E_0278")]
    EbdNrE0278,
    /// EBD Nr. E_0281
    #[serde(rename = "E_0281")]
    EbdNrE0281,
}

/// pruefidentifikator for PID 21033
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Pruefidentifikator {
    /// WiM, GPKE / Anfrageablehnung (MSB an ESA / LF / NB)
    #[serde(rename = "21033")]
    WimGpkeAnfrageablehnungMsbEsaLfNb,
}

/// referenz for PID 21033
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Referenz {
    /// WiM, GPKE / Anfrageablehnung (MSB an ESA / LF / NB)
    #[serde(rename = "21033")]
    WimGpkeAnfrageablehnungMsbEsaLfNb,
}

/// statusCode for PID 21033
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum StatusCode {
    /// abgelehnt
    #[serde(rename = "Z32")]
    Abgelehnt,
}

/// statusKategorie for PID 21033
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum StatusKategorie {
    /// Status des referenzierten Dokuments
    #[serde(rename = "Z20")]
    StatusReferenziertenDokuments,
}

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

/// Freitext for PID 21033 — Ablehnung der Anfrage.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Freitext {
    /// Required (X). (an..512)
    pub freitext1: Option<String>,
    /// Optional. (an..512)
    pub freitext2: Option<String>,
    /// Optional. (an..512)
    pub freitext3: Option<String>,
    /// Optional. (an..512)
    pub freitext4: Option<String>,
    /// Optional. (an..512)
    pub freitext5: Option<String>,
    /// Required (unknown). ()
    pub freitext_code: Option<String>,
    /// Required (X). (an..6)
    pub sendungsposition: Option<String>,
    /// Required (unknown). ()
    pub text_funktion: Option<String>,
}

/// Marktteilnehmer for PID 21033 — Ablehnung der Anfrage.
#[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>,
}

/// Nachricht for PID 21033 — Ablehnung der Anfrage.
#[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>,
}

/// Status for PID 21033 — Ablehnung der Anfrage.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Status {
    /// Required (X). (an..3)
    pub aav_qualifier: Option<AavQualifier>,
    /// Required (X [20]). (an..17)
    pub ebd_nummer: Option<EbdNummer>,
    /// Required (X). (an..70)
    pub pruefidentifikator: Option<Pruefidentifikator>,
    /// Required (X). (an..3)
    pub pruefschritt_code: Option<String>,
    /// Required (X). (an..70)
    pub referenz: Option<Referenz>,
    /// Required (X [UB1]). (an..35)
    pub sperrtermin: Option<String>,
    /// Required (X). (an..3)
    pub status_code: Option<StatusCode>,
    /// Required (X). (an..3)
    pub status_kategorie: Option<StatusKategorie>,
}

/// Vorgang for PID 21033 — Ablehnung der Anfrage.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Vorgang {
    /// Required (X). (an..3)
    pub loc_qualifier: Option<LocQualifier>,
    /// Required (X ([950] [506]) ⊻ ([951] [505]) ⊻ ([960] [532]) ⊻ ([961] [533])). (an..35)
    pub meldepunkt_id: Option<String>,
    /// Required (X [911]). (n..5)
    pub vorgangsnummer: Option<String>,
}

/// PID 21033 transaction — Ablehnung der Anfrage.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
pub struct Transaktion {
    pub freitext: Option<Freitext>,
    pub status: Option<Status>,
    #[serde(default, deserialize_with = "crate::serde_helpers::deserialize_vec_or_single")]
    pub vorgang: Option<Vec<Vorgang>>,
}

/// PID 21033 message-level — Ablehnung der Anfrage.
#[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 21033 — Ablehnung der Anfrage.
pub type Interchange = crate::model::Interchange<Message, Transaktion>;
