#[allow(unused_imports)]
use super::{common as com, common_extension as comx, location_referencing as loc, location_extension as locx, situation as sit, road_traffic_data as roa, vms, parking as prk, energy_infrastructure as egi, facilities as fac, afir_facilities as afac, traffic_regulation as tro, controlled_zone as cz, traffic_management_plan as tmp, rerouting_management_enhanced as rer, urban_extensions as ubx, fault_and_status as fst};
#[allow(unused_imports)]
use crate::out::{Out, Pattern};
#[allow(unused_imports)]
use crate::xml::{Enumeration, Xml};
#[allow(unused_imports)]
use crate::{Date, DateTime, Decimal, Error, Extension, MultilingualString, Time};
pub type Ampere = com::Float;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AuthenticationAndIdentificationEnum {
ActiveRFIDChip,
Apps,
Calypso,
CashPayment,
CreditCard,
DebitCard,
MifareClassic,
MifareDesfire,
Nfc,
OverTheAir,
PhoneDialog,
PhoneSMS,
Pinpad,
Plc,
PrepaidCard,
Rfid,
Website,
UnlimitedAccess,
NoAccess,
Extended(String),
}
impl AuthenticationAndIdentificationEnum {
pub fn as_str(&self) -> &str {
match self {
Self::ActiveRFIDChip => "activeRFIDChip",
Self::Apps => "apps",
Self::Calypso => "calypso",
Self::CashPayment => "cashPayment",
Self::CreditCard => "creditCard",
Self::DebitCard => "debitCard",
Self::MifareClassic => "mifareClassic",
Self::MifareDesfire => "mifareDesfire",
Self::Nfc => "nfc",
Self::OverTheAir => "overTheAir",
Self::PhoneDialog => "phoneDialog",
Self::PhoneSMS => "phoneSMS",
Self::Pinpad => "pinpad",
Self::Plc => "plc",
Self::PrepaidCard => "prepaidCard",
Self::Rfid => "rfid",
Self::Website => "website",
Self::UnlimitedAccess => "unlimitedAccess",
Self::NoAccess => "noAccess",
Self::Extended(v) => v,
}
}
}
impl Enumeration for AuthenticationAndIdentificationEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"activeRFIDChip" => Some(Self::ActiveRFIDChip),
"apps" => Some(Self::Apps),
"calypso" => Some(Self::Calypso),
"cashPayment" => Some(Self::CashPayment),
"creditCard" => Some(Self::CreditCard),
"debitCard" => Some(Self::DebitCard),
"mifareClassic" => Some(Self::MifareClassic),
"mifareDesfire" => Some(Self::MifareDesfire),
"nfc" => Some(Self::Nfc),
"overTheAir" => Some(Self::OverTheAir),
"phoneDialog" => Some(Self::PhoneDialog),
"phoneSMS" => Some(Self::PhoneSMS),
"pinpad" => Some(Self::Pinpad),
"plc" => Some(Self::Plc),
"prepaidCard" => Some(Self::PrepaidCard),
"rfid" => Some(Self::Rfid),
"website" => Some(Self::Website),
"unlimitedAccess" => Some(Self::UnlimitedAccess),
"noAccess" => Some(Self::NoAccess),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl AuthenticationAndIdentificationEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type Bar = com::Float;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum BioethanolTypeEnum {
SuperE5,
SuperE10,
E15,
E85,
E100,
Unknown,
Other,
Extended(String),
}
impl BioethanolTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::SuperE5 => "superE5",
Self::SuperE10 => "superE10",
Self::E15 => "e15",
Self::E85 => "e85",
Self::E100 => "e100",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for BioethanolTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"superE5" => Some(Self::SuperE5),
"superE10" => Some(Self::SuperE10),
"e15" => Some(Self::E15),
"e85" => Some(Self::E85),
"e100" => Some(Self::E100),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl BioethanolTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ChargingModeEnum {
Mode1AC1p,
Mode1AC3p,
Mode2AC1p,
Mode2AC3p,
Mode3AC3p,
Mode4DC,
LegacyInductive,
Ccs,
Other,
Unknown,
Extended(String),
}
impl ChargingModeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Mode1AC1p => "mode1AC1p",
Self::Mode1AC3p => "mode1AC3p",
Self::Mode2AC1p => "mode2AC1p",
Self::Mode2AC3p => "mode2AC3p",
Self::Mode3AC3p => "mode3AC3p",
Self::Mode4DC => "mode4DC",
Self::LegacyInductive => "legacyInductive",
Self::Ccs => "ccs",
Self::Other => "other",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ChargingModeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"mode1AC1p" => Some(Self::Mode1AC1p),
"mode1AC3p" => Some(Self::Mode1AC3p),
"mode2AC1p" => Some(Self::Mode2AC1p),
"mode2AC3p" => Some(Self::Mode2AC3p),
"mode3AC3p" => Some(Self::Mode3AC3p),
"mode4DC" => Some(Self::Mode4DC),
"legacyInductive" => Some(Self::LegacyInductive),
"ccs" => Some(Self::Ccs),
"other" => Some(Self::Other),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ChargingModeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ChargingPointUsageTypeEnum {
ElectricBoat,
ElectricBike,
ElectricalDevices,
ElectricMotorcycle,
ElectricVehicle,
LorryPowerConsumption,
MotorhomeOrCaravanSupply,
OverheadLineDrivenVehicles,
Other,
Extended(String),
}
impl ChargingPointUsageTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::ElectricBoat => "electricBoat",
Self::ElectricBike => "electricBike",
Self::ElectricalDevices => "electricalDevices",
Self::ElectricMotorcycle => "electricMotorcycle",
Self::ElectricVehicle => "electricVehicle",
Self::LorryPowerConsumption => "lorryPowerConsumption",
Self::MotorhomeOrCaravanSupply => "motorhomeOrCaravanSupply",
Self::OverheadLineDrivenVehicles => "overheadLineDrivenVehicles",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ChargingPointUsageTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"electricBoat" => Some(Self::ElectricBoat),
"electricBike" => Some(Self::ElectricBike),
"electricalDevices" => Some(Self::ElectricalDevices),
"electricMotorcycle" => Some(Self::ElectricMotorcycle),
"electricVehicle" => Some(Self::ElectricVehicle),
"lorryPowerConsumption" => Some(Self::LorryPowerConsumption),
"motorhomeOrCaravanSupply" => Some(Self::MotorhomeOrCaravanSupply),
"overheadLineDrivenVehicles" => Some(Self::OverheadLineDrivenVehicles),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ChargingPointUsageTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ConnectorFormatTypeEnum {
CableMode2,
CableMode3,
OtherCable,
Socket,
Extended(String),
}
impl ConnectorFormatTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::CableMode2 => "cableMode2",
Self::CableMode3 => "cableMode3",
Self::OtherCable => "otherCable",
Self::Socket => "socket",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ConnectorFormatTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"cableMode2" => Some(Self::CableMode2),
"cableMode3" => Some(Self::CableMode3),
"otherCable" => Some(Self::OtherCable),
"socket" => Some(Self::Socket),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ConnectorFormatTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ConnectorTypeEnum {
Chademo,
Cee3,
Cee5,
Yazaki,
Domestic,
DomesticAType,
DomesticBType,
DomesticCType,
DomesticDType,
DomesticEType,
DomesticFType,
DomesticGType,
DomesticHType,
DomesticIType,
DomesticJType,
DomesticKType,
DomesticLType,
DomesticMType,
DomesticNType,
DomesticOType,
Iec60309x2single16,
Iec60309x2three16,
Iec60309x2three32,
Iec60309x2three64,
Iec62196T1,
Iec62196T1COMBO,
Iec62196T2,
Iec62196T2COMBO,
Iec62196T3A,
Iec62196T3C,
Mcs,
PantographBottomUp,
PantographTopDown,
TeslaConnectorEurope,
TeslaConnectorAmerica,
TeslaR,
TeslaS,
Other,
Extended(String),
}
impl ConnectorTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Chademo => "chademo",
Self::Cee3 => "cee3",
Self::Cee5 => "cee5",
Self::Yazaki => "yazaki",
Self::Domestic => "domestic",
Self::DomesticAType => "domesticAType",
Self::DomesticBType => "domesticBType",
Self::DomesticCType => "domesticCType",
Self::DomesticDType => "domesticDType",
Self::DomesticEType => "domesticEType",
Self::DomesticFType => "domesticFType",
Self::DomesticGType => "domesticGType",
Self::DomesticHType => "domesticHType",
Self::DomesticIType => "domesticIType",
Self::DomesticJType => "domesticJType",
Self::DomesticKType => "domesticKType",
Self::DomesticLType => "domesticLType",
Self::DomesticMType => "domesticMType",
Self::DomesticNType => "domesticNType",
Self::DomesticOType => "domesticOType",
Self::Iec60309x2single16 => "iec60309x2single16",
Self::Iec60309x2three16 => "iec60309x2three16",
Self::Iec60309x2three32 => "iec60309x2three32",
Self::Iec60309x2three64 => "iec60309x2three64",
Self::Iec62196T1 => "iec62196T1",
Self::Iec62196T1COMBO => "iec62196T1COMBO",
Self::Iec62196T2 => "iec62196T2",
Self::Iec62196T2COMBO => "iec62196T2COMBO",
Self::Iec62196T3A => "iec62196T3A",
Self::Iec62196T3C => "iec62196T3C",
Self::Mcs => "mcs",
Self::PantographBottomUp => "pantographBottomUp",
Self::PantographTopDown => "pantographTopDown",
Self::TeslaConnectorEurope => "teslaConnectorEurope",
Self::TeslaConnectorAmerica => "teslaConnectorAmerica",
Self::TeslaR => "teslaR",
Self::TeslaS => "teslaS",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ConnectorTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"chademo" => Some(Self::Chademo),
"cee3" => Some(Self::Cee3),
"cee5" => Some(Self::Cee5),
"yazaki" => Some(Self::Yazaki),
"domestic" => Some(Self::Domestic),
"domesticAType" => Some(Self::DomesticAType),
"domesticBType" => Some(Self::DomesticBType),
"domesticCType" => Some(Self::DomesticCType),
"domesticDType" => Some(Self::DomesticDType),
"domesticEType" => Some(Self::DomesticEType),
"domesticFType" => Some(Self::DomesticFType),
"domesticGType" => Some(Self::DomesticGType),
"domesticHType" => Some(Self::DomesticHType),
"domesticIType" => Some(Self::DomesticIType),
"domesticJType" => Some(Self::DomesticJType),
"domesticKType" => Some(Self::DomesticKType),
"domesticLType" => Some(Self::DomesticLType),
"domesticMType" => Some(Self::DomesticMType),
"domesticNType" => Some(Self::DomesticNType),
"domesticOType" => Some(Self::DomesticOType),
"iec60309x2single16" => Some(Self::Iec60309x2single16),
"iec60309x2three16" => Some(Self::Iec60309x2three16),
"iec60309x2three32" => Some(Self::Iec60309x2three32),
"iec60309x2three64" => Some(Self::Iec60309x2three64),
"iec62196T1" => Some(Self::Iec62196T1),
"iec62196T1COMBO" => Some(Self::Iec62196T1COMBO),
"iec62196T2" => Some(Self::Iec62196T2),
"iec62196T2COMBO" => Some(Self::Iec62196T2COMBO),
"iec62196T3A" => Some(Self::Iec62196T3A),
"iec62196T3C" => Some(Self::Iec62196T3C),
"mcs" => Some(Self::Mcs),
"pantographBottomUp" => Some(Self::PantographBottomUp),
"pantographTopDown" => Some(Self::PantographTopDown),
"teslaConnectorEurope" => Some(Self::TeslaConnectorEurope),
"teslaConnectorAmerica" => Some(Self::TeslaConnectorAmerica),
"teslaR" => Some(Self::TeslaR),
"teslaS" => Some(Self::TeslaS),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ConnectorTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum CurrentTypeEnum {
Ac,
Dc,
Extended(String),
}
impl CurrentTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Ac => "ac",
Self::Dc => "dc",
Self::Extended(v) => v,
}
}
}
impl Enumeration for CurrentTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"ac" => Some(Self::Ac),
"dc" => Some(Self::Dc),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl CurrentTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DeliveryUnitEnum {
Litre,
KWh,
Kg,
M3,
ImperialGallon,
UsGallon,
GasGallonEquivalent,
Extended(String),
}
impl DeliveryUnitEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Litre => "litre",
Self::KWh => "kWh",
Self::Kg => "kg",
Self::M3 => "m3",
Self::ImperialGallon => "imperialGallon",
Self::UsGallon => "usGallon",
Self::GasGallonEquivalent => "gasGallonEquivalent",
Self::Extended(v) => v,
}
}
}
impl Enumeration for DeliveryUnitEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"litre" => Some(Self::Litre),
"kWh" => Some(Self::KWh),
"kg" => Some(Self::Kg),
"m3" => Some(Self::M3),
"imperialGallon" => Some(Self::ImperialGallon),
"usGallon" => Some(Self::UsGallon),
"gasGallonEquivalent" => Some(Self::GasGallonEquivalent),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl DeliveryUnitEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DieselVehicleTypeEnum {
CarDiesel,
TruckDiesel,
Extended(String),
}
impl DieselVehicleTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::CarDiesel => "carDiesel",
Self::TruckDiesel => "truckDiesel",
Self::Extended(v) => v,
}
}
}
impl Enumeration for DieselVehicleTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"carDiesel" => Some(Self::CarDiesel),
"truckDiesel" => Some(Self::TruckDiesel),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl DieselVehicleTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ElectricEnergySourceTypeEnum {
Biogas,
Coal,
Gas,
Nuclear,
Solar,
Water,
Wind,
GeneralGreen,
GeneralFossil,
Other,
Extended(String),
}
impl ElectricEnergySourceTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Biogas => "biogas",
Self::Coal => "coal",
Self::Gas => "gas",
Self::Nuclear => "nuclear",
Self::Solar => "solar",
Self::Water => "water",
Self::Wind => "wind",
Self::GeneralGreen => "generalGreen",
Self::GeneralFossil => "generalFossil",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ElectricEnergySourceTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"biogas" => Some(Self::Biogas),
"coal" => Some(Self::Coal),
"gas" => Some(Self::Gas),
"nuclear" => Some(Self::Nuclear),
"solar" => Some(Self::Solar),
"water" => Some(Self::Water),
"wind" => Some(Self::Wind),
"generalGreen" => Some(Self::GeneralGreen),
"generalFossil" => Some(Self::GeneralFossil),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ElectricEnergySourceTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EnergyInfrastructureSiteTypeEnum {
InBuilding,
OpenSpace,
Onstreet,
OnCompanySite,
Other,
Extended(String),
}
impl EnergyInfrastructureSiteTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::InBuilding => "inBuilding",
Self::OpenSpace => "openSpace",
Self::Onstreet => "onstreet",
Self::OnCompanySite => "onCompanySite",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for EnergyInfrastructureSiteTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"inBuilding" => Some(Self::InBuilding),
"openSpace" => Some(Self::OpenSpace),
"onstreet" => Some(Self::Onstreet),
"onCompanySite" => Some(Self::OnCompanySite),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl EnergyInfrastructureSiteTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GasConnectorTypeEnum {
GaseousHydrogen,
LiquidHydrogen,
Cng,
Lng,
Lpg,
Biogas,
Unknown,
Extended(String),
}
impl GasConnectorTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::GaseousHydrogen => "gaseousHydrogen",
Self::LiquidHydrogen => "liquidHydrogen",
Self::Cng => "cng",
Self::Lng => "lng",
Self::Lpg => "lpg",
Self::Biogas => "biogas",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for GasConnectorTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"gaseousHydrogen" => Some(Self::GaseousHydrogen),
"liquidHydrogen" => Some(Self::LiquidHydrogen),
"cng" => Some(Self::Cng),
"lng" => Some(Self::Lng),
"lpg" => Some(Self::Lpg),
"biogas" => Some(Self::Biogas),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl GasConnectorTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type GramsPerKilowattHour = com::Float;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum HydrogenFuellingProcessProtocolEnum {
Saej2601v2010,
Saej2601v2014,
Saej2601v2016,
McMethod,
Unknown,
Extended(String),
}
impl HydrogenFuellingProcessProtocolEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Saej2601v2010 => "saej2601v2010",
Self::Saej2601v2014 => "saej2601v2014",
Self::Saej2601v2016 => "saej2601v2016",
Self::McMethod => "mcMethod",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for HydrogenFuellingProcessProtocolEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"saej2601v2010" => Some(Self::Saej2601v2010),
"saej2601v2014" => Some(Self::Saej2601v2014),
"saej2601v2016" => Some(Self::Saej2601v2016),
"mcMethod" => Some(Self::McMethod),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl HydrogenFuellingProcessProtocolEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum HydrogenRefuellingModeEnum {
GaseousHydrogen350barCar,
GaseousHydrogen350barTruck,
GaseousHydrogen700barCar,
GaseousHydrogen700barTruck,
LiquidHydrogen,
CryoCompressedHydrogren,
Unknown,
Other,
Extended(String),
}
impl HydrogenRefuellingModeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::GaseousHydrogen350barCar => "gaseousHydrogen350barCar",
Self::GaseousHydrogen350barTruck => "gaseousHydrogen350barTruck",
Self::GaseousHydrogen700barCar => "gaseousHydrogen700barCar",
Self::GaseousHydrogen700barTruck => "gaseousHydrogen700barTruck",
Self::LiquidHydrogen => "liquidHydrogen",
Self::CryoCompressedHydrogren => "cryoCompressedHydrogren",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for HydrogenRefuellingModeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"gaseousHydrogen350barCar" => Some(Self::GaseousHydrogen350barCar),
"gaseousHydrogen350barTruck" => Some(Self::GaseousHydrogen350barTruck),
"gaseousHydrogen700barCar" => Some(Self::GaseousHydrogen700barCar),
"gaseousHydrogen700barTruck" => Some(Self::GaseousHydrogen700barTruck),
"liquidHydrogen" => Some(Self::LiquidHydrogen),
"cryoCompressedHydrogren" => Some(Self::CryoCompressedHydrogren),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl HydrogenRefuellingModeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type KilogramPerDay = com::Float;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum OctaneTypeEnum {
Octane95,
Octane98,
Other,
Extended(String),
}
impl OctaneTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Octane95 => "octane95",
Self::Octane98 => "octane98",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for OctaneTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"octane95" => Some(Self::Octane95),
"octane98" => Some(Self::Octane98),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl OctaneTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PetrolTypeEnum {
Leaded,
Unleaded,
Extended(String),
}
impl PetrolTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Leaded => "leaded",
Self::Unleaded => "unleaded",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PetrolTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"leaded" => Some(Self::Leaded),
"unleaded" => Some(Self::Unleaded),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PetrolTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PriceTypeEnum {
PricePerMinute,
PricePerKg,
PricePerKWh,
BasePrice,
FlatRate,
Free,
Other,
Extended(String),
}
impl PriceTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::PricePerMinute => "pricePerMinute",
Self::PricePerKg => "pricePerKg",
Self::PricePerKWh => "pricePerKWh",
Self::BasePrice => "basePrice",
Self::FlatRate => "flatRate",
Self::Free => "free",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PriceTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"pricePerMinute" => Some(Self::PricePerMinute),
"pricePerKg" => Some(Self::PricePerKg),
"pricePerKWh" => Some(Self::PricePerKWh),
"basePrice" => Some(Self::BasePrice),
"flatRate" => Some(Self::FlatRate),
"free" => Some(Self::Free),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PriceTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RatePolicyEnum {
Contract,
AdHoc,
Extended(String),
}
impl RatePolicyEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Contract => "contract",
Self::AdHoc => "adHoc",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RatePolicyEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"contract" => Some(Self::Contract),
"adHoc" => Some(Self::AdHoc),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RatePolicyEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RefillPointStatusEnum {
Available,
Blocked,
Charging,
Faulted,
Inoperative,
Occupied,
OutOfOrder,
OutOfStock,
Planned,
Removed,
Reserved,
Unavailable,
Unknown,
Extended(String),
}
impl RefillPointStatusEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Available => "available",
Self::Blocked => "blocked",
Self::Charging => "charging",
Self::Faulted => "faulted",
Self::Inoperative => "inoperative",
Self::Occupied => "occupied",
Self::OutOfOrder => "outOfOrder",
Self::OutOfStock => "outOfStock",
Self::Planned => "planned",
Self::Removed => "removed",
Self::Reserved => "reserved",
Self::Unavailable => "unavailable",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RefillPointStatusEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"available" => Some(Self::Available),
"blocked" => Some(Self::Blocked),
"charging" => Some(Self::Charging),
"faulted" => Some(Self::Faulted),
"inoperative" => Some(Self::Inoperative),
"occupied" => Some(Self::Occupied),
"outOfOrder" => Some(Self::OutOfOrder),
"outOfStock" => Some(Self::OutOfStock),
"planned" => Some(Self::Planned),
"removed" => Some(Self::Removed),
"reserved" => Some(Self::Reserved),
"unavailable" => Some(Self::Unavailable),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RefillPointStatusEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ServiceTypeEnum {
FullService,
PhysicalAttendance,
SelfService,
Unattended,
Extended(String),
}
impl ServiceTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::FullService => "fullService",
Self::PhysicalAttendance => "physicalAttendance",
Self::SelfService => "selfService",
Self::Unattended => "unattended",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ServiceTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"fullService" => Some(Self::FullService),
"physicalAttendance" => Some(Self::PhysicalAttendance),
"selfService" => Some(Self::SelfService),
"unattended" => Some(Self::Unattended),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ServiceTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SmartRechargingServicesEnum {
RemoteMonitoring,
PowerOptimisationByUser,
BidirectionalRecharging,
PlugAndCharge,
Extended(String),
}
impl SmartRechargingServicesEnum {
pub fn as_str(&self) -> &str {
match self {
Self::RemoteMonitoring => "remoteMonitoring",
Self::PowerOptimisationByUser => "powerOptimisationByUser",
Self::BidirectionalRecharging => "bidirectionalRecharging",
Self::PlugAndCharge => "plugAndCharge",
Self::Extended(v) => v,
}
}
}
impl Enumeration for SmartRechargingServicesEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"remoteMonitoring" => Some(Self::RemoteMonitoring),
"powerOptimisationByUser" => Some(Self::PowerOptimisationByUser),
"bidirectionalRecharging" => Some(Self::BidirectionalRecharging),
"plugAndCharge" => Some(Self::PlugAndCharge),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl SmartRechargingServicesEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type Units = com::Float;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VehicleToGridCommunicationTypeEnum {
None,
Iso15118,
Iec619802,
Other,
Unknown,
Extended(String),
}
impl VehicleToGridCommunicationTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::None => "none",
Self::Iso15118 => "iso15118",
Self::Iec619802 => "iec619802",
Self::Other => "other",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for VehicleToGridCommunicationTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"none" => Some(Self::None),
"iso15118" => Some(Self::Iso15118),
"iec619802" => Some(Self::Iec619802),
"other" => Some(Self::Other),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl VehicleToGridCommunicationTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type Volt = com::Float;
pub type Watt = com::Float;
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlternativeFuelsRefillPoint {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<afac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub external_identifier: Vec<afac::ExternalIdentifier>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<afac::Image>,
pub operating_hours: Option<afac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<afac::Organisation>,
pub operator: Option<afac::Organisation>,
pub helpdesk: Option<afac::Organisation>,
pub associated_facility: Vec<afac::AnyAssociatedFacility>,
pub rates: Option<afac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<afac::Dimension>>,
pub amenities: Option<Box<afac::Amenities>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<afac::SupplementalFacility>,
pub dedicated_parking_spaces: Vec<DedicatedParkingSpaces>,
pub facility_extension: Option<Box<Extension>>,
pub delivery_unit: Option<DeliveryUnitEnum>,
pub maximum_delivery_amount: Option<Units>,
pub minimum_delivery_amount: Option<Units>,
pub model_type: Option<MultilingualString>,
pub reservation: Option<afac::ReservationTypeEnum>,
pub energy_product: Vec<AnyEnergyProduct>,
pub refill_point_extension: Option<Box<Extension>>,
pub connector: Vec<GasConnectorTypeEnum>,
pub other_connector: Vec<String>,
pub hydrogen_process_protocol: Option<HydrogenFuellingProcessProtocolEnum>,
pub renewable_sources_ratio: Option<com::Percentage>,
pub pressure: Option<Bar>,
pub alternative_fuels_refill_point_extension: Option<Box<Extension>>,
}
impl AlternativeFuelsRefillPoint {
const FIELDS: &'static [u32] = &[0x20949, 0x206ad, 0x208ba, 0x20777, 0x2066b, 0x20690, 0x20805, 0x20887, 0x20a2d, 0x20a2c, 0x209c5, 0x208e8, 0x209f8, 0x209d2, 0x20864, 0x206d3, 0x20ab0, 0x206c6, 0x20786, 0x206b8, 0x20497, 0x20b90, 0x20764, 0x20496, 0x1076d, 0x10907, 0x10936, 0x10946, 0x10ae4, 0x107d5, 0x10592, 0x10735, 0x109e6, 0x1086b, 0x10add, 0x10a6f, 0x10418];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1002b);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = Vec::new();
let mut e22 = Vec::new();
let mut e23 = None;
let mut e24 = None;
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = None;
let mut e29 = Vec::new();
let mut e30 = None;
let mut e31 = Vec::new();
let mut e32 = Vec::new();
let mut e33 = None;
let mut e34 = None;
let mut e35 = None;
let mut e36 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x206ad => { let v = r.multilingual()?; e1.extend(v); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x2066b => { let v = r.enumeration::<afac::AccessibilityEnum>()?; e4.extend(v); }
0x20690 => { let v = r.multilingual()?; e5.extend(v); }
0x20805 => { let v = Some(afac::ExternalIdentifier::read(r)?); e6.extend(v); }
0x20887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x20a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x20a2c => { let v = Some(afac::Image::read(r)?); e9.extend(v); }
0x209c5 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x209f8 => { let v = afac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x209d2 => { let v = afac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x20864 => { let v = afac::Organisation::read(r)?; r.set(&mut e14, v, 2148); }
0x206d3 => { let v = afac::AnyAssociatedFacility::read(r)?; e15.extend(v); }
0x20ab0 => { let v = afac::Rates::read(r)?; r.set(&mut e16, v, 2736); }
0x206c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e17.extend(v); }
0x20786 => { let v = Some(afac::Dimension::read(r)?); r.set(&mut e18, v.map(Box::new), 1926); }
0x206b8 => { let v = Some(afac::Amenities::read(r)?); r.set(&mut e19, v.map(Box::new), 1720); }
0x20497 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1175); }
0x20b90 => { let v = afac::SupplementalFacility::read(r)?; e21.extend(v); }
0x20764 => { let v = Some(DedicatedParkingSpaces::read(r)?); e22.extend(v); }
0x20496 => { let v = r.raw()?; r.set(&mut e23, v.map(Box::new), 1174); }
0x1076d => { let v = r.enumeration::<DeliveryUnitEnum>()?; r.set(&mut e24, v, 1901); }
0x10907 => { let v = r.value::<f32>()?; r.set(&mut e25, v, 2311); }
0x10936 => { let v = r.value::<f32>()?; r.set(&mut e26, v, 2358); }
0x10946 => { let v = r.multilingual()?; r.set(&mut e27, v, 2374); }
0x10ae4 => { let v = r.enumeration::<afac::ReservationTypeEnum>()?; r.set(&mut e28, v, 2788); }
0x107d5 => { let v = AnyEnergyProduct::read(r)?; e29.extend(v); }
0x10592 => { let v = r.raw()?; r.set(&mut e30, v.map(Box::new), 1426); }
0x10735 => { let v = r.enumeration::<GasConnectorTypeEnum>()?; e31.extend(v); }
0x109e6 => { let v = r.string()?; e32.extend(v); }
0x1086b => { let v = r.enumeration::<HydrogenFuellingProcessProtocolEnum>()?; r.set(&mut e33, v, 2155); }
0x10add => { let v = r.value::<f32>()?; r.set(&mut e34, v, 2781); }
0x10a6f => { let v = r.value::<f32>()?; r.set(&mut e35, v, 2671); }
0x10418 => { let v = r.raw()?; r.set(&mut e36, v.map(Box::new), 1048); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e24, 1901);
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
last_updated: e2,
description: e3,
accessibility: e4,
additional_information: e5,
external_identifier: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
helpdesk: e14,
associated_facility: e15,
rates: e16,
applicable_for_vehicles: e17,
dimension: e18,
amenities: e19,
facility_object_extension: e20,
supplemental_facility: e21,
dedicated_parking_spaces: e22,
facility_extension: e23,
delivery_unit: e24,
maximum_delivery_amount: e25,
minimum_delivery_amount: e26,
model_type: e27,
reservation: e28,
energy_product: e29,
refill_point_extension: e30,
connector: e31,
other_connector: e32,
hydrogen_process_protocol: e33,
renewable_sources_ratio: e34,
pressure: e35,
alternative_fuels_refill_point_extension: e36,
};
r.close();
Ok(v)
}
}
impl AlternativeFuelsRefillPoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.name { w.multilingual("afac:name", v)?; }
for v in &self.alias { w.multilingual("afac:alias", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
for v in &self.accessibility { w.enumeration("afac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("afac:additionalInformation", v)?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.information_website { v.write(w, "afac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "afac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "afac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "afac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "afac:operator")?; }
if let Some(v) = &self.helpdesk { v.write(w, "afac:helpdesk")?; }
for v in &self.associated_facility { v.write(w, "afac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "afac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "afac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "afac:dimension", "", "")?; }
if let Some(v) = &self.amenities { v.write(w, "afac:amenities", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("afac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "afac:supplementalFacility")?; }
for v in &self.dedicated_parking_spaces { v.write(w, "afac:dedicatedParkingSpaces", "", "")?; }
if let Some(v) = &self.facility_extension { w.extension("afac:_facilityExtension", v)?; }
match &self.delivery_unit {
Some(v) => { w.enumeration("aegi:deliveryUnit", v.literal())?; }
None => return Err(w.missing("aegi:deliveryUnit")),
}
if let Some(v) = &self.maximum_delivery_amount { w.leaf("aegi:maximumDeliveryAmount", v)?; }
if let Some(v) = &self.minimum_delivery_amount { w.leaf("aegi:minimumDeliveryAmount", v)?; }
if let Some(v) = &self.model_type { w.multilingual("aegi:modelType", v)?; }
if let Some(v) = &self.reservation { w.enumeration("aegi:reservation", v.literal())?; }
for v in &self.energy_product { v.write(w, "aegi:energyProduct")?; }
if let Some(v) = &self.refill_point_extension { w.extension("aegi:_refillPointExtension", v)?; }
for v in &self.connector { w.enumeration("aegi:connector", v.literal())?; }
for v in &self.other_connector { w.max_len("otherConnector", v, 1024)?; w.leaf("aegi:otherConnector", v)?; }
if let Some(v) = &self.hydrogen_process_protocol { w.enumeration("aegi:hydrogenProcessProtocol", v.literal())?; }
if let Some(v) = &self.renewable_sources_ratio { w.leaf("aegi:renewableSourcesRatio", v)?; }
if let Some(v) = &self.pressure { w.leaf("aegi:pressure", v)?; }
if let Some(v) = &self.alternative_fuels_refill_point_extension { w.extension("aegi:_alternativeFuelsRefillPointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AssociatedParking {
pub r#type: Option<afac::FacilityTypeEnum>,
pub facility_reference: Option<Box<com::VersionedReference>>,
pub description: Option<MultilingualString>,
pub associated_facility_extension: Option<Box<Extension>>,
pub car_parking_capacity: Option<com::NonNegativeInteger>,
pub truck_parking_capacity: Option<com::NonNegativeInteger>,
pub bike_parking_capacity: Option<com::NonNegativeInteger>,
pub associated_parking_extension: Option<Box<Extension>>,
}
impl AssociatedParking {
const FIELDS: &'static [u32] = &[0x20bfe, 0x2080c, 0x20777, 0x20425, 0x10708, 0x10bfb, 0x106f4, 0x10426];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10039);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20bfe => { let v = r.enumeration::<afac::FacilityTypeEnum>()?; r.set(&mut e0, v, 3070); }
0x2080c => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e1, v.map(Box::new), 2060); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e2, v, 1911); }
0x20425 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1061); }
0x10708 => { let v = r.value::<u64>()?; r.set(&mut e4, v, 1800); }
0x10bfb => { let v = r.value::<u64>()?; r.set(&mut e5, v, 3067); }
0x106f4 => { let v = r.value::<u64>()?; r.set(&mut e6, v, 1780); }
0x10426 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1062); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3070);
let v = Self {
r#type: e0,
facility_reference: e1,
description: e2,
associated_facility_extension: e3,
car_parking_capacity: e4,
truck_parking_capacity: e5,
bike_parking_capacity: e6,
associated_parking_extension: e7,
};
r.close();
Ok(v)
}
}
impl AssociatedParking {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.r#type {
Some(v) => { w.enumeration("afac:type", v.literal())?; }
None => return Err(w.missing("afac:type")),
}
if let Some(v) = &self.facility_reference { v.write(w, "afac:facilityReference", "", " targetClass=\"afac:FacilityObject\"")?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
if let Some(v) = &self.associated_facility_extension { w.extension("afac:_associatedFacilityExtension", v)?; }
if let Some(v) = &self.car_parking_capacity { w.leaf("aegi:carParkingCapacity", v)?; }
if let Some(v) = &self.truck_parking_capacity { w.leaf("aegi:truckParkingCapacity", v)?; }
if let Some(v) = &self.bike_parking_capacity { w.leaf("aegi:bikeParkingCapacity", v)?; }
if let Some(v) = &self.associated_parking_extension { w.extension("aegi:_associatedParkingExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Connector {
pub connector_type: Option<ConnectorTypeEnum>,
pub other_connector: Option<String>,
pub country_of_domestic_socket: Vec<com::CountryCode>,
pub connector_format: Option<ConnectorFormatTypeEnum>,
pub max_power_at_socket: Option<Watt>,
pub voltage: Option<Volt>,
pub maximum_current: Option<Ampere>,
pub external_identifier: Vec<afac::ExternalIdentifier>,
pub connector_extension: Option<Box<Extension>>,
}
impl Connector {
const FIELDS: &'static [u32] = &[0x10737, 0x109e6, 0x10749, 0x10736, 0x10901, 0x10c69, 0x10906, 0x10805, 0x10446];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1005a);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10737 => { let v = r.enumeration::<ConnectorTypeEnum>()?; r.set(&mut e0, v, 1847); }
0x109e6 => { let v = r.string()?; r.set(&mut e1, v, 2534); }
0x10749 => { let v = r.string()?; e2.extend(v); }
0x10736 => { let v = r.enumeration::<ConnectorFormatTypeEnum>()?; r.set(&mut e3, v, 1846); }
0x10901 => { let v = r.value::<f32>()?; r.set(&mut e4, v, 2305); }
0x10c69 => { let v = r.value::<f32>()?; r.set(&mut e5, v, 3177); }
0x10906 => { let v = r.value::<f32>()?; r.set(&mut e6, v, 2310); }
0x10805 => { let v = Some(afac::ExternalIdentifier::read(r)?); e7.extend(v); }
0x10446 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1094); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1847);
r.required(&e4, 2305);
let v = Self {
connector_type: e0,
other_connector: e1,
country_of_domestic_socket: e2,
connector_format: e3,
max_power_at_socket: e4,
voltage: e5,
maximum_current: e6,
external_identifier: e7,
connector_extension: e8,
};
r.close();
Ok(v)
}
}
impl Connector {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.connector_type {
Some(v) => { w.enumeration("aegi:connectorType", v.literal())?; }
None => return Err(w.missing("aegi:connectorType")),
}
if let Some(v) = &self.other_connector { w.max_len("otherConnector", v, 1024)?; w.leaf("aegi:otherConnector", v)?; }
for v in &self.country_of_domestic_socket { w.max_len("countryOfDomesticSocket", v, 2)?; w.leaf("aegi:countryOfDomesticSocket", v)?; }
if let Some(v) = &self.connector_format { w.enumeration("aegi:connectorFormat", v.literal())?; }
match &self.max_power_at_socket {
Some(v) => { w.leaf("aegi:maxPowerAtSocket", v)?; }
None => return Err(w.missing("aegi:maxPowerAtSocket")),
}
if let Some(v) = &self.voltage { w.leaf("aegi:voltage", v)?; }
if let Some(v) = &self.maximum_current { w.leaf("aegi:maximumCurrent", v)?; }
for v in &self.external_identifier { v.write(w, "aegi:externalIdentifier", "", "")?; }
if let Some(v) = &self.connector_extension { w.extension("aegi:_connectorExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DedicatedParkingSpaces {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<afac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub external_identifier: Vec<afac::ExternalIdentifier>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<afac::Image>,
pub operating_hours: Option<afac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<afac::Organisation>,
pub operator: Option<afac::Organisation>,
pub helpdesk: Option<afac::Organisation>,
pub associated_facility: Vec<afac::AnyAssociatedFacility>,
pub rates: Option<afac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<afac::Dimension>>,
pub amenities: Option<Box<afac::Amenities>>,
pub facility_object_extension: Option<Box<Extension>>,
pub number_of_spaces: Option<com::NonNegativeInteger>,
pub user_specific: Vec<afac::UserTypeEnum>,
pub dedicated_parking_spaces_extension: Option<Box<Extension>>,
}
impl DedicatedParkingSpaces {
const FIELDS: &'static [u32] = &[0x20949, 0x206ad, 0x208ba, 0x20777, 0x2066b, 0x20690, 0x20805, 0x20887, 0x20a2d, 0x20a2c, 0x209c5, 0x208e8, 0x209f8, 0x209d2, 0x20864, 0x206d3, 0x20ab0, 0x206c6, 0x20786, 0x206b8, 0x20497, 0x10982, 0x10c1e, 0x10458];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1006d);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = None;
let mut e22 = Vec::new();
let mut e23 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x206ad => { let v = r.multilingual()?; e1.extend(v); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x2066b => { let v = r.enumeration::<afac::AccessibilityEnum>()?; e4.extend(v); }
0x20690 => { let v = r.multilingual()?; e5.extend(v); }
0x20805 => { let v = Some(afac::ExternalIdentifier::read(r)?); e6.extend(v); }
0x20887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x20a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x20a2c => { let v = Some(afac::Image::read(r)?); e9.extend(v); }
0x209c5 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x209f8 => { let v = afac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x209d2 => { let v = afac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x20864 => { let v = afac::Organisation::read(r)?; r.set(&mut e14, v, 2148); }
0x206d3 => { let v = afac::AnyAssociatedFacility::read(r)?; e15.extend(v); }
0x20ab0 => { let v = afac::Rates::read(r)?; r.set(&mut e16, v, 2736); }
0x206c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e17.extend(v); }
0x20786 => { let v = Some(afac::Dimension::read(r)?); r.set(&mut e18, v.map(Box::new), 1926); }
0x206b8 => { let v = Some(afac::Amenities::read(r)?); r.set(&mut e19, v.map(Box::new), 1720); }
0x20497 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1175); }
0x10982 => { let v = r.value::<u64>()?; r.set(&mut e21, v, 2434); }
0x10c1e => { let v = r.enumeration::<afac::UserTypeEnum>()?; e22.extend(v); }
0x10458 => { let v = r.raw()?; r.set(&mut e23, v.map(Box::new), 1112); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e21, 2434);
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
last_updated: e2,
description: e3,
accessibility: e4,
additional_information: e5,
external_identifier: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
helpdesk: e14,
associated_facility: e15,
rates: e16,
applicable_for_vehicles: e17,
dimension: e18,
amenities: e19,
facility_object_extension: e20,
number_of_spaces: e21,
user_specific: e22,
dedicated_parking_spaces_extension: e23,
};
r.close();
Ok(v)
}
}
impl DedicatedParkingSpaces {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.name { w.multilingual("afac:name", v)?; }
for v in &self.alias { w.multilingual("afac:alias", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
for v in &self.accessibility { w.enumeration("afac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("afac:additionalInformation", v)?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.information_website { v.write(w, "afac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "afac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "afac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "afac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "afac:operator")?; }
if let Some(v) = &self.helpdesk { v.write(w, "afac:helpdesk")?; }
for v in &self.associated_facility { v.write(w, "afac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "afac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "afac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "afac:dimension", "", "")?; }
if let Some(v) = &self.amenities { v.write(w, "afac:amenities", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("afac:_facilityObjectExtension", v)?; }
match &self.number_of_spaces {
Some(v) => { w.leaf("aegi:numberOfSpaces", v)?; }
None => return Err(w.missing("aegi:numberOfSpaces")),
}
for v in &self.user_specific { w.enumeration("aegi:userSpecific", v.literal())?; }
if let Some(v) = &self.dedicated_parking_spaces_extension { w.extension("aegi:_dedicatedParkingSpacesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DieselRefillPoint {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<afac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub external_identifier: Vec<afac::ExternalIdentifier>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<afac::Image>,
pub operating_hours: Option<afac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<afac::Organisation>,
pub operator: Option<afac::Organisation>,
pub helpdesk: Option<afac::Organisation>,
pub associated_facility: Vec<afac::AnyAssociatedFacility>,
pub rates: Option<afac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<afac::Dimension>>,
pub amenities: Option<Box<afac::Amenities>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<afac::SupplementalFacility>,
pub dedicated_parking_spaces: Vec<DedicatedParkingSpaces>,
pub facility_extension: Option<Box<Extension>>,
pub delivery_unit: Option<DeliveryUnitEnum>,
pub maximum_delivery_amount: Option<Units>,
pub minimum_delivery_amount: Option<Units>,
pub model_type: Option<MultilingualString>,
pub reservation: Option<afac::ReservationTypeEnum>,
pub energy_product: Vec<AnyEnergyProduct>,
pub refill_point_extension: Option<Box<Extension>>,
pub diesel_vehicle_type: Option<DieselVehicleTypeEnum>,
pub cetane: Option<com::NonNegativeInteger>,
pub bio_diesel_share: Option<com::Percentage>,
pub diesel_refill_point_extension: Option<Box<Extension>>,
}
impl DieselRefillPoint {
const FIELDS: &'static [u32] = &[0x20949, 0x206ad, 0x208ba, 0x20777, 0x2066b, 0x20690, 0x20805, 0x20887, 0x20a2d, 0x20a2c, 0x209c5, 0x208e8, 0x209f8, 0x209d2, 0x20864, 0x206d3, 0x20ab0, 0x206c6, 0x20786, 0x206b8, 0x20497, 0x20b90, 0x20764, 0x20496, 0x1076d, 0x10907, 0x10936, 0x10946, 0x10ae4, 0x107d5, 0x10592, 0x10785, 0x10713, 0x106f6, 0x10467];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1007c);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = Vec::new();
let mut e22 = Vec::new();
let mut e23 = None;
let mut e24 = None;
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = None;
let mut e29 = Vec::new();
let mut e30 = None;
let mut e31 = None;
let mut e32 = None;
let mut e33 = None;
let mut e34 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x206ad => { let v = r.multilingual()?; e1.extend(v); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x2066b => { let v = r.enumeration::<afac::AccessibilityEnum>()?; e4.extend(v); }
0x20690 => { let v = r.multilingual()?; e5.extend(v); }
0x20805 => { let v = Some(afac::ExternalIdentifier::read(r)?); e6.extend(v); }
0x20887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x20a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x20a2c => { let v = Some(afac::Image::read(r)?); e9.extend(v); }
0x209c5 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x209f8 => { let v = afac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x209d2 => { let v = afac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x20864 => { let v = afac::Organisation::read(r)?; r.set(&mut e14, v, 2148); }
0x206d3 => { let v = afac::AnyAssociatedFacility::read(r)?; e15.extend(v); }
0x20ab0 => { let v = afac::Rates::read(r)?; r.set(&mut e16, v, 2736); }
0x206c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e17.extend(v); }
0x20786 => { let v = Some(afac::Dimension::read(r)?); r.set(&mut e18, v.map(Box::new), 1926); }
0x206b8 => { let v = Some(afac::Amenities::read(r)?); r.set(&mut e19, v.map(Box::new), 1720); }
0x20497 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1175); }
0x20b90 => { let v = afac::SupplementalFacility::read(r)?; e21.extend(v); }
0x20764 => { let v = Some(DedicatedParkingSpaces::read(r)?); e22.extend(v); }
0x20496 => { let v = r.raw()?; r.set(&mut e23, v.map(Box::new), 1174); }
0x1076d => { let v = r.enumeration::<DeliveryUnitEnum>()?; r.set(&mut e24, v, 1901); }
0x10907 => { let v = r.value::<f32>()?; r.set(&mut e25, v, 2311); }
0x10936 => { let v = r.value::<f32>()?; r.set(&mut e26, v, 2358); }
0x10946 => { let v = r.multilingual()?; r.set(&mut e27, v, 2374); }
0x10ae4 => { let v = r.enumeration::<afac::ReservationTypeEnum>()?; r.set(&mut e28, v, 2788); }
0x107d5 => { let v = AnyEnergyProduct::read(r)?; e29.extend(v); }
0x10592 => { let v = r.raw()?; r.set(&mut e30, v.map(Box::new), 1426); }
0x10785 => { let v = r.enumeration::<DieselVehicleTypeEnum>()?; r.set(&mut e31, v, 1925); }
0x10713 => { let v = r.value::<u64>()?; r.set(&mut e32, v, 1811); }
0x106f6 => { let v = r.value::<f32>()?; r.set(&mut e33, v, 1782); }
0x10467 => { let v = r.raw()?; r.set(&mut e34, v.map(Box::new), 1127); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e24, 1901);
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
last_updated: e2,
description: e3,
accessibility: e4,
additional_information: e5,
external_identifier: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
helpdesk: e14,
associated_facility: e15,
rates: e16,
applicable_for_vehicles: e17,
dimension: e18,
amenities: e19,
facility_object_extension: e20,
supplemental_facility: e21,
dedicated_parking_spaces: e22,
facility_extension: e23,
delivery_unit: e24,
maximum_delivery_amount: e25,
minimum_delivery_amount: e26,
model_type: e27,
reservation: e28,
energy_product: e29,
refill_point_extension: e30,
diesel_vehicle_type: e31,
cetane: e32,
bio_diesel_share: e33,
diesel_refill_point_extension: e34,
};
r.close();
Ok(v)
}
}
impl DieselRefillPoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.name { w.multilingual("afac:name", v)?; }
for v in &self.alias { w.multilingual("afac:alias", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
for v in &self.accessibility { w.enumeration("afac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("afac:additionalInformation", v)?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.information_website { v.write(w, "afac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "afac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "afac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "afac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "afac:operator")?; }
if let Some(v) = &self.helpdesk { v.write(w, "afac:helpdesk")?; }
for v in &self.associated_facility { v.write(w, "afac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "afac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "afac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "afac:dimension", "", "")?; }
if let Some(v) = &self.amenities { v.write(w, "afac:amenities", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("afac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "afac:supplementalFacility")?; }
for v in &self.dedicated_parking_spaces { v.write(w, "afac:dedicatedParkingSpaces", "", "")?; }
if let Some(v) = &self.facility_extension { w.extension("afac:_facilityExtension", v)?; }
match &self.delivery_unit {
Some(v) => { w.enumeration("aegi:deliveryUnit", v.literal())?; }
None => return Err(w.missing("aegi:deliveryUnit")),
}
if let Some(v) = &self.maximum_delivery_amount { w.leaf("aegi:maximumDeliveryAmount", v)?; }
if let Some(v) = &self.minimum_delivery_amount { w.leaf("aegi:minimumDeliveryAmount", v)?; }
if let Some(v) = &self.model_type { w.multilingual("aegi:modelType", v)?; }
if let Some(v) = &self.reservation { w.enumeration("aegi:reservation", v.literal())?; }
for v in &self.energy_product { v.write(w, "aegi:energyProduct")?; }
if let Some(v) = &self.refill_point_extension { w.extension("aegi:_refillPointExtension", v)?; }
if let Some(v) = &self.diesel_vehicle_type { w.enumeration("aegi:dieselVehicleType", v.literal())?; }
if let Some(v) = &self.cetane { w.leaf("aegi:cetane", v)?; }
if let Some(v) = &self.bio_diesel_share { w.leaf("aegi:bioDieselShare", v)?; }
if let Some(v) = &self.diesel_refill_point_extension { w.extension("aegi:_dieselRefillPointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ElectricChargingEquipment {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<afac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub external_identifier: Vec<afac::ExternalIdentifier>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<afac::Image>,
pub operating_hours: Option<afac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<afac::Organisation>,
pub operator: Option<afac::Organisation>,
pub helpdesk: Option<afac::Organisation>,
pub associated_facility: Vec<afac::AnyAssociatedFacility>,
pub rates: Option<afac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<afac::Dimension>>,
pub amenities: Option<Box<afac::Amenities>>,
pub facility_object_extension: Option<Box<Extension>>,
pub availability: Option<afac::AvailabilityEnum>,
pub quantity: Option<com::NonNegativeInteger>,
pub regularly_cleaned: Option<com::Boolean>,
pub applicable_for_user: Vec<afac::UserTypeEnum>,
pub nearby: Option<com::Boolean>,
pub supplemental_facility_extension: Option<Box<Extension>>,
pub electric_charging_point: Option<Box<ElectricChargingPoint>>,
pub electric_charging_equipment_extension: Option<Box<Extension>>,
}
impl ElectricChargingEquipment {
const FIELDS: &'static [u32] = &[0x20949, 0x206ad, 0x208ba, 0x20777, 0x2066b, 0x20690, 0x20805, 0x20887, 0x20a2d, 0x20a2c, 0x209c5, 0x208e8, 0x209f8, 0x209d2, 0x20864, 0x206d3, 0x20ab0, 0x206c6, 0x20786, 0x206b8, 0x20497, 0x206dc, 0x20a98, 0x20acc, 0x206c5, 0x20954, 0x205dc, 0x107b8, 0x1047b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10090);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = None;
let mut e22 = None;
let mut e23 = None;
let mut e24 = Vec::new();
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x206ad => { let v = r.multilingual()?; e1.extend(v); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x2066b => { let v = r.enumeration::<afac::AccessibilityEnum>()?; e4.extend(v); }
0x20690 => { let v = r.multilingual()?; e5.extend(v); }
0x20805 => { let v = Some(afac::ExternalIdentifier::read(r)?); e6.extend(v); }
0x20887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x20a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x20a2c => { let v = Some(afac::Image::read(r)?); e9.extend(v); }
0x209c5 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x209f8 => { let v = afac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x209d2 => { let v = afac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x20864 => { let v = afac::Organisation::read(r)?; r.set(&mut e14, v, 2148); }
0x206d3 => { let v = afac::AnyAssociatedFacility::read(r)?; e15.extend(v); }
0x20ab0 => { let v = afac::Rates::read(r)?; r.set(&mut e16, v, 2736); }
0x206c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e17.extend(v); }
0x20786 => { let v = Some(afac::Dimension::read(r)?); r.set(&mut e18, v.map(Box::new), 1926); }
0x206b8 => { let v = Some(afac::Amenities::read(r)?); r.set(&mut e19, v.map(Box::new), 1720); }
0x20497 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1175); }
0x206dc => { let v = r.enumeration::<afac::AvailabilityEnum>()?; r.set(&mut e21, v, 1756); }
0x20a98 => { let v = r.value::<u64>()?; r.set(&mut e22, v, 2712); }
0x20acc => { let v = r.value::<bool>()?; r.set(&mut e23, v, 2764); }
0x206c5 => { let v = r.enumeration::<afac::UserTypeEnum>()?; e24.extend(v); }
0x20954 => { let v = r.value::<bool>()?; r.set(&mut e25, v, 2388); }
0x205dc => { let v = r.raw()?; r.set(&mut e26, v.map(Box::new), 1500); }
0x107b8 => { let v = Some(ElectricChargingPoint::read(r)?); r.set(&mut e27, v.map(Box::new), 1976); }
0x1047b => { let v = r.raw()?; r.set(&mut e28, v.map(Box::new), 1147); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e27, 1976);
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
last_updated: e2,
description: e3,
accessibility: e4,
additional_information: e5,
external_identifier: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
helpdesk: e14,
associated_facility: e15,
rates: e16,
applicable_for_vehicles: e17,
dimension: e18,
amenities: e19,
facility_object_extension: e20,
availability: e21,
quantity: e22,
regularly_cleaned: e23,
applicable_for_user: e24,
nearby: e25,
supplemental_facility_extension: e26,
electric_charging_point: e27,
electric_charging_equipment_extension: e28,
};
r.close();
Ok(v)
}
}
impl ElectricChargingEquipment {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.name { w.multilingual("afac:name", v)?; }
for v in &self.alias { w.multilingual("afac:alias", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
for v in &self.accessibility { w.enumeration("afac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("afac:additionalInformation", v)?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.information_website { v.write(w, "afac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "afac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "afac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "afac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "afac:operator")?; }
if let Some(v) = &self.helpdesk { v.write(w, "afac:helpdesk")?; }
for v in &self.associated_facility { v.write(w, "afac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "afac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "afac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "afac:dimension", "", "")?; }
if let Some(v) = &self.amenities { v.write(w, "afac:amenities", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("afac:_facilityObjectExtension", v)?; }
if let Some(v) = &self.availability { w.enumeration("afac:availability", v.literal())?; }
if let Some(v) = &self.quantity { w.leaf("afac:quantity", v)?; }
if let Some(v) = &self.regularly_cleaned { w.leaf("afac:regularlyCleaned", v)?; }
for v in &self.applicable_for_user { w.enumeration("afac:applicableForUser", v.literal())?; }
if let Some(v) = &self.nearby { w.leaf("afac:nearby", v)?; }
if let Some(v) = &self.supplemental_facility_extension { w.extension("afac:_supplementalFacilityExtension", v)?; }
match &self.electric_charging_point {
Some(v) => { v.write(w, "aegi:electricChargingPoint", "", "")?; }
None => return Err(w.missing("aegi:electricChargingPoint")),
}
if let Some(v) = &self.electric_charging_equipment_extension { w.extension("aegi:_electricChargingEquipmentExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ElectricChargingPoint {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<afac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub external_identifier: Vec<afac::ExternalIdentifier>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<afac::Image>,
pub operating_hours: Option<afac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<afac::Organisation>,
pub operator: Option<afac::Organisation>,
pub helpdesk: Option<afac::Organisation>,
pub associated_facility: Vec<afac::AnyAssociatedFacility>,
pub rates: Option<afac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<afac::Dimension>>,
pub amenities: Option<Box<afac::Amenities>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<afac::SupplementalFacility>,
pub dedicated_parking_spaces: Vec<DedicatedParkingSpaces>,
pub facility_extension: Option<Box<Extension>>,
pub delivery_unit: Option<DeliveryUnitEnum>,
pub maximum_delivery_amount: Option<Units>,
pub minimum_delivery_amount: Option<Units>,
pub model_type: Option<MultilingualString>,
pub reservation: Option<afac::ReservationTypeEnum>,
pub energy_product: Vec<AnyEnergyProduct>,
pub refill_point_extension: Option<Box<Extension>>,
pub current_type: Option<CurrentTypeEnum>,
pub usage_type: Vec<ChargingPointUsageTypeEnum>,
pub vehicle_to_grid_communication_type: Vec<VehicleToGridCommunicationTypeEnum>,
pub number_of_connectors: Option<com::NonNegativeInteger>,
pub available_voltage: Vec<Volt>,
pub available_charging_power: Vec<Watt>,
pub charging_mode: Option<ChargingModeEnum>,
pub smart_recharging_services: Vec<SmartRechargingServicesEnum>,
pub other_smart_recharging_services: Vec<MultilingualString>,
pub connector: Vec<Connector>,
pub electric_charging_point_extension: Option<Box<Extension>>,
}
impl ElectricChargingPoint {
const FIELDS: &'static [u32] = &[0x20949, 0x206ad, 0x208ba, 0x20777, 0x2066b, 0x20690, 0x20805, 0x20887, 0x20a2d, 0x20a2c, 0x209c5, 0x208e8, 0x209f8, 0x209d2, 0x20864, 0x206d3, 0x20ab0, 0x206c6, 0x20786, 0x206b8, 0x20497, 0x20b90, 0x20764, 0x20496, 0x1076d, 0x10907, 0x10936, 0x10946, 0x10ae4, 0x107d5, 0x10592, 0x10753, 0x10c1a, 0x10c48, 0x10972, 0x106e2, 0x106df, 0x10716, 0x10b4a, 0x109eb, 0x10735, 0x1047c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10091);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = Vec::new();
let mut e22 = Vec::new();
let mut e23 = None;
let mut e24 = None;
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = None;
let mut e29 = Vec::new();
let mut e30 = None;
let mut e31 = None;
let mut e32 = Vec::new();
let mut e33 = Vec::new();
let mut e34 = None;
let mut e35 = Vec::new();
let mut e36 = Vec::new();
let mut e37 = None;
let mut e38 = Vec::new();
let mut e39 = Vec::new();
let mut e40 = Vec::new();
let mut e41 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x206ad => { let v = r.multilingual()?; e1.extend(v); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x2066b => { let v = r.enumeration::<afac::AccessibilityEnum>()?; e4.extend(v); }
0x20690 => { let v = r.multilingual()?; e5.extend(v); }
0x20805 => { let v = Some(afac::ExternalIdentifier::read(r)?); e6.extend(v); }
0x20887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x20a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x20a2c => { let v = Some(afac::Image::read(r)?); e9.extend(v); }
0x209c5 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x209f8 => { let v = afac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x209d2 => { let v = afac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x20864 => { let v = afac::Organisation::read(r)?; r.set(&mut e14, v, 2148); }
0x206d3 => { let v = afac::AnyAssociatedFacility::read(r)?; e15.extend(v); }
0x20ab0 => { let v = afac::Rates::read(r)?; r.set(&mut e16, v, 2736); }
0x206c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e17.extend(v); }
0x20786 => { let v = Some(afac::Dimension::read(r)?); r.set(&mut e18, v.map(Box::new), 1926); }
0x206b8 => { let v = Some(afac::Amenities::read(r)?); r.set(&mut e19, v.map(Box::new), 1720); }
0x20497 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1175); }
0x20b90 => { let v = afac::SupplementalFacility::read(r)?; e21.extend(v); }
0x20764 => { let v = Some(DedicatedParkingSpaces::read(r)?); e22.extend(v); }
0x20496 => { let v = r.raw()?; r.set(&mut e23, v.map(Box::new), 1174); }
0x1076d => { let v = r.enumeration::<DeliveryUnitEnum>()?; r.set(&mut e24, v, 1901); }
0x10907 => { let v = r.value::<f32>()?; r.set(&mut e25, v, 2311); }
0x10936 => { let v = r.value::<f32>()?; r.set(&mut e26, v, 2358); }
0x10946 => { let v = r.multilingual()?; r.set(&mut e27, v, 2374); }
0x10ae4 => { let v = r.enumeration::<afac::ReservationTypeEnum>()?; r.set(&mut e28, v, 2788); }
0x107d5 => { let v = AnyEnergyProduct::read(r)?; e29.extend(v); }
0x10592 => { let v = r.raw()?; r.set(&mut e30, v.map(Box::new), 1426); }
0x10753 => { let v = r.enumeration::<CurrentTypeEnum>()?; r.set(&mut e31, v, 1875); }
0x10c1a => { let v = r.enumeration::<ChargingPointUsageTypeEnum>()?; e32.extend(v); }
0x10c48 => { let v = r.enumeration::<VehicleToGridCommunicationTypeEnum>()?; e33.extend(v); }
0x10972 => { let v = r.value::<u64>()?; r.set(&mut e34, v, 2418); }
0x106e2 => { let v = r.value::<f32>()?; e35.extend(v); }
0x106df => { let v = r.value::<f32>()?; e36.extend(v); }
0x10716 => { let v = r.enumeration::<ChargingModeEnum>()?; r.set(&mut e37, v, 1814); }
0x10b4a => { let v = r.enumeration::<SmartRechargingServicesEnum>()?; e38.extend(v); }
0x109eb => { let v = r.multilingual()?; e39.extend(v); }
0x10735 => { let v = Some(Connector::read(r)?); e40.extend(v); }
0x1047c => { let v = r.raw()?; r.set(&mut e41, v.map(Box::new), 1148); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e24, 1901);
r.required(&e31, 1875);
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
last_updated: e2,
description: e3,
accessibility: e4,
additional_information: e5,
external_identifier: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
helpdesk: e14,
associated_facility: e15,
rates: e16,
applicable_for_vehicles: e17,
dimension: e18,
amenities: e19,
facility_object_extension: e20,
supplemental_facility: e21,
dedicated_parking_spaces: e22,
facility_extension: e23,
delivery_unit: e24,
maximum_delivery_amount: e25,
minimum_delivery_amount: e26,
model_type: e27,
reservation: e28,
energy_product: e29,
refill_point_extension: e30,
current_type: e31,
usage_type: e32,
vehicle_to_grid_communication_type: e33,
number_of_connectors: e34,
available_voltage: e35,
available_charging_power: e36,
charging_mode: e37,
smart_recharging_services: e38,
other_smart_recharging_services: e39,
connector: e40,
electric_charging_point_extension: e41,
};
r.close();
Ok(v)
}
}
impl ElectricChargingPoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.name { w.multilingual("afac:name", v)?; }
for v in &self.alias { w.multilingual("afac:alias", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
for v in &self.accessibility { w.enumeration("afac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("afac:additionalInformation", v)?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.information_website { v.write(w, "afac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "afac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "afac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "afac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "afac:operator")?; }
if let Some(v) = &self.helpdesk { v.write(w, "afac:helpdesk")?; }
for v in &self.associated_facility { v.write(w, "afac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "afac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "afac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "afac:dimension", "", "")?; }
if let Some(v) = &self.amenities { v.write(w, "afac:amenities", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("afac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "afac:supplementalFacility")?; }
for v in &self.dedicated_parking_spaces { v.write(w, "afac:dedicatedParkingSpaces", "", "")?; }
if let Some(v) = &self.facility_extension { w.extension("afac:_facilityExtension", v)?; }
match &self.delivery_unit {
Some(v) => { w.enumeration("aegi:deliveryUnit", v.literal())?; }
None => return Err(w.missing("aegi:deliveryUnit")),
}
if let Some(v) = &self.maximum_delivery_amount { w.leaf("aegi:maximumDeliveryAmount", v)?; }
if let Some(v) = &self.minimum_delivery_amount { w.leaf("aegi:minimumDeliveryAmount", v)?; }
if let Some(v) = &self.model_type { w.multilingual("aegi:modelType", v)?; }
if let Some(v) = &self.reservation { w.enumeration("aegi:reservation", v.literal())?; }
for v in &self.energy_product { v.write(w, "aegi:energyProduct")?; }
if let Some(v) = &self.refill_point_extension { w.extension("aegi:_refillPointExtension", v)?; }
match &self.current_type {
Some(v) => { w.enumeration("aegi:currentType", v.literal())?; }
None => return Err(w.missing("aegi:currentType")),
}
for v in &self.usage_type { w.enumeration("aegi:usageType", v.literal())?; }
for v in &self.vehicle_to_grid_communication_type { w.enumeration("aegi:vehicleToGridCommunicationType", v.literal())?; }
if let Some(v) = &self.number_of_connectors { w.leaf("aegi:numberOfConnectors", v)?; }
for v in &self.available_voltage { w.leaf("aegi:availableVoltage", v)?; }
for v in &self.available_charging_power { w.leaf("aegi:availableChargingPower", v)?; }
if let Some(v) = &self.charging_mode { w.enumeration("aegi:chargingMode", v.literal())?; }
for v in &self.smart_recharging_services { w.enumeration("aegi:smartRechargingServices", v.literal())?; }
for v in &self.other_smart_recharging_services { w.multilingual("aegi:otherSmartRechargingServices", v)?; }
for v in &self.connector { v.write(w, "aegi:connector", "", "")?; }
if let Some(v) = &self.electric_charging_point_extension { w.extension("aegi:_electricChargingPointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ElectricChargingPointStatus {
pub reference: Option<Box<com::VersionedReference>>,
pub last_updated: Option<DateTime>,
pub opening_status: Option<afac::OpeningStatusEnum>,
pub operation_status: Option<afac::OperationStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<afac::OperatingHours>,
pub new_rates: Option<afac::Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
pub supplemental_facility_status: Vec<afac::SupplementalFacilityStatus>,
pub facility_status_extension: Option<Box<Extension>>,
pub status: Option<RefillPointStatusEnum>,
pub units_in_stock: Option<Units>,
pub energy_rate_update: Vec<EnergyRateUpdate>,
pub waiting_time: Option<Box<afac::DurationValue>>,
pub planned_refill_point_status: Vec<PlannedRefillPointStatus>,
pub refill_point_status_extension: Option<Box<Extension>>,
pub remaining_charging_time: Option<com::Seconds>,
pub current_voltage: Option<Volt>,
pub current_charging_power: Option<Watt>,
pub next_available_charging_slots: Vec<DateTime>,
pub electric_charging_point_status_extension: Option<Box<Extension>>,
}
impl ElectricChargingPointStatus {
const FIELDS: &'static [u32] = &[0x20aba, 0x208ba, 0x209a8, 0x209ce, 0x20aca, 0x20b77, 0x20958, 0x20959, 0x2080d, 0x20498, 0x20b91, 0x20499, 0x10b73, 0x10c0a, 0x107dc, 0x10c6b, 0x10a42, 0x10593, 0x10ad9, 0x10754, 0x10752, 0x1095a, 0x1047d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10092);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = Vec::new();
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = Vec::new();
let mut e15 = None;
let mut e16 = Vec::new();
let mut e17 = None;
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = Vec::new();
let mut e22 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x208ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x209a8 => { let v = r.enumeration::<afac::OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x209ce => { let v = r.enumeration::<afac::OperationStatusEnum>()?; r.set(&mut e3, v, 2510); }
0x20aca => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2762); }
0x20b77 => { let v = r.multilingual()?; r.set(&mut e5, v, 2935); }
0x20958 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e6, v, 2392); }
0x20959 => { let v = afac::Rates::read(r)?; r.set(&mut e7, v, 2393); }
0x2080d => { let v = com::AnyFault::read(r)?; r.set(&mut e8, v, 2061); }
0x20498 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1176); }
0x20b91 => { let v = Some(afac::SupplementalFacilityStatus::read(r)?); e10.extend(v); }
0x20499 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1177); }
0x10b73 => { let v = r.enumeration::<RefillPointStatusEnum>()?; r.set(&mut e12, v, 2931); }
0x10c0a => { let v = r.value::<f32>()?; r.set(&mut e13, v, 3082); }
0x107dc => { let v = Some(EnergyRateUpdate::read(r)?); e14.extend(v); }
0x10c6b => { let v = Some(afac::DurationValue::read(r)?); r.set(&mut e15, v.map(Box::new), 3179); }
0x10a42 => { let v = Some(PlannedRefillPointStatus::read(r)?); e16.extend(v); }
0x10593 => { let v = r.raw()?; r.set(&mut e17, v.map(Box::new), 1427); }
0x10ad9 => { let v = r.value::<f32>()?; r.set(&mut e18, v, 2777); }
0x10754 => { let v = r.value::<f32>()?; r.set(&mut e19, v, 1876); }
0x10752 => { let v = r.value::<f32>()?; r.set(&mut e20, v, 1874); }
0x1095a => { let v = r.date_time()?; e21.extend(v); }
0x1047d => { let v = r.raw()?; r.set(&mut e22, v.map(Box::new), 1149); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2746);
r.required(&e12, 2931);
let v = Self {
reference: e0,
last_updated: e1,
opening_status: e2,
operation_status: e3,
regular_operating_hours_in_force: e4,
status_description: e5,
new_operating_hours: e6,
new_rates: e7,
fault: e8,
facility_object_status_extension: e9,
supplemental_facility_status: e10,
facility_status_extension: e11,
status: e12,
units_in_stock: e13,
energy_rate_update: e14,
waiting_time: e15,
planned_refill_point_status: e16,
refill_point_status_extension: e17,
remaining_charging_time: e18,
current_voltage: e19,
current_charging_power: e20,
next_available_charging_slots: e21,
electric_charging_point_status_extension: e22,
};
r.close();
Ok(v)
}
}
impl ElectricChargingPointStatus {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.reference {
Some(v) => { v.write(w, "afac:reference", "", " targetClass=\"afac:FacilityObject\"")?; }
None => return Err(w.missing("afac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("afac:openingStatus", v.literal())?; }
if let Some(v) = &self.operation_status { w.enumeration("afac:operationStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("afac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("afac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "afac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "afac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "afac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("afac:_facilityObjectStatusExtension", v)?; }
for v in &self.supplemental_facility_status { v.write(w, "afac:supplementalFacilityStatus", "", "")?; }
if let Some(v) = &self.facility_status_extension { w.extension("afac:_facilityStatusExtension", v)?; }
match &self.status {
Some(v) => { w.enumeration("aegi:status", v.literal())?; }
None => return Err(w.missing("aegi:status")),
}
if let Some(v) = &self.units_in_stock { w.leaf("aegi:unitsInStock", v)?; }
for v in &self.energy_rate_update { v.write(w, "aegi:energyRateUpdate", "", "")?; }
if let Some(v) = &self.waiting_time { v.write(w, "aegi:waitingTime", "", "")?; }
for v in &self.planned_refill_point_status { v.write(w, "aegi:plannedRefillPointStatus", "", "")?; }
if let Some(v) = &self.refill_point_status_extension { w.extension("aegi:_refillPointStatusExtension", v)?; }
if let Some(v) = &self.remaining_charging_time { w.leaf("aegi:remainingChargingTime", v)?; }
if let Some(v) = &self.current_voltage { w.leaf("aegi:currentVoltage", v)?; }
if let Some(v) = &self.current_charging_power { w.leaf("aegi:currentChargingPower", v)?; }
for v in &self.next_available_charging_slots { w.leaf("aegi:nextAvailableChargingSlots", v)?; }
if let Some(v) = &self.electric_charging_point_status_extension { w.extension("aegi:_electricChargingPointStatusExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ElectricEnergy {
pub energy_product_name: Option<MultilingualString>,
pub is_green_energy: Option<com::Boolean>,
pub energy_rate_by_reference: Vec<com::Reference>,
pub energy_product_information: Option<com::Url>,
pub renewable_energy_evidence: Option<com::Url>,
pub mobility_service_provider: Vec<afac::Organisation>,
pub energy_rate: Vec<EnergyRate>,
pub energy_product_extension: Option<Box<Extension>>,
pub carbon_dioxide_impact: Option<GramsPerKilowattHour>,
pub nuclear_waste_impact: Option<GramsPerKilowattHour>,
pub electric_energy_source_ratio: Vec<ElectricEnergySourceRatio>,
pub electric_energy_extension: Option<Box<Extension>>,
}
impl ElectricEnergy {
const FIELDS: &'static [u32] = &[0x107d7, 0x1089b, 0x107da, 0x107d6, 0x10adb, 0x10942, 0x107d9, 0x1048d, 0x10709, 0x1096f, 0x107bb, 0x1047e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10093);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = Vec::new();
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x107d7 => { let v = r.multilingual()?; r.set(&mut e0, v, 2007); }
0x1089b => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2203); }
0x107da => { let v = Some(com::Reference::read(r)?); e2.extend(v); }
0x107d6 => { let v = r.string()?; r.set(&mut e3, v, 2006); }
0x10adb => { let v = r.string()?; r.set(&mut e4, v, 2779); }
0x10942 => { let v = afac::Organisation::read(r)?; e5.extend(v); }
0x107d9 => { let v = Some(EnergyRate::read(r)?); e6.extend(v); }
0x1048d => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1165); }
0x10709 => { let v = r.value::<f32>()?; r.set(&mut e8, v, 1801); }
0x1096f => { let v = r.value::<f32>()?; r.set(&mut e9, v, 2415); }
0x107bb => { let v = Some(ElectricEnergySourceRatio::read(r)?); e10.extend(v); }
0x1047e => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1150); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
energy_product_name: e0,
is_green_energy: e1,
energy_rate_by_reference: e2,
energy_product_information: e3,
renewable_energy_evidence: e4,
mobility_service_provider: e5,
energy_rate: e6,
energy_product_extension: e7,
carbon_dioxide_impact: e8,
nuclear_waste_impact: e9,
electric_energy_source_ratio: e10,
electric_energy_extension: e11,
};
r.close();
Ok(v)
}
}
impl ElectricEnergy {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.energy_product_name { w.multilingual("aegi:energyProductName", v)?; }
if let Some(v) = &self.is_green_energy { w.leaf("aegi:isGreenEnergy", v)?; }
for v in &self.energy_rate_by_reference { v.write(w, "aegi:energyRateByReference", "", " targetClass=\"aegi:EnergyRate\"")?; }
if let Some(v) = &self.energy_product_information { w.leaf("aegi:energyProductInformation", v)?; }
if let Some(v) = &self.renewable_energy_evidence { w.leaf("aegi:renewableEnergyEvidence", v)?; }
for v in &self.mobility_service_provider { v.write(w, "aegi:mobilityServiceProvider")?; }
for v in &self.energy_rate { v.write(w, "aegi:energyRate", "", "")?; }
if let Some(v) = &self.energy_product_extension { w.extension("aegi:_energyProductExtension", v)?; }
if let Some(v) = &self.carbon_dioxide_impact { w.leaf("aegi:carbonDioxideImpact", v)?; }
if let Some(v) = &self.nuclear_waste_impact { w.leaf("aegi:nuclearWasteImpact", v)?; }
for v in &self.electric_energy_source_ratio { v.write(w, "aegi:electricEnergySourceRatio", "", "")?; }
if let Some(v) = &self.electric_energy_extension { w.extension("aegi:_electricEnergyExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ElectricEnergySourceRatio {
pub energy_source: Option<ElectricEnergySourceTypeEnum>,
pub other_energy_source: Option<String>,
pub source_ratio_value: Option<Box<com::PercentageValue>>,
pub electric_energy_source_ratio_extension: Option<Box<Extension>>,
}
impl ElectricEnergySourceRatio {
const FIELDS: &'static [u32] = &[0x107dd, 0x109e7, 0x10b52, 0x10480];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10095);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x107dd => { let v = r.enumeration::<ElectricEnergySourceTypeEnum>()?; r.set(&mut e0, v, 2013); }
0x109e7 => { let v = r.string()?; r.set(&mut e1, v, 2535); }
0x10b52 => { let v = Some(com::PercentageValue::read(r)?); r.set(&mut e2, v.map(Box::new), 2898); }
0x10480 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1152); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2013);
r.required(&e2, 2898);
let v = Self {
energy_source: e0,
other_energy_source: e1,
source_ratio_value: e2,
electric_energy_source_ratio_extension: e3,
};
r.close();
Ok(v)
}
}
impl ElectricEnergySourceRatio {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.energy_source {
Some(v) => { w.enumeration("aegi:energySource", v.literal())?; }
None => return Err(w.missing("aegi:energySource")),
}
if let Some(v) = &self.other_energy_source { w.max_len("otherEnergySource", v, 1024)?; w.leaf("aegi:otherEnergySource", v)?; }
match &self.source_ratio_value {
Some(v) => { v.write(w, "aegi:sourceRatioValue", "", "")?; }
None => return Err(w.missing("aegi:sourceRatioValue")),
}
if let Some(v) = &self.electric_energy_source_ratio_extension { w.extension("aegi:_electricEnergySourceRatioExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyBasedApplicability {
pub from_k_wh: Option<com::NonNegativeInteger>,
pub to_k_wh: Option<com::NonNegativeInteger>,
pub energy_based_applicability_extension: Option<Box<Extension>>,
}
impl EnergyBasedApplicability {
const FIELDS: &'static [u32] = &[0x10831, 0x10bc5, 0x10483];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10099);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10831 => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2097); }
0x10bc5 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 3013); }
0x10483 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1155); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
from_k_wh: e0,
to_k_wh: e1,
energy_based_applicability_extension: e2,
};
r.close();
Ok(v)
}
}
impl EnergyBasedApplicability {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.from_k_wh { w.leaf("aegi:fromKWh", v)?; }
if let Some(v) = &self.to_k_wh { w.leaf("aegi:toKWh", v)?; }
if let Some(v) = &self.energy_based_applicability_extension { w.extension("aegi:_energyBasedApplicabilityExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyInfrastructureSite {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<afac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub external_identifier: Vec<afac::ExternalIdentifier>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<afac::Image>,
pub operating_hours: Option<afac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<afac::Organisation>,
pub operator: Option<afac::Organisation>,
pub helpdesk: Option<afac::Organisation>,
pub associated_facility: Vec<afac::AnyAssociatedFacility>,
pub rates: Option<afac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<afac::Dimension>>,
pub amenities: Option<Box<afac::Amenities>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<afac::SupplementalFacility>,
pub dedicated_parking_spaces: Vec<DedicatedParkingSpaces>,
pub facility_extension: Option<Box<Extension>>,
pub type_of_site: Option<EnergyInfrastructureSiteTypeEnum>,
pub brand: Option<MultilingualString>,
pub exclusive_users: Vec<afac::UserTypeEnum>,
pub preferred_users: Vec<afac::UserTypeEnum>,
pub service_type: Vec<ServiceType>,
pub entrance: Vec<loc::Location>,
pub exit: Vec<loc::Location>,
pub energy_infrastructure_station: Vec<EnergyInfrastructureStation>,
pub energy_distributor: Option<afac::Organisation>,
pub mobility_service_provider: Vec<afac::Organisation>,
pub roaming_platform: Vec<afac::Organisation>,
pub energy_infrastructure_site_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureSite {
const FIELDS: &'static [u32] = &[0x20949, 0x206ad, 0x208ba, 0x20777, 0x2066b, 0x20690, 0x20805, 0x20887, 0x20a2d, 0x20a2c, 0x209c5, 0x208e8, 0x209f8, 0x209d2, 0x20864, 0x206d3, 0x20ab0, 0x206c6, 0x20786, 0x206b8, 0x20497, 0x20b90, 0x20764, 0x20496, 0x10c04, 0x106fd, 0x107f5, 0x10a6c, 0x10b34, 0x107e2, 0x107f7, 0x107cf, 0x107cc, 0x10942, 0x10b09, 0x10484];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1009a);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = Vec::new();
let mut e22 = Vec::new();
let mut e23 = None;
let mut e24 = None;
let mut e25 = None;
let mut e26 = Vec::new();
let mut e27 = Vec::new();
let mut e28 = Vec::new();
let mut e29 = Vec::new();
let mut e30 = Vec::new();
let mut e31 = Vec::new();
let mut e32 = None;
let mut e33 = Vec::new();
let mut e34 = Vec::new();
let mut e35 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x206ad => { let v = r.multilingual()?; e1.extend(v); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x2066b => { let v = r.enumeration::<afac::AccessibilityEnum>()?; e4.extend(v); }
0x20690 => { let v = r.multilingual()?; e5.extend(v); }
0x20805 => { let v = Some(afac::ExternalIdentifier::read(r)?); e6.extend(v); }
0x20887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x20a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x20a2c => { let v = Some(afac::Image::read(r)?); e9.extend(v); }
0x209c5 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x209f8 => { let v = afac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x209d2 => { let v = afac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x20864 => { let v = afac::Organisation::read(r)?; r.set(&mut e14, v, 2148); }
0x206d3 => { let v = afac::AnyAssociatedFacility::read(r)?; e15.extend(v); }
0x20ab0 => { let v = afac::Rates::read(r)?; r.set(&mut e16, v, 2736); }
0x206c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e17.extend(v); }
0x20786 => { let v = Some(afac::Dimension::read(r)?); r.set(&mut e18, v.map(Box::new), 1926); }
0x206b8 => { let v = Some(afac::Amenities::read(r)?); r.set(&mut e19, v.map(Box::new), 1720); }
0x20497 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1175); }
0x20b90 => { let v = afac::SupplementalFacility::read(r)?; e21.extend(v); }
0x20764 => { let v = Some(DedicatedParkingSpaces::read(r)?); e22.extend(v); }
0x20496 => { let v = r.raw()?; r.set(&mut e23, v.map(Box::new), 1174); }
0x10c04 => { let v = r.enumeration::<EnergyInfrastructureSiteTypeEnum>()?; r.set(&mut e24, v, 3076); }
0x106fd => { let v = r.multilingual()?; r.set(&mut e25, v, 1789); }
0x107f5 => { let v = r.enumeration::<afac::UserTypeEnum>()?; e26.extend(v); }
0x10a6c => { let v = r.enumeration::<afac::UserTypeEnum>()?; e27.extend(v); }
0x10b34 => { let v = Some(ServiceType::read(r)?); e28.extend(v); }
0x107e2 => { let v = loc::Location::read(r)?; e29.extend(v); }
0x107f7 => { let v = loc::Location::read(r)?; e30.extend(v); }
0x107cf => { let v = Some(EnergyInfrastructureStation::read(r)?); e31.extend(v); }
0x107cc => { let v = afac::Organisation::read(r)?; r.set(&mut e32, v, 1996); }
0x10942 => { let v = afac::Organisation::read(r)?; e33.extend(v); }
0x10b09 => { let v = afac::Organisation::read(r)?; e34.extend(v); }
0x10484 => { let v = r.raw()?; r.set(&mut e35, v.map(Box::new), 1156); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
last_updated: e2,
description: e3,
accessibility: e4,
additional_information: e5,
external_identifier: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
helpdesk: e14,
associated_facility: e15,
rates: e16,
applicable_for_vehicles: e17,
dimension: e18,
amenities: e19,
facility_object_extension: e20,
supplemental_facility: e21,
dedicated_parking_spaces: e22,
facility_extension: e23,
type_of_site: e24,
brand: e25,
exclusive_users: e26,
preferred_users: e27,
service_type: e28,
entrance: e29,
exit: e30,
energy_infrastructure_station: e31,
energy_distributor: e32,
mobility_service_provider: e33,
roaming_platform: e34,
energy_infrastructure_site_extension: e35,
};
r.close();
Ok(v)
}
}
impl EnergyInfrastructureSite {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.name { w.multilingual("afac:name", v)?; }
for v in &self.alias { w.multilingual("afac:alias", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
for v in &self.accessibility { w.enumeration("afac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("afac:additionalInformation", v)?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.information_website { v.write(w, "afac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "afac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "afac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "afac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "afac:operator")?; }
if let Some(v) = &self.helpdesk { v.write(w, "afac:helpdesk")?; }
for v in &self.associated_facility { v.write(w, "afac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "afac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "afac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "afac:dimension", "", "")?; }
if let Some(v) = &self.amenities { v.write(w, "afac:amenities", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("afac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "afac:supplementalFacility")?; }
for v in &self.dedicated_parking_spaces { v.write(w, "afac:dedicatedParkingSpaces", "", "")?; }
if let Some(v) = &self.facility_extension { w.extension("afac:_facilityExtension", v)?; }
if let Some(v) = &self.type_of_site { w.enumeration("aegi:typeOfSite", v.literal())?; }
if let Some(v) = &self.brand { w.multilingual("aegi:brand", v)?; }
for v in &self.exclusive_users { w.enumeration("aegi:exclusiveUsers", v.literal())?; }
for v in &self.preferred_users { w.enumeration("aegi:preferredUsers", v.literal())?; }
for v in &self.service_type { v.write(w, "aegi:serviceType", "", "")?; }
for v in &self.entrance { v.write(w, "aegi:entrance")?; }
for v in &self.exit { v.write(w, "aegi:exit")?; }
for v in &self.energy_infrastructure_station { v.write(w, "aegi:energyInfrastructureStation", "", "")?; }
if let Some(v) = &self.energy_distributor { v.write(w, "aegi:energyDistributor")?; }
for v in &self.mobility_service_provider { v.write(w, "aegi:mobilityServiceProvider")?; }
for v in &self.roaming_platform { v.write(w, "aegi:roamingPlatform")?; }
if let Some(v) = &self.energy_infrastructure_site_extension { w.extension("aegi:_energyInfrastructureSiteExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyInfrastructureSiteStatus {
pub reference: Option<Box<com::VersionedReference>>,
pub last_updated: Option<DateTime>,
pub opening_status: Option<afac::OpeningStatusEnum>,
pub operation_status: Option<afac::OperationStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<afac::OperatingHours>,
pub new_rates: Option<afac::Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
pub supplemental_facility_status: Vec<afac::SupplementalFacilityStatus>,
pub facility_status_extension: Option<Box<Extension>>,
pub available_car_parking_places: Option<com::NonNegativeInteger>,
pub available_truck_parking_places: Option<com::NonNegativeInteger>,
pub energy_infrastructure_station_status: Vec<EnergyInfrastructureStationStatus>,
pub service_type: Vec<ServiceType>,
pub energy_infrastructure_site_status_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureSiteStatus {
const FIELDS: &'static [u32] = &[0x20aba, 0x208ba, 0x209a8, 0x209ce, 0x20aca, 0x20b77, 0x20958, 0x20959, 0x2080d, 0x20498, 0x20b91, 0x20499, 0x106de, 0x106e1, 0x107d0, 0x10b34, 0x10485];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1009b);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = Vec::new();
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = Vec::new();
let mut e15 = Vec::new();
let mut e16 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x208ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x209a8 => { let v = r.enumeration::<afac::OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x209ce => { let v = r.enumeration::<afac::OperationStatusEnum>()?; r.set(&mut e3, v, 2510); }
0x20aca => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2762); }
0x20b77 => { let v = r.multilingual()?; r.set(&mut e5, v, 2935); }
0x20958 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e6, v, 2392); }
0x20959 => { let v = afac::Rates::read(r)?; r.set(&mut e7, v, 2393); }
0x2080d => { let v = com::AnyFault::read(r)?; r.set(&mut e8, v, 2061); }
0x20498 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1176); }
0x20b91 => { let v = Some(afac::SupplementalFacilityStatus::read(r)?); e10.extend(v); }
0x20499 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1177); }
0x106de => { let v = r.value::<u64>()?; r.set(&mut e12, v, 1758); }
0x106e1 => { let v = r.value::<u64>()?; r.set(&mut e13, v, 1761); }
0x107d0 => { let v = Some(EnergyInfrastructureStationStatus::read(r)?); e14.extend(v); }
0x10b34 => { let v = Some(ServiceType::read(r)?); e15.extend(v); }
0x10485 => { let v = r.raw()?; r.set(&mut e16, v.map(Box::new), 1157); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2746);
let v = Self {
reference: e0,
last_updated: e1,
opening_status: e2,
operation_status: e3,
regular_operating_hours_in_force: e4,
status_description: e5,
new_operating_hours: e6,
new_rates: e7,
fault: e8,
facility_object_status_extension: e9,
supplemental_facility_status: e10,
facility_status_extension: e11,
available_car_parking_places: e12,
available_truck_parking_places: e13,
energy_infrastructure_station_status: e14,
service_type: e15,
energy_infrastructure_site_status_extension: e16,
};
r.close();
Ok(v)
}
}
impl EnergyInfrastructureSiteStatus {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.reference {
Some(v) => { v.write(w, "afac:reference", "", " targetClass=\"afac:FacilityObject\"")?; }
None => return Err(w.missing("afac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("afac:openingStatus", v.literal())?; }
if let Some(v) = &self.operation_status { w.enumeration("afac:operationStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("afac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("afac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "afac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "afac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "afac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("afac:_facilityObjectStatusExtension", v)?; }
for v in &self.supplemental_facility_status { v.write(w, "afac:supplementalFacilityStatus", "", "")?; }
if let Some(v) = &self.facility_status_extension { w.extension("afac:_facilityStatusExtension", v)?; }
if let Some(v) = &self.available_car_parking_places { w.leaf("aegi:availableCarParkingPlaces", v)?; }
if let Some(v) = &self.available_truck_parking_places { w.leaf("aegi:availableTruckParkingPlaces", v)?; }
for v in &self.energy_infrastructure_station_status { v.write(w, "aegi:energyInfrastructureStationStatus", "", "")?; }
for v in &self.service_type { v.write(w, "aegi:serviceType", "", "")?; }
if let Some(v) = &self.energy_infrastructure_site_status_extension { w.extension("aegi:_energyInfrastructureSiteStatusExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyInfrastructureStation {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<afac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub external_identifier: Vec<afac::ExternalIdentifier>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<afac::Image>,
pub operating_hours: Option<afac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<afac::Organisation>,
pub operator: Option<afac::Organisation>,
pub helpdesk: Option<afac::Organisation>,
pub associated_facility: Vec<afac::AnyAssociatedFacility>,
pub rates: Option<afac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<afac::Dimension>>,
pub amenities: Option<Box<afac::Amenities>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<afac::SupplementalFacility>,
pub dedicated_parking_spaces: Vec<DedicatedParkingSpaces>,
pub facility_extension: Option<Box<Extension>>,
pub total_maximum_power: Option<Watt>,
pub authentication_and_identification_methods: Vec<AuthenticationAndIdentificationEnum>,
pub number_of_refill_points: Option<com::NonNegativeInteger>,
pub user_interface_language: Vec<com::Language>,
pub renewable_sources: Option<com::Boolean>,
pub energy_distributor: Option<afac::Organisation>,
pub mobility_service_provider: Vec<afac::Organisation>,
pub roaming_platform: Vec<afac::Organisation>,
pub hydrogen: Option<Box<Hydrogen>>,
pub service_type: Vec<ServiceType>,
pub refill_point: Vec<RefillPoint>,
pub energy_product: Vec<AnyEnergyProduct>,
pub energy_infrastructure_station_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureStation {
const FIELDS: &'static [u32] = &[0x20949, 0x206ad, 0x208ba, 0x20777, 0x2066b, 0x20690, 0x20805, 0x20887, 0x20a2d, 0x20a2c, 0x209c5, 0x208e8, 0x209f8, 0x209d2, 0x20864, 0x206d3, 0x20ab0, 0x206c6, 0x20786, 0x206b8, 0x20497, 0x20b90, 0x20764, 0x20496, 0x10bc9, 0x106d6, 0x10981, 0x10c1c, 0x10adc, 0x107cc, 0x10942, 0x10b09, 0x1086a, 0x10b34, 0x10ac3, 0x107d5, 0x10486];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1009c);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = Vec::new();
let mut e22 = Vec::new();
let mut e23 = None;
let mut e24 = None;
let mut e25 = Vec::new();
let mut e26 = None;
let mut e27 = Vec::new();
let mut e28 = None;
let mut e29 = None;
let mut e30 = Vec::new();
let mut e31 = Vec::new();
let mut e32 = None;
let mut e33 = Vec::new();
let mut e34 = Vec::new();
let mut e35 = Vec::new();
let mut e36 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x206ad => { let v = r.multilingual()?; e1.extend(v); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x2066b => { let v = r.enumeration::<afac::AccessibilityEnum>()?; e4.extend(v); }
0x20690 => { let v = r.multilingual()?; e5.extend(v); }
0x20805 => { let v = Some(afac::ExternalIdentifier::read(r)?); e6.extend(v); }
0x20887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x20a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x20a2c => { let v = Some(afac::Image::read(r)?); e9.extend(v); }
0x209c5 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x209f8 => { let v = afac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x209d2 => { let v = afac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x20864 => { let v = afac::Organisation::read(r)?; r.set(&mut e14, v, 2148); }
0x206d3 => { let v = afac::AnyAssociatedFacility::read(r)?; e15.extend(v); }
0x20ab0 => { let v = afac::Rates::read(r)?; r.set(&mut e16, v, 2736); }
0x206c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e17.extend(v); }
0x20786 => { let v = Some(afac::Dimension::read(r)?); r.set(&mut e18, v.map(Box::new), 1926); }
0x206b8 => { let v = Some(afac::Amenities::read(r)?); r.set(&mut e19, v.map(Box::new), 1720); }
0x20497 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1175); }
0x20b90 => { let v = afac::SupplementalFacility::read(r)?; e21.extend(v); }
0x20764 => { let v = Some(DedicatedParkingSpaces::read(r)?); e22.extend(v); }
0x20496 => { let v = r.raw()?; r.set(&mut e23, v.map(Box::new), 1174); }
0x10bc9 => { let v = r.value::<f32>()?; r.set(&mut e24, v, 3017); }
0x106d6 => { let v = r.enumeration::<AuthenticationAndIdentificationEnum>()?; e25.extend(v); }
0x10981 => { let v = r.value::<u64>()?; r.set(&mut e26, v, 2433); }
0x10c1c => { let v = r.string()?; e27.extend(v); }
0x10adc => { let v = r.value::<bool>()?; r.set(&mut e28, v, 2780); }
0x107cc => { let v = afac::Organisation::read(r)?; r.set(&mut e29, v, 1996); }
0x10942 => { let v = afac::Organisation::read(r)?; e30.extend(v); }
0x10b09 => { let v = afac::Organisation::read(r)?; e31.extend(v); }
0x1086a => { let v = Some(Hydrogen::read(r)?); r.set(&mut e32, v.map(Box::new), 2154); }
0x10b34 => { let v = Some(ServiceType::read(r)?); e33.extend(v); }
0x10ac3 => { let v = RefillPoint::read(r)?; e34.extend(v); }
0x107d5 => { let v = AnyEnergyProduct::read(r)?; e35.extend(v); }
0x10486 => { let v = r.raw()?; r.set(&mut e36, v.map(Box::new), 1158); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
last_updated: e2,
description: e3,
accessibility: e4,
additional_information: e5,
external_identifier: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
helpdesk: e14,
associated_facility: e15,
rates: e16,
applicable_for_vehicles: e17,
dimension: e18,
amenities: e19,
facility_object_extension: e20,
supplemental_facility: e21,
dedicated_parking_spaces: e22,
facility_extension: e23,
total_maximum_power: e24,
authentication_and_identification_methods: e25,
number_of_refill_points: e26,
user_interface_language: e27,
renewable_sources: e28,
energy_distributor: e29,
mobility_service_provider: e30,
roaming_platform: e31,
hydrogen: e32,
service_type: e33,
refill_point: e34,
energy_product: e35,
energy_infrastructure_station_extension: e36,
};
r.close();
Ok(v)
}
}
impl EnergyInfrastructureStation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.name { w.multilingual("afac:name", v)?; }
for v in &self.alias { w.multilingual("afac:alias", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
for v in &self.accessibility { w.enumeration("afac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("afac:additionalInformation", v)?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.information_website { v.write(w, "afac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "afac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "afac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "afac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "afac:operator")?; }
if let Some(v) = &self.helpdesk { v.write(w, "afac:helpdesk")?; }
for v in &self.associated_facility { v.write(w, "afac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "afac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "afac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "afac:dimension", "", "")?; }
if let Some(v) = &self.amenities { v.write(w, "afac:amenities", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("afac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "afac:supplementalFacility")?; }
for v in &self.dedicated_parking_spaces { v.write(w, "afac:dedicatedParkingSpaces", "", "")?; }
if let Some(v) = &self.facility_extension { w.extension("afac:_facilityExtension", v)?; }
if let Some(v) = &self.total_maximum_power { w.leaf("aegi:totalMaximumPower", v)?; }
for v in &self.authentication_and_identification_methods { w.enumeration("aegi:authenticationAndIdentificationMethods", v.literal())?; }
if let Some(v) = &self.number_of_refill_points { w.leaf("aegi:numberOfRefillPoints", v)?; }
for v in &self.user_interface_language { w.pattern("userInterfaceLanguage", v, Pattern::Language)?; w.leaf("aegi:userInterfaceLanguage", v)?; }
if let Some(v) = &self.renewable_sources { w.leaf("aegi:renewableSources", v)?; }
if let Some(v) = &self.energy_distributor { v.write(w, "aegi:energyDistributor")?; }
for v in &self.mobility_service_provider { v.write(w, "aegi:mobilityServiceProvider")?; }
for v in &self.roaming_platform { v.write(w, "aegi:roamingPlatform")?; }
if let Some(v) = &self.hydrogen { v.write(w, "aegi:hydrogen", "", "")?; }
for v in &self.service_type { v.write(w, "aegi:serviceType", "", "")?; }
for v in &self.refill_point { v.write(w, "aegi:refillPoint")?; }
for v in &self.energy_product { v.write(w, "aegi:energyProduct")?; }
if let Some(v) = &self.energy_infrastructure_station_extension { w.extension("aegi:_energyInfrastructureStationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyInfrastructureStationStatus {
pub reference: Option<Box<com::VersionedReference>>,
pub last_updated: Option<DateTime>,
pub opening_status: Option<afac::OpeningStatusEnum>,
pub operation_status: Option<afac::OperationStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<afac::OperatingHours>,
pub new_rates: Option<afac::Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
pub supplemental_facility_status: Vec<afac::SupplementalFacilityStatus>,
pub facility_status_extension: Option<Box<Extension>>,
pub is_available: Option<com::Boolean>,
pub limited_hydrogen_amount: Option<com::Boolean>,
pub refill_point_status: Vec<AnyRefillPointStatus>,
pub service_type: Vec<ServiceType>,
pub energy_rate_update: Vec<EnergyRateUpdate>,
pub energy_infrastructure_station_status_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureStationStatus {
const FIELDS: &'static [u32] = &[0x20aba, 0x208ba, 0x209a8, 0x209ce, 0x20aca, 0x20b77, 0x20958, 0x20959, 0x2080d, 0x20498, 0x20b91, 0x20499, 0x10898, 0x108c9, 0x10ac5, 0x10b34, 0x107dc, 0x10487];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1009d);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = Vec::new();
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = Vec::new();
let mut e15 = Vec::new();
let mut e16 = Vec::new();
let mut e17 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x208ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x209a8 => { let v = r.enumeration::<afac::OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x209ce => { let v = r.enumeration::<afac::OperationStatusEnum>()?; r.set(&mut e3, v, 2510); }
0x20aca => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2762); }
0x20b77 => { let v = r.multilingual()?; r.set(&mut e5, v, 2935); }
0x20958 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e6, v, 2392); }
0x20959 => { let v = afac::Rates::read(r)?; r.set(&mut e7, v, 2393); }
0x2080d => { let v = com::AnyFault::read(r)?; r.set(&mut e8, v, 2061); }
0x20498 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1176); }
0x20b91 => { let v = Some(afac::SupplementalFacilityStatus::read(r)?); e10.extend(v); }
0x20499 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1177); }
0x10898 => { let v = r.value::<bool>()?; r.set(&mut e12, v, 2200); }
0x108c9 => { let v = r.value::<bool>()?; r.set(&mut e13, v, 2249); }
0x10ac5 => { let v = AnyRefillPointStatus::read(r)?; e14.extend(v); }
0x10b34 => { let v = Some(ServiceType::read(r)?); e15.extend(v); }
0x107dc => { let v = Some(EnergyRateUpdate::read(r)?); e16.extend(v); }
0x10487 => { let v = r.raw()?; r.set(&mut e17, v.map(Box::new), 1159); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2746);
let v = Self {
reference: e0,
last_updated: e1,
opening_status: e2,
operation_status: e3,
regular_operating_hours_in_force: e4,
status_description: e5,
new_operating_hours: e6,
new_rates: e7,
fault: e8,
facility_object_status_extension: e9,
supplemental_facility_status: e10,
facility_status_extension: e11,
is_available: e12,
limited_hydrogen_amount: e13,
refill_point_status: e14,
service_type: e15,
energy_rate_update: e16,
energy_infrastructure_station_status_extension: e17,
};
r.close();
Ok(v)
}
}
impl EnergyInfrastructureStationStatus {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.reference {
Some(v) => { v.write(w, "afac:reference", "", " targetClass=\"afac:FacilityObject\"")?; }
None => return Err(w.missing("afac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("afac:openingStatus", v.literal())?; }
if let Some(v) = &self.operation_status { w.enumeration("afac:operationStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("afac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("afac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "afac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "afac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "afac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("afac:_facilityObjectStatusExtension", v)?; }
for v in &self.supplemental_facility_status { v.write(w, "afac:supplementalFacilityStatus", "", "")?; }
if let Some(v) = &self.facility_status_extension { w.extension("afac:_facilityStatusExtension", v)?; }
if let Some(v) = &self.is_available { w.leaf("aegi:isAvailable", v)?; }
if let Some(v) = &self.limited_hydrogen_amount { w.leaf("aegi:limitedHydrogenAmount", v)?; }
for v in &self.refill_point_status { v.write(w, "aegi:refillPointStatus")?; }
for v in &self.service_type { v.write(w, "aegi:serviceType", "", "")?; }
for v in &self.energy_rate_update { v.write(w, "aegi:energyRateUpdate", "", "")?; }
if let Some(v) = &self.energy_infrastructure_station_status_extension { w.extension("aegi:_energyInfrastructureStationStatusExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyInfrastructureStatusPublication {
pub lang: Option<com::Language>,
pub extension_name: Option<String>,
pub extension_version: Option<String>,
pub profile_name: Option<String>,
pub profile_version: Option<String>,
pub feed_description: Option<MultilingualString>,
pub feed_type: Option<String>,
pub publication_time: Option<DateTime>,
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
pub payload_publication_extension: Option<Box<Extension>>,
pub table_reference: Vec<com::VersionedReference>,
pub header_information: Option<Box<com::HeaderInformation>>,
pub energy_infrastructure_site_status: Vec<EnergyInfrastructureSiteStatus>,
pub energy_infrastructure_status_publication_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureStatusPublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x10b9b, 0x10857, 0x107ce, 0x10488];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1009e);
let a0 = r.req_attr(2223);
let _ = r.attr(2373);
let a2 = r.attr(2046);
let a3 = r.attr(2047);
let a4 = r.attr(2689);
let a5 = r.attr(2690);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x3081d => { let v = r.multilingual()?; r.set(&mut e0, v, 2077); }
0x3081e => { let v = r.string()?; r.set(&mut e1, v, 2078); }
0x30a94 => { let v = r.date_time()?; r.set(&mut e2, v, 2708); }
0x30a93 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2707); }
0x30547 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1351); }
0x10b9b => { let v = Some(com::VersionedReference::read(r)?); e5.extend(v); }
0x10857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e6, v.map(Box::new), 2135); }
0x107ce => { let v = Some(EnergyInfrastructureSiteStatus::read(r)?); e7.extend(v); }
0x10488 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1160); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2708);
r.required(&e3, 2707);
let v = Self {
lang: a0,
extension_name: a2,
extension_version: a3,
profile_name: a4,
profile_version: a5,
feed_description: e0,
feed_type: e1,
publication_time: e2,
publication_creator: e3,
payload_publication_extension: e4,
table_reference: e5,
header_information: e6,
energy_infrastructure_site_status: e7,
energy_infrastructure_status_publication_extension: e8,
};
r.close();
Ok(v)
}
}
impl EnergyInfrastructureStatusPublication {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.constant_attrs(" modelBaseVersion=\"3\"")?;
match &self.lang {
Some(v) => { w.pattern("lang", v, Pattern::Language)?; w.attr("lang", v)?; }
None => return Err(w.missing_attr("lang")),
}
if let Some(v) = &self.extension_name { w.attr("extensionName", v)?; }
if let Some(v) = &self.extension_version { w.attr("extensionVersion", v)?; }
if let Some(v) = &self.profile_name { w.attr("profileName", v)?; }
if let Some(v) = &self.profile_version { w.attr("profileVersion", v)?; }
if let Some(v) = &self.feed_description { w.multilingual("com:feedDescription", v)?; }
if let Some(v) = &self.feed_type { w.max_len("feedType", v, 1024)?; w.leaf("com:feedType", v)?; }
match &self.publication_time {
Some(v) => { w.leaf("com:publicationTime", v)?; }
None => return Err(w.missing("com:publicationTime")),
}
match &self.publication_creator {
Some(v) => { v.write(w, "com:publicationCreator", "", "")?; }
None => return Err(w.missing("com:publicationCreator")),
}
if let Some(v) = &self.payload_publication_extension { w.extension("com:_payloadPublicationExtension", v)?; }
for v in &self.table_reference { v.write(w, "aegi:tableReference", "", " targetClass=\"aegi:EnergyInfrastructureTable\"")?; }
if let Some(v) = &self.header_information { v.write(w, "aegi:headerInformation", "", "")?; }
for v in &self.energy_infrastructure_site_status { v.write(w, "aegi:energyInfrastructureSiteStatus", "", "")?; }
if let Some(v) = &self.energy_infrastructure_status_publication_extension { w.extension("aegi:_energyInfrastructureStatusPublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyInfrastructureTable {
pub id: Option<String>,
pub version: Option<String>,
pub table_name: Option<String>,
pub energy_infrastructure_site: Vec<EnergyInfrastructureSite>,
pub energy_infrastructure_table_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureTable {
const FIELDS: &'static [u32] = &[0x10b9a, 0x107cd, 0x10489];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1009f);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10b9a => { let v = r.string()?; r.set(&mut e0, v, 2970); }
0x107cd => { let v = Some(EnergyInfrastructureSite::read(r)?); e1.extend(v); }
0x10489 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1161); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
id: a0,
version: a1,
table_name: e0,
energy_infrastructure_site: e1,
energy_infrastructure_table_extension: e2,
};
r.close();
Ok(v)
}
}
impl EnergyInfrastructureTable {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.table_name { w.max_len("tableName", v, 1024)?; w.leaf("aegi:tableName", v)?; }
w.count("aegi:energyInfrastructureSite", self.energy_infrastructure_site.len(), 1, usize::MAX)?;
for v in &self.energy_infrastructure_site { v.write(w, "aegi:energyInfrastructureSite", "", "")?; }
if let Some(v) = &self.energy_infrastructure_table_extension { w.extension("aegi:_energyInfrastructureTableExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyInfrastructureTablePublication {
pub lang: Option<com::Language>,
pub extension_name: Option<String>,
pub extension_version: Option<String>,
pub profile_name: Option<String>,
pub profile_version: Option<String>,
pub feed_description: Option<MultilingualString>,
pub feed_type: Option<String>,
pub publication_time: Option<DateTime>,
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
pub payload_publication_extension: Option<Box<Extension>>,
pub header_information: Option<Box<com::HeaderInformation>>,
pub energy_infrastructure_table: Vec<EnergyInfrastructureTable>,
pub energy_infrastructure_table_publication_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureTablePublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x10857, 0x107d1, 0x1048a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100a0);
let a0 = r.req_attr(2223);
let _ = r.attr(2373);
let a2 = r.attr(2046);
let a3 = r.attr(2047);
let a4 = r.attr(2689);
let a5 = r.attr(2690);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = Vec::new();
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x3081d => { let v = r.multilingual()?; r.set(&mut e0, v, 2077); }
0x3081e => { let v = r.string()?; r.set(&mut e1, v, 2078); }
0x30a94 => { let v = r.date_time()?; r.set(&mut e2, v, 2708); }
0x30a93 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2707); }
0x30547 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1351); }
0x10857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x107d1 => { let v = Some(EnergyInfrastructureTable::read(r)?); e6.extend(v); }
0x1048a => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1162); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2708);
r.required(&e3, 2707);
let v = Self {
lang: a0,
extension_name: a2,
extension_version: a3,
profile_name: a4,
profile_version: a5,
feed_description: e0,
feed_type: e1,
publication_time: e2,
publication_creator: e3,
payload_publication_extension: e4,
header_information: e5,
energy_infrastructure_table: e6,
energy_infrastructure_table_publication_extension: e7,
};
r.close();
Ok(v)
}
}
impl EnergyInfrastructureTablePublication {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.constant_attrs(" modelBaseVersion=\"3\"")?;
match &self.lang {
Some(v) => { w.pattern("lang", v, Pattern::Language)?; w.attr("lang", v)?; }
None => return Err(w.missing_attr("lang")),
}
if let Some(v) = &self.extension_name { w.attr("extensionName", v)?; }
if let Some(v) = &self.extension_version { w.attr("extensionVersion", v)?; }
if let Some(v) = &self.profile_name { w.attr("profileName", v)?; }
if let Some(v) = &self.profile_version { w.attr("profileVersion", v)?; }
if let Some(v) = &self.feed_description { w.multilingual("com:feedDescription", v)?; }
if let Some(v) = &self.feed_type { w.max_len("feedType", v, 1024)?; w.leaf("com:feedType", v)?; }
match &self.publication_time {
Some(v) => { w.leaf("com:publicationTime", v)?; }
None => return Err(w.missing("com:publicationTime")),
}
match &self.publication_creator {
Some(v) => { v.write(w, "com:publicationCreator", "", "")?; }
None => return Err(w.missing("com:publicationCreator")),
}
if let Some(v) = &self.payload_publication_extension { w.extension("com:_payloadPublicationExtension", v)?; }
if let Some(v) = &self.header_information { v.write(w, "aegi:headerInformation", "", "")?; }
w.count("aegi:energyInfrastructureTable", self.energy_infrastructure_table.len(), 1, usize::MAX)?;
for v in &self.energy_infrastructure_table { v.write(w, "aegi:energyInfrastructureTable", "", "")?; }
if let Some(v) = &self.energy_infrastructure_table_publication_extension { w.extension("aegi:_energyInfrastructureTablePublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyPrice {
pub price_group_index: Option<com::NonNegativeInteger>,
pub price_type: Option<PriceTypeEnum>,
pub value: Option<afac::AmountOfMoney>,
pub price_cap: Option<afac::AmountOfMoney>,
pub tax_included: Option<com::Boolean>,
pub tax_rate: Option<com::Percentage>,
pub additional_information: Option<MultilingualString>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub time_based_applicability: Option<Box<TimeBasedApplicability>>,
pub energy_based_applicability: Option<Box<EnergyBasedApplicability>>,
pub energy_price_extension: Option<Box<Extension>>,
}
impl EnergyPrice {
const FIELDS: &'static [u32] = &[0x10a73, 0x10a74, 0x10c2c, 0x10a72, 0x10ba1, 0x10ba2, 0x10690, 0x109f1, 0x10bb4, 0x107cb, 0x1048b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100a1);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10a73 => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2675); }
0x10a74 => { let v = r.enumeration::<PriceTypeEnum>()?; r.set(&mut e1, v, 2676); }
0x10c2c => { let v = r.value::<Decimal>()?; r.set(&mut e2, v, 3116); }
0x10a72 => { let v = r.value::<Decimal>()?; r.set(&mut e3, v, 2674); }
0x10ba1 => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2977); }
0x10ba2 => { let v = r.value::<f32>()?; r.set(&mut e5, v, 2978); }
0x10690 => { let v = r.multilingual()?; r.set(&mut e6, v, 1680); }
0x109f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e7, v.map(Box::new), 2545); }
0x10bb4 => { let v = Some(TimeBasedApplicability::read(r)?); r.set(&mut e8, v.map(Box::new), 2996); }
0x107cb => { let v = Some(EnergyBasedApplicability::read(r)?); r.set(&mut e9, v.map(Box::new), 1995); }
0x1048b => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1163); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2675);
r.required(&e1, 2676);
r.required(&e2, 3116);
let v = Self {
price_group_index: e0,
price_type: e1,
value: e2,
price_cap: e3,
tax_included: e4,
tax_rate: e5,
additional_information: e6,
overall_period: e7,
time_based_applicability: e8,
energy_based_applicability: e9,
energy_price_extension: e10,
};
r.close();
Ok(v)
}
}
impl EnergyPrice {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.price_group_index {
Some(v) => { w.leaf("aegi:priceGroupIndex", v)?; }
None => return Err(w.missing("aegi:priceGroupIndex")),
}
match &self.price_type {
Some(v) => { w.enumeration("aegi:priceType", v.literal())?; }
None => return Err(w.missing("aegi:priceType")),
}
match &self.value {
Some(v) => { w.digits("value", v, 8, 2)?; w.leaf("aegi:value", v)?; }
None => return Err(w.missing("aegi:value")),
}
if let Some(v) = &self.price_cap { w.digits("priceCap", v, 8, 2)?; w.leaf("aegi:priceCap", v)?; }
if let Some(v) = &self.tax_included { w.leaf("aegi:taxIncluded", v)?; }
if let Some(v) = &self.tax_rate { w.leaf("aegi:taxRate", v)?; }
if let Some(v) = &self.additional_information { w.multilingual("aegi:additionalInformation", v)?; }
if let Some(v) = &self.overall_period { v.write(w, "aegi:overallPeriod", "", "")?; }
if let Some(v) = &self.time_based_applicability { v.write(w, "aegi:timeBasedApplicability", "", "")?; }
if let Some(v) = &self.energy_based_applicability { v.write(w, "aegi:energyBasedApplicability", "", "")?; }
if let Some(v) = &self.energy_price_extension { w.extension("aegi:_energyPriceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyProduct {
pub energy_product_name: Option<MultilingualString>,
pub is_green_energy: Option<com::Boolean>,
pub energy_rate_by_reference: Vec<com::Reference>,
pub energy_product_information: Option<com::Url>,
pub renewable_energy_evidence: Option<com::Url>,
pub mobility_service_provider: Vec<afac::Organisation>,
pub energy_rate: Vec<EnergyRate>,
pub energy_product_extension: Option<Box<Extension>>,
}
impl EnergyProduct {
const FIELDS: &'static [u32] = &[0x107d7, 0x1089b, 0x107da, 0x107d6, 0x10adb, 0x10942, 0x107d9, 0x1048d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100a3);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x107d7 => { let v = r.multilingual()?; r.set(&mut e0, v, 2007); }
0x1089b => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2203); }
0x107da => { let v = Some(com::Reference::read(r)?); e2.extend(v); }
0x107d6 => { let v = r.string()?; r.set(&mut e3, v, 2006); }
0x10adb => { let v = r.string()?; r.set(&mut e4, v, 2779); }
0x10942 => { let v = afac::Organisation::read(r)?; e5.extend(v); }
0x107d9 => { let v = Some(EnergyRate::read(r)?); e6.extend(v); }
0x1048d => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1165); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
energy_product_name: e0,
is_green_energy: e1,
energy_rate_by_reference: e2,
energy_product_information: e3,
renewable_energy_evidence: e4,
mobility_service_provider: e5,
energy_rate: e6,
energy_product_extension: e7,
};
r.close();
Ok(v)
}
}
impl EnergyProduct {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.energy_product_name { w.multilingual("aegi:energyProductName", v)?; }
if let Some(v) = &self.is_green_energy { w.leaf("aegi:isGreenEnergy", v)?; }
for v in &self.energy_rate_by_reference { v.write(w, "aegi:energyRateByReference", "", " targetClass=\"aegi:EnergyRate\"")?; }
if let Some(v) = &self.energy_product_information { w.leaf("aegi:energyProductInformation", v)?; }
if let Some(v) = &self.renewable_energy_evidence { w.leaf("aegi:renewableEnergyEvidence", v)?; }
for v in &self.mobility_service_provider { v.write(w, "aegi:mobilityServiceProvider")?; }
for v in &self.energy_rate { v.write(w, "aegi:energyRate", "", "")?; }
if let Some(v) = &self.energy_product_extension { w.extension("aegi:_energyProductExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyRate {
pub id: Option<String>,
pub rate_policy: Option<RatePolicyEnum>,
pub last_updated: Option<DateTime>,
pub applicable_currency: Vec<afac::CurrencyCode>,
pub rate_name: Option<MultilingualString>,
pub combination_with_parking_fee: Option<com::Boolean>,
pub maximum_delivery_fee: Option<afac::AmountOfMoney>,
pub minimum_delivery_fee: Option<afac::AmountOfMoney>,
pub discount: Option<com::Percentage>,
pub additional_information: Option<MultilingualString>,
pub payment: Option<Box<afac::Payment>>,
pub energy_price: Vec<EnergyPrice>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub energy_rate_extension: Option<Box<Extension>>,
}
impl EnergyRate {
const FIELDS: &'static [u32] = &[0x10aa7, 0x108ba, 0x106bf, 0x10aa6, 0x10725, 0x10908, 0x10937, 0x10792, 0x10690, 0x10a10, 0x107d3, 0x109f1, 0x1048e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100a4);
let a0 = r.req_attr(2159);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = Vec::new();
let mut e11 = None;
let mut e12 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10aa7 => { let v = r.enumeration::<RatePolicyEnum>()?; r.set(&mut e0, v, 2727); }
0x108ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x106bf => { let v = r.string()?; e2.extend(v); }
0x10aa6 => { let v = r.multilingual()?; r.set(&mut e3, v, 2726); }
0x10725 => { let v = r.value::<bool>()?; r.set(&mut e4, v, 1829); }
0x10908 => { let v = r.value::<Decimal>()?; r.set(&mut e5, v, 2312); }
0x10937 => { let v = r.value::<Decimal>()?; r.set(&mut e6, v, 2359); }
0x10792 => { let v = r.value::<f32>()?; r.set(&mut e7, v, 1938); }
0x10690 => { let v = r.multilingual()?; r.set(&mut e8, v, 1680); }
0x10a10 => { let v = Some(afac::Payment::read(r)?); r.set(&mut e9, v.map(Box::new), 2576); }
0x107d3 => { let v = Some(EnergyPrice::read(r)?); e10.extend(v); }
0x109f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e11, v.map(Box::new), 2545); }
0x1048e => { let v = r.raw()?; r.set(&mut e12, v.map(Box::new), 1166); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2727);
r.required(&e1, 2234);
let v = Self {
id: a0,
rate_policy: e0,
last_updated: e1,
applicable_currency: e2,
rate_name: e3,
combination_with_parking_fee: e4,
maximum_delivery_fee: e5,
minimum_delivery_fee: e6,
discount: e7,
additional_information: e8,
payment: e9,
energy_price: e10,
overall_period: e11,
energy_rate_extension: e12,
};
r.close();
Ok(v)
}
}
impl EnergyRate {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.rate_policy {
Some(v) => { w.enumeration("aegi:ratePolicy", v.literal())?; }
None => return Err(w.missing("aegi:ratePolicy")),
}
match &self.last_updated {
Some(v) => { w.leaf("aegi:lastUpdated", v)?; }
None => return Err(w.missing("aegi:lastUpdated")),
}
w.count("aegi:applicableCurrency", self.applicable_currency.len(), 1, usize::MAX)?;
for v in &self.applicable_currency { w.max_len("applicableCurrency", v, 1024)?; w.pattern("applicableCurrency", v, Pattern::CurrencyCode)?; w.leaf("aegi:applicableCurrency", v)?; }
if let Some(v) = &self.rate_name { w.multilingual("aegi:rateName", v)?; }
if let Some(v) = &self.combination_with_parking_fee { w.leaf("aegi:combinationWithParkingFee", v)?; }
if let Some(v) = &self.maximum_delivery_fee { w.digits("maximumDeliveryFee", v, 8, 2)?; w.leaf("aegi:maximumDeliveryFee", v)?; }
if let Some(v) = &self.minimum_delivery_fee { w.digits("minimumDeliveryFee", v, 8, 2)?; w.leaf("aegi:minimumDeliveryFee", v)?; }
if let Some(v) = &self.discount { w.leaf("aegi:discount", v)?; }
if let Some(v) = &self.additional_information { w.multilingual("aegi:additionalInformation", v)?; }
if let Some(v) = &self.payment { v.write(w, "aegi:payment", "", "")?; }
for v in &self.energy_price { v.write(w, "aegi:energyPrice", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "aegi:overallPeriod", "", "")?; }
if let Some(v) = &self.energy_rate_extension { w.extension("aegi:_energyRateExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyRateUpdate {
pub last_updated: Option<DateTime>,
pub energy_rate_reference: Option<Box<com::Reference>>,
pub additional_information: Option<MultilingualString>,
pub energy_price: Vec<EnergyPrice>,
pub energy_rate_update_extension: Option<Box<Extension>>,
}
impl EnergyRateUpdate {
const FIELDS: &'static [u32] = &[0x108ba, 0x107db, 0x10690, 0x107d3, 0x1048f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100a5);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x108ba => { let v = r.date_time()?; r.set(&mut e0, v, 2234); }
0x107db => { let v = Some(com::Reference::read(r)?); r.set(&mut e1, v.map(Box::new), 2011); }
0x10690 => { let v = r.multilingual()?; r.set(&mut e2, v, 1680); }
0x107d3 => { let v = Some(EnergyPrice::read(r)?); e3.extend(v); }
0x1048f => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1167); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2234);
r.required(&e1, 2011);
let v = Self {
last_updated: e0,
energy_rate_reference: e1,
additional_information: e2,
energy_price: e3,
energy_rate_update_extension: e4,
};
r.close();
Ok(v)
}
}
impl EnergyRateUpdate {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.last_updated {
Some(v) => { w.leaf("aegi:lastUpdated", v)?; }
None => return Err(w.missing("aegi:lastUpdated")),
}
match &self.energy_rate_reference {
Some(v) => { v.write(w, "aegi:energyRateReference", "", " targetClass=\"aegi:EnergyRate\"")?; }
None => return Err(w.missing("aegi:energyRateReference")),
}
if let Some(v) = &self.additional_information { w.multilingual("aegi:additionalInformation", v)?; }
for v in &self.energy_price { v.write(w, "aegi:energyPrice", "", "")?; }
if let Some(v) = &self.energy_rate_update_extension { w.extension("aegi:_energyRateUpdateExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Hydrogen {
pub refuelling_mode: Vec<HydrogenRefuellingModeEnum>,
pub cumulative_capacityper_day: Option<KilogramPerDay>,
pub hydrogen_extension: Option<Box<Extension>>,
}
impl Hydrogen {
const FIELDS: &'static [u32] = &[0x10ac7, 0x1074f, 0x104c1];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100d7);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10ac7 => { let v = r.enumeration::<HydrogenRefuellingModeEnum>()?; e0.extend(v); }
0x1074f => { let v = r.value::<f32>()?; r.set(&mut e1, v, 1871); }
0x104c1 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1217); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 1871);
let v = Self {
refuelling_mode: e0,
cumulative_capacityper_day: e1,
hydrogen_extension: e2,
};
r.close();
Ok(v)
}
}
impl Hydrogen {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.count("aegi:refuellingMode", self.refuelling_mode.len(), 1, usize::MAX)?;
for v in &self.refuelling_mode { w.enumeration("aegi:refuellingMode", v.literal())?; }
match &self.cumulative_capacityper_day {
Some(v) => { w.leaf("aegi:cumulativeCapacityperDay", v)?; }
None => return Err(w.missing("aegi:cumulativeCapacityperDay")),
}
if let Some(v) = &self.hydrogen_extension { w.extension("aegi:_hydrogenExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PetrolRefillPoint {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<afac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub external_identifier: Vec<afac::ExternalIdentifier>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<afac::Image>,
pub operating_hours: Option<afac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<afac::Organisation>,
pub operator: Option<afac::Organisation>,
pub helpdesk: Option<afac::Organisation>,
pub associated_facility: Vec<afac::AnyAssociatedFacility>,
pub rates: Option<afac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<afac::Dimension>>,
pub amenities: Option<Box<afac::Amenities>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<afac::SupplementalFacility>,
pub dedicated_parking_spaces: Vec<DedicatedParkingSpaces>,
pub facility_extension: Option<Box<Extension>>,
pub delivery_unit: Option<DeliveryUnitEnum>,
pub maximum_delivery_amount: Option<Units>,
pub minimum_delivery_amount: Option<Units>,
pub model_type: Option<MultilingualString>,
pub reservation: Option<afac::ReservationTypeEnum>,
pub energy_product: Vec<AnyEnergyProduct>,
pub refill_point_extension: Option<Box<Extension>>,
pub petrol_type: Option<PetrolTypeEnum>,
pub octane_type: Option<OctaneTypeEnum>,
pub octane: Option<com::NonNegativeInteger>,
pub bioethanol_share: Option<com::Percentage>,
pub bioethanol_type: Option<BioethanolTypeEnum>,
pub petrol_refill_point_extension: Option<Box<Extension>>,
}
impl PetrolRefillPoint {
const FIELDS: &'static [u32] = &[0x20949, 0x206ad, 0x208ba, 0x20777, 0x2066b, 0x20690, 0x20805, 0x20887, 0x20a2d, 0x20a2c, 0x209c5, 0x208e8, 0x209f8, 0x209d2, 0x20864, 0x206d3, 0x20ab0, 0x206c6, 0x20786, 0x206b8, 0x20497, 0x20b90, 0x20764, 0x20496, 0x1076d, 0x10907, 0x10936, 0x10946, 0x10ae4, 0x107d5, 0x10592, 0x10a2b, 0x109a3, 0x109a2, 0x106f8, 0x106f9, 0x10554];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10171);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = Vec::new();
let mut e22 = Vec::new();
let mut e23 = None;
let mut e24 = None;
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = None;
let mut e29 = Vec::new();
let mut e30 = None;
let mut e31 = None;
let mut e32 = None;
let mut e33 = None;
let mut e34 = None;
let mut e35 = None;
let mut e36 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x206ad => { let v = r.multilingual()?; e1.extend(v); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x2066b => { let v = r.enumeration::<afac::AccessibilityEnum>()?; e4.extend(v); }
0x20690 => { let v = r.multilingual()?; e5.extend(v); }
0x20805 => { let v = Some(afac::ExternalIdentifier::read(r)?); e6.extend(v); }
0x20887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x20a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x20a2c => { let v = Some(afac::Image::read(r)?); e9.extend(v); }
0x209c5 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x209f8 => { let v = afac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x209d2 => { let v = afac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x20864 => { let v = afac::Organisation::read(r)?; r.set(&mut e14, v, 2148); }
0x206d3 => { let v = afac::AnyAssociatedFacility::read(r)?; e15.extend(v); }
0x20ab0 => { let v = afac::Rates::read(r)?; r.set(&mut e16, v, 2736); }
0x206c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e17.extend(v); }
0x20786 => { let v = Some(afac::Dimension::read(r)?); r.set(&mut e18, v.map(Box::new), 1926); }
0x206b8 => { let v = Some(afac::Amenities::read(r)?); r.set(&mut e19, v.map(Box::new), 1720); }
0x20497 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1175); }
0x20b90 => { let v = afac::SupplementalFacility::read(r)?; e21.extend(v); }
0x20764 => { let v = Some(DedicatedParkingSpaces::read(r)?); e22.extend(v); }
0x20496 => { let v = r.raw()?; r.set(&mut e23, v.map(Box::new), 1174); }
0x1076d => { let v = r.enumeration::<DeliveryUnitEnum>()?; r.set(&mut e24, v, 1901); }
0x10907 => { let v = r.value::<f32>()?; r.set(&mut e25, v, 2311); }
0x10936 => { let v = r.value::<f32>()?; r.set(&mut e26, v, 2358); }
0x10946 => { let v = r.multilingual()?; r.set(&mut e27, v, 2374); }
0x10ae4 => { let v = r.enumeration::<afac::ReservationTypeEnum>()?; r.set(&mut e28, v, 2788); }
0x107d5 => { let v = AnyEnergyProduct::read(r)?; e29.extend(v); }
0x10592 => { let v = r.raw()?; r.set(&mut e30, v.map(Box::new), 1426); }
0x10a2b => { let v = r.enumeration::<PetrolTypeEnum>()?; r.set(&mut e31, v, 2603); }
0x109a3 => { let v = r.enumeration::<OctaneTypeEnum>()?; r.set(&mut e32, v, 2467); }
0x109a2 => { let v = r.value::<u64>()?; r.set(&mut e33, v, 2466); }
0x106f8 => { let v = r.value::<f32>()?; r.set(&mut e34, v, 1784); }
0x106f9 => { let v = r.enumeration::<BioethanolTypeEnum>()?; r.set(&mut e35, v, 1785); }
0x10554 => { let v = r.raw()?; r.set(&mut e36, v.map(Box::new), 1364); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e24, 1901);
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
last_updated: e2,
description: e3,
accessibility: e4,
additional_information: e5,
external_identifier: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
helpdesk: e14,
associated_facility: e15,
rates: e16,
applicable_for_vehicles: e17,
dimension: e18,
amenities: e19,
facility_object_extension: e20,
supplemental_facility: e21,
dedicated_parking_spaces: e22,
facility_extension: e23,
delivery_unit: e24,
maximum_delivery_amount: e25,
minimum_delivery_amount: e26,
model_type: e27,
reservation: e28,
energy_product: e29,
refill_point_extension: e30,
petrol_type: e31,
octane_type: e32,
octane: e33,
bioethanol_share: e34,
bioethanol_type: e35,
petrol_refill_point_extension: e36,
};
r.close();
Ok(v)
}
}
impl PetrolRefillPoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.name { w.multilingual("afac:name", v)?; }
for v in &self.alias { w.multilingual("afac:alias", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
for v in &self.accessibility { w.enumeration("afac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("afac:additionalInformation", v)?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.information_website { v.write(w, "afac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "afac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "afac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "afac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "afac:operator")?; }
if let Some(v) = &self.helpdesk { v.write(w, "afac:helpdesk")?; }
for v in &self.associated_facility { v.write(w, "afac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "afac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "afac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "afac:dimension", "", "")?; }
if let Some(v) = &self.amenities { v.write(w, "afac:amenities", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("afac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "afac:supplementalFacility")?; }
for v in &self.dedicated_parking_spaces { v.write(w, "afac:dedicatedParkingSpaces", "", "")?; }
if let Some(v) = &self.facility_extension { w.extension("afac:_facilityExtension", v)?; }
match &self.delivery_unit {
Some(v) => { w.enumeration("aegi:deliveryUnit", v.literal())?; }
None => return Err(w.missing("aegi:deliveryUnit")),
}
if let Some(v) = &self.maximum_delivery_amount { w.leaf("aegi:maximumDeliveryAmount", v)?; }
if let Some(v) = &self.minimum_delivery_amount { w.leaf("aegi:minimumDeliveryAmount", v)?; }
if let Some(v) = &self.model_type { w.multilingual("aegi:modelType", v)?; }
if let Some(v) = &self.reservation { w.enumeration("aegi:reservation", v.literal())?; }
for v in &self.energy_product { v.write(w, "aegi:energyProduct")?; }
if let Some(v) = &self.refill_point_extension { w.extension("aegi:_refillPointExtension", v)?; }
if let Some(v) = &self.petrol_type { w.enumeration("aegi:petrolType", v.literal())?; }
if let Some(v) = &self.octane_type { w.enumeration("aegi:octaneType", v.literal())?; }
if let Some(v) = &self.octane { w.leaf("aegi:octane", v)?; }
if let Some(v) = &self.bioethanol_share { w.leaf("aegi:bioethanolShare", v)?; }
if let Some(v) = &self.bioethanol_type { w.enumeration("aegi:bioethanolType", v.literal())?; }
if let Some(v) = &self.petrol_refill_point_extension { w.extension("aegi:_petrolRefillPointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PlannedRefillPointStatus {
pub status: Option<RefillPointStatusEnum>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub planned_refill_point_status_extension: Option<Box<Extension>>,
}
impl PlannedRefillPointStatus {
const FIELDS: &'static [u32] = &[0x10b73, 0x109f1, 0x1055d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1017a);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10b73 => { let v = r.enumeration::<RefillPointStatusEnum>()?; r.set(&mut e0, v, 2931); }
0x109f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e1, v.map(Box::new), 2545); }
0x1055d => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1373); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2931);
r.required(&e1, 2545);
let v = Self {
status: e0,
overall_period: e1,
planned_refill_point_status_extension: e2,
};
r.close();
Ok(v)
}
}
impl PlannedRefillPointStatus {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.status {
Some(v) => { w.enumeration("aegi:status", v.literal())?; }
None => return Err(w.missing("aegi:status")),
}
match &self.overall_period {
Some(v) => { v.write(w, "aegi:overallPeriod", "", "")?; }
None => return Err(w.missing("aegi:overallPeriod")),
}
if let Some(v) = &self.planned_refill_point_status_extension { w.extension("aegi:_plannedRefillPointStatusExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RefillPointStatus {
pub reference: Option<Box<com::VersionedReference>>,
pub last_updated: Option<DateTime>,
pub opening_status: Option<afac::OpeningStatusEnum>,
pub operation_status: Option<afac::OperationStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<afac::OperatingHours>,
pub new_rates: Option<afac::Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
pub supplemental_facility_status: Vec<afac::SupplementalFacilityStatus>,
pub facility_status_extension: Option<Box<Extension>>,
pub status: Option<RefillPointStatusEnum>,
pub units_in_stock: Option<Units>,
pub energy_rate_update: Vec<EnergyRateUpdate>,
pub waiting_time: Option<Box<afac::DurationValue>>,
pub planned_refill_point_status: Vec<PlannedRefillPointStatus>,
pub refill_point_status_extension: Option<Box<Extension>>,
}
impl RefillPointStatus {
const FIELDS: &'static [u32] = &[0x20aba, 0x208ba, 0x209a8, 0x209ce, 0x20aca, 0x20b77, 0x20958, 0x20959, 0x2080d, 0x20498, 0x20b91, 0x20499, 0x10b73, 0x10c0a, 0x107dc, 0x10c6b, 0x10a42, 0x10593];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x101b1);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = Vec::new();
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = Vec::new();
let mut e15 = None;
let mut e16 = Vec::new();
let mut e17 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x208ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x209a8 => { let v = r.enumeration::<afac::OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x209ce => { let v = r.enumeration::<afac::OperationStatusEnum>()?; r.set(&mut e3, v, 2510); }
0x20aca => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2762); }
0x20b77 => { let v = r.multilingual()?; r.set(&mut e5, v, 2935); }
0x20958 => { let v = afac::OperatingHours::read(r)?; r.set(&mut e6, v, 2392); }
0x20959 => { let v = afac::Rates::read(r)?; r.set(&mut e7, v, 2393); }
0x2080d => { let v = com::AnyFault::read(r)?; r.set(&mut e8, v, 2061); }
0x20498 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1176); }
0x20b91 => { let v = Some(afac::SupplementalFacilityStatus::read(r)?); e10.extend(v); }
0x20499 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1177); }
0x10b73 => { let v = r.enumeration::<RefillPointStatusEnum>()?; r.set(&mut e12, v, 2931); }
0x10c0a => { let v = r.value::<f32>()?; r.set(&mut e13, v, 3082); }
0x107dc => { let v = Some(EnergyRateUpdate::read(r)?); e14.extend(v); }
0x10c6b => { let v = Some(afac::DurationValue::read(r)?); r.set(&mut e15, v.map(Box::new), 3179); }
0x10a42 => { let v = Some(PlannedRefillPointStatus::read(r)?); e16.extend(v); }
0x10593 => { let v = r.raw()?; r.set(&mut e17, v.map(Box::new), 1427); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2746);
r.required(&e12, 2931);
let v = Self {
reference: e0,
last_updated: e1,
opening_status: e2,
operation_status: e3,
regular_operating_hours_in_force: e4,
status_description: e5,
new_operating_hours: e6,
new_rates: e7,
fault: e8,
facility_object_status_extension: e9,
supplemental_facility_status: e10,
facility_status_extension: e11,
status: e12,
units_in_stock: e13,
energy_rate_update: e14,
waiting_time: e15,
planned_refill_point_status: e16,
refill_point_status_extension: e17,
};
r.close();
Ok(v)
}
}
impl RefillPointStatus {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.reference {
Some(v) => { v.write(w, "afac:reference", "", " targetClass=\"afac:FacilityObject\"")?; }
None => return Err(w.missing("afac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("afac:openingStatus", v.literal())?; }
if let Some(v) = &self.operation_status { w.enumeration("afac:operationStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("afac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("afac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "afac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "afac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "afac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("afac:_facilityObjectStatusExtension", v)?; }
for v in &self.supplemental_facility_status { v.write(w, "afac:supplementalFacilityStatus", "", "")?; }
if let Some(v) = &self.facility_status_extension { w.extension("afac:_facilityStatusExtension", v)?; }
match &self.status {
Some(v) => { w.enumeration("aegi:status", v.literal())?; }
None => return Err(w.missing("aegi:status")),
}
if let Some(v) = &self.units_in_stock { w.leaf("aegi:unitsInStock", v)?; }
for v in &self.energy_rate_update { v.write(w, "aegi:energyRateUpdate", "", "")?; }
if let Some(v) = &self.waiting_time { v.write(w, "aegi:waitingTime", "", "")?; }
for v in &self.planned_refill_point_status { v.write(w, "aegi:plannedRefillPointStatus", "", "")?; }
if let Some(v) = &self.refill_point_status_extension { w.extension("aegi:_refillPointStatusExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ServiceType {
pub service_type: Option<ServiceTypeEnum>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub service_type_extension: Option<Box<Extension>>,
}
impl ServiceType {
const FIELDS: &'static [u32] = &[0x10b34, 0x109f1, 0x105b7];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x101d6);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10b34 => { let v = r.enumeration::<ServiceTypeEnum>()?; r.set(&mut e0, v, 2868); }
0x109f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e1, v.map(Box::new), 2545); }
0x105b7 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1463); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2868);
let v = Self {
service_type: e0,
overall_period: e1,
service_type_extension: e2,
};
r.close();
Ok(v)
}
}
impl ServiceType {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.service_type {
Some(v) => { w.enumeration("aegi:serviceType", v.literal())?; }
None => return Err(w.missing("aegi:serviceType")),
}
if let Some(v) = &self.overall_period { v.write(w, "aegi:overallPeriod", "", "")?; }
if let Some(v) = &self.service_type_extension { w.extension("aegi:_serviceTypeExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TimeBasedApplicability {
pub from_minute: Option<com::NonNegativeInteger>,
pub to_minute: Option<com::NonNegativeInteger>,
pub time_based_applicability_extension: Option<Box<Extension>>,
}
impl TimeBasedApplicability {
const FIELDS: &'static [u32] = &[0x10832, 0x10bc6, 0x105f2];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10214);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10832 => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2098); }
0x10bc6 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 3014); }
0x105f2 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1522); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
from_minute: e0,
to_minute: e1,
time_based_applicability_extension: e2,
};
r.close();
Ok(v)
}
}
impl TimeBasedApplicability {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.from_minute { w.leaf("aegi:fromMinute", v)?; }
if let Some(v) = &self.to_minute { w.leaf("aegi:toMinute", v)?; }
if let Some(v) = &self.time_based_applicability_extension { w.extension("aegi:_timeBasedApplicabilityExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyEnergyProduct {
EnergyProduct(Box<EnergyProduct>),
ElectricEnergy(Box<ElectricEnergy>),
}
impl AnyEnergyProduct {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x100a3) => Self::EnergyProduct(Box::new(EnergyProduct::read(r)?)),
Some(0x10093) => Self::ElectricEnergy(Box::new(ElectricEnergy::read(r)?)),
None => Self::EnergyProduct(Box::new(EnergyProduct::read(r)?)),
_ => {
r.unknown_type_as("EnergyProduct");
Self::EnergyProduct(Box::new(EnergyProduct::read(r)?))
}
}))
}
pub fn energy_product_name(&self) -> Option<&MultilingualString> {
match self {
Self::EnergyProduct(v) => v.energy_product_name.as_ref(),
Self::ElectricEnergy(v) => v.energy_product_name.as_ref(),
}
}
pub fn is_green_energy(&self) -> Option<&com::Boolean> {
match self {
Self::EnergyProduct(v) => v.is_green_energy.as_ref(),
Self::ElectricEnergy(v) => v.is_green_energy.as_ref(),
}
}
pub fn energy_rate_by_reference(&self) -> &[com::Reference] {
match self {
Self::EnergyProduct(v) => &v.energy_rate_by_reference,
Self::ElectricEnergy(v) => &v.energy_rate_by_reference,
}
}
pub fn energy_product_information(&self) -> Option<&str> {
match self {
Self::EnergyProduct(v) => v.energy_product_information.as_deref(),
Self::ElectricEnergy(v) => v.energy_product_information.as_deref(),
}
}
pub fn renewable_energy_evidence(&self) -> Option<&str> {
match self {
Self::EnergyProduct(v) => v.renewable_energy_evidence.as_deref(),
Self::ElectricEnergy(v) => v.renewable_energy_evidence.as_deref(),
}
}
pub fn mobility_service_provider(&self) -> &[afac::Organisation] {
match self {
Self::EnergyProduct(v) => &v.mobility_service_provider,
Self::ElectricEnergy(v) => &v.mobility_service_provider,
}
}
pub fn energy_rate(&self) -> &[EnergyRate] {
match self {
Self::EnergyProduct(v) => &v.energy_rate,
Self::ElectricEnergy(v) => &v.energy_rate,
}
}
pub fn energy_product_extension(&self) -> Option<&Extension> {
match self {
Self::EnergyProduct(v) => v.energy_product_extension.as_deref(),
Self::ElectricEnergy(v) => v.energy_product_extension.as_deref(),
}
}
}
impl AnyEnergyProduct {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::EnergyProduct(v) => v.write(w, tag, "", ""),
Self::ElectricEnergy(v) => v.write(w, tag, " xsi:type=\"aegi:ElectricEnergy\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum RefillPoint {
AlternativeFuelsRefillPoint(Box<AlternativeFuelsRefillPoint>),
DieselRefillPoint(Box<DieselRefillPoint>),
ElectricChargingPoint(Box<ElectricChargingPoint>),
PetrolRefillPoint(Box<PetrolRefillPoint>),
}
impl RefillPoint {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x1002b) => Self::AlternativeFuelsRefillPoint(Box::new(AlternativeFuelsRefillPoint::read(r)?)),
Some(0x1007c) => Self::DieselRefillPoint(Box::new(DieselRefillPoint::read(r)?)),
Some(0x10091) => Self::ElectricChargingPoint(Box::new(ElectricChargingPoint::read(r)?)),
Some(0x10171) => Self::PetrolRefillPoint(Box::new(PetrolRefillPoint::read(r)?)),
_ => {
r.unknown_type("RefillPoint")?;
return Ok(None);
}
}))
}
pub fn id(&self) -> Option<&str> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.id.as_deref(),
Self::DieselRefillPoint(v) => v.id.as_deref(),
Self::ElectricChargingPoint(v) => v.id.as_deref(),
Self::PetrolRefillPoint(v) => v.id.as_deref(),
}
}
pub fn version(&self) -> Option<&str> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.version.as_deref(),
Self::DieselRefillPoint(v) => v.version.as_deref(),
Self::ElectricChargingPoint(v) => v.version.as_deref(),
Self::PetrolRefillPoint(v) => v.version.as_deref(),
}
}
pub fn name(&self) -> Option<&MultilingualString> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.name.as_ref(),
Self::DieselRefillPoint(v) => v.name.as_ref(),
Self::ElectricChargingPoint(v) => v.name.as_ref(),
Self::PetrolRefillPoint(v) => v.name.as_ref(),
}
}
pub fn alias(&self) -> &[MultilingualString] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.alias,
Self::DieselRefillPoint(v) => &v.alias,
Self::ElectricChargingPoint(v) => &v.alias,
Self::PetrolRefillPoint(v) => &v.alias,
}
}
pub fn last_updated(&self) -> Option<&DateTime> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.last_updated.as_ref(),
Self::DieselRefillPoint(v) => v.last_updated.as_ref(),
Self::ElectricChargingPoint(v) => v.last_updated.as_ref(),
Self::PetrolRefillPoint(v) => v.last_updated.as_ref(),
}
}
pub fn description(&self) -> Option<&MultilingualString> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.description.as_ref(),
Self::DieselRefillPoint(v) => v.description.as_ref(),
Self::ElectricChargingPoint(v) => v.description.as_ref(),
Self::PetrolRefillPoint(v) => v.description.as_ref(),
}
}
pub fn accessibility(&self) -> &[afac::AccessibilityEnum] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.accessibility,
Self::DieselRefillPoint(v) => &v.accessibility,
Self::ElectricChargingPoint(v) => &v.accessibility,
Self::PetrolRefillPoint(v) => &v.accessibility,
}
}
pub fn additional_information(&self) -> &[MultilingualString] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.additional_information,
Self::DieselRefillPoint(v) => &v.additional_information,
Self::ElectricChargingPoint(v) => &v.additional_information,
Self::PetrolRefillPoint(v) => &v.additional_information,
}
}
pub fn external_identifier(&self) -> &[afac::ExternalIdentifier] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.external_identifier,
Self::DieselRefillPoint(v) => &v.external_identifier,
Self::ElectricChargingPoint(v) => &v.external_identifier,
Self::PetrolRefillPoint(v) => &v.external_identifier,
}
}
pub fn information_website(&self) -> &[com::UrlLink] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.information_website,
Self::DieselRefillPoint(v) => &v.information_website,
Self::ElectricChargingPoint(v) => &v.information_website,
Self::PetrolRefillPoint(v) => &v.information_website,
}
}
pub fn photo_url(&self) -> &[com::UrlLink] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.photo_url,
Self::DieselRefillPoint(v) => &v.photo_url,
Self::ElectricChargingPoint(v) => &v.photo_url,
Self::PetrolRefillPoint(v) => &v.photo_url,
}
}
pub fn photo(&self) -> &[afac::Image] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.photo,
Self::DieselRefillPoint(v) => &v.photo,
Self::ElectricChargingPoint(v) => &v.photo,
Self::PetrolRefillPoint(v) => &v.photo,
}
}
pub fn operating_hours(&self) -> Option<&afac::OperatingHours> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.operating_hours.as_ref(),
Self::DieselRefillPoint(v) => v.operating_hours.as_ref(),
Self::ElectricChargingPoint(v) => v.operating_hours.as_ref(),
Self::PetrolRefillPoint(v) => v.operating_hours.as_ref(),
}
}
pub fn location_reference(&self) -> Option<&loc::LocationReference> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.location_reference.as_ref(),
Self::DieselRefillPoint(v) => v.location_reference.as_ref(),
Self::ElectricChargingPoint(v) => v.location_reference.as_ref(),
Self::PetrolRefillPoint(v) => v.location_reference.as_ref(),
}
}
pub fn owner(&self) -> Option<&afac::Organisation> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.owner.as_ref(),
Self::DieselRefillPoint(v) => v.owner.as_ref(),
Self::ElectricChargingPoint(v) => v.owner.as_ref(),
Self::PetrolRefillPoint(v) => v.owner.as_ref(),
}
}
pub fn operator(&self) -> Option<&afac::Organisation> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.operator.as_ref(),
Self::DieselRefillPoint(v) => v.operator.as_ref(),
Self::ElectricChargingPoint(v) => v.operator.as_ref(),
Self::PetrolRefillPoint(v) => v.operator.as_ref(),
}
}
pub fn helpdesk(&self) -> Option<&afac::Organisation> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.helpdesk.as_ref(),
Self::DieselRefillPoint(v) => v.helpdesk.as_ref(),
Self::ElectricChargingPoint(v) => v.helpdesk.as_ref(),
Self::PetrolRefillPoint(v) => v.helpdesk.as_ref(),
}
}
pub fn associated_facility(&self) -> &[afac::AnyAssociatedFacility] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.associated_facility,
Self::DieselRefillPoint(v) => &v.associated_facility,
Self::ElectricChargingPoint(v) => &v.associated_facility,
Self::PetrolRefillPoint(v) => &v.associated_facility,
}
}
pub fn rates(&self) -> Option<&afac::Rates> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.rates.as_ref(),
Self::DieselRefillPoint(v) => v.rates.as_ref(),
Self::ElectricChargingPoint(v) => v.rates.as_ref(),
Self::PetrolRefillPoint(v) => v.rates.as_ref(),
}
}
pub fn applicable_for_vehicles(&self) -> &[com::VehicleCharacteristics] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.applicable_for_vehicles,
Self::DieselRefillPoint(v) => &v.applicable_for_vehicles,
Self::ElectricChargingPoint(v) => &v.applicable_for_vehicles,
Self::PetrolRefillPoint(v) => &v.applicable_for_vehicles,
}
}
pub fn dimension(&self) -> Option<&afac::Dimension> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.dimension.as_deref(),
Self::DieselRefillPoint(v) => v.dimension.as_deref(),
Self::ElectricChargingPoint(v) => v.dimension.as_deref(),
Self::PetrolRefillPoint(v) => v.dimension.as_deref(),
}
}
pub fn amenities(&self) -> Option<&afac::Amenities> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.amenities.as_deref(),
Self::DieselRefillPoint(v) => v.amenities.as_deref(),
Self::ElectricChargingPoint(v) => v.amenities.as_deref(),
Self::PetrolRefillPoint(v) => v.amenities.as_deref(),
}
}
pub fn facility_object_extension(&self) -> Option<&Extension> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.facility_object_extension.as_deref(),
Self::DieselRefillPoint(v) => v.facility_object_extension.as_deref(),
Self::ElectricChargingPoint(v) => v.facility_object_extension.as_deref(),
Self::PetrolRefillPoint(v) => v.facility_object_extension.as_deref(),
}
}
pub fn supplemental_facility(&self) -> &[afac::SupplementalFacility] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.supplemental_facility,
Self::DieselRefillPoint(v) => &v.supplemental_facility,
Self::ElectricChargingPoint(v) => &v.supplemental_facility,
Self::PetrolRefillPoint(v) => &v.supplemental_facility,
}
}
pub fn dedicated_parking_spaces(&self) -> &[DedicatedParkingSpaces] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.dedicated_parking_spaces,
Self::DieselRefillPoint(v) => &v.dedicated_parking_spaces,
Self::ElectricChargingPoint(v) => &v.dedicated_parking_spaces,
Self::PetrolRefillPoint(v) => &v.dedicated_parking_spaces,
}
}
pub fn facility_extension(&self) -> Option<&Extension> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.facility_extension.as_deref(),
Self::DieselRefillPoint(v) => v.facility_extension.as_deref(),
Self::ElectricChargingPoint(v) => v.facility_extension.as_deref(),
Self::PetrolRefillPoint(v) => v.facility_extension.as_deref(),
}
}
pub fn delivery_unit(&self) -> Option<&DeliveryUnitEnum> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.delivery_unit.as_ref(),
Self::DieselRefillPoint(v) => v.delivery_unit.as_ref(),
Self::ElectricChargingPoint(v) => v.delivery_unit.as_ref(),
Self::PetrolRefillPoint(v) => v.delivery_unit.as_ref(),
}
}
pub fn maximum_delivery_amount(&self) -> Option<&Units> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.maximum_delivery_amount.as_ref(),
Self::DieselRefillPoint(v) => v.maximum_delivery_amount.as_ref(),
Self::ElectricChargingPoint(v) => v.maximum_delivery_amount.as_ref(),
Self::PetrolRefillPoint(v) => v.maximum_delivery_amount.as_ref(),
}
}
pub fn minimum_delivery_amount(&self) -> Option<&Units> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.minimum_delivery_amount.as_ref(),
Self::DieselRefillPoint(v) => v.minimum_delivery_amount.as_ref(),
Self::ElectricChargingPoint(v) => v.minimum_delivery_amount.as_ref(),
Self::PetrolRefillPoint(v) => v.minimum_delivery_amount.as_ref(),
}
}
pub fn model_type(&self) -> Option<&MultilingualString> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.model_type.as_ref(),
Self::DieselRefillPoint(v) => v.model_type.as_ref(),
Self::ElectricChargingPoint(v) => v.model_type.as_ref(),
Self::PetrolRefillPoint(v) => v.model_type.as_ref(),
}
}
pub fn reservation(&self) -> Option<&afac::ReservationTypeEnum> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.reservation.as_ref(),
Self::DieselRefillPoint(v) => v.reservation.as_ref(),
Self::ElectricChargingPoint(v) => v.reservation.as_ref(),
Self::PetrolRefillPoint(v) => v.reservation.as_ref(),
}
}
pub fn energy_product(&self) -> &[AnyEnergyProduct] {
match self {
Self::AlternativeFuelsRefillPoint(v) => &v.energy_product,
Self::DieselRefillPoint(v) => &v.energy_product,
Self::ElectricChargingPoint(v) => &v.energy_product,
Self::PetrolRefillPoint(v) => &v.energy_product,
}
}
pub fn refill_point_extension(&self) -> Option<&Extension> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.refill_point_extension.as_deref(),
Self::DieselRefillPoint(v) => v.refill_point_extension.as_deref(),
Self::ElectricChargingPoint(v) => v.refill_point_extension.as_deref(),
Self::PetrolRefillPoint(v) => v.refill_point_extension.as_deref(),
}
}
}
impl RefillPoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::AlternativeFuelsRefillPoint(v) => v.write(w, tag, " xsi:type=\"aegi:AlternativeFuelsRefillPoint\"", ""),
Self::DieselRefillPoint(v) => v.write(w, tag, " xsi:type=\"aegi:DieselRefillPoint\"", ""),
Self::ElectricChargingPoint(v) => v.write(w, tag, " xsi:type=\"aegi:ElectricChargingPoint\"", ""),
Self::PetrolRefillPoint(v) => v.write(w, tag, " xsi:type=\"aegi:PetrolRefillPoint\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyRefillPointStatus {
RefillPointStatus(Box<RefillPointStatus>),
ElectricChargingPointStatus(Box<ElectricChargingPointStatus>),
}
impl AnyRefillPointStatus {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x101b1) => Self::RefillPointStatus(Box::new(RefillPointStatus::read(r)?)),
Some(0x10092) => Self::ElectricChargingPointStatus(Box::new(ElectricChargingPointStatus::read(r)?)),
None => Self::RefillPointStatus(Box::new(RefillPointStatus::read(r)?)),
_ => {
r.unknown_type_as("RefillPointStatus");
Self::RefillPointStatus(Box::new(RefillPointStatus::read(r)?))
}
}))
}
pub fn reference(&self) -> Option<&com::VersionedReference> {
match self {
Self::RefillPointStatus(v) => v.reference.as_deref(),
Self::ElectricChargingPointStatus(v) => v.reference.as_deref(),
}
}
pub fn last_updated(&self) -> Option<&DateTime> {
match self {
Self::RefillPointStatus(v) => v.last_updated.as_ref(),
Self::ElectricChargingPointStatus(v) => v.last_updated.as_ref(),
}
}
pub fn opening_status(&self) -> Option<&afac::OpeningStatusEnum> {
match self {
Self::RefillPointStatus(v) => v.opening_status.as_ref(),
Self::ElectricChargingPointStatus(v) => v.opening_status.as_ref(),
}
}
pub fn operation_status(&self) -> Option<&afac::OperationStatusEnum> {
match self {
Self::RefillPointStatus(v) => v.operation_status.as_ref(),
Self::ElectricChargingPointStatus(v) => v.operation_status.as_ref(),
}
}
pub fn regular_operating_hours_in_force(&self) -> Option<&com::Boolean> {
match self {
Self::RefillPointStatus(v) => v.regular_operating_hours_in_force.as_ref(),
Self::ElectricChargingPointStatus(v) => v.regular_operating_hours_in_force.as_ref(),
}
}
pub fn status_description(&self) -> Option<&MultilingualString> {
match self {
Self::RefillPointStatus(v) => v.status_description.as_ref(),
Self::ElectricChargingPointStatus(v) => v.status_description.as_ref(),
}
}
pub fn new_operating_hours(&self) -> Option<&afac::OperatingHours> {
match self {
Self::RefillPointStatus(v) => v.new_operating_hours.as_ref(),
Self::ElectricChargingPointStatus(v) => v.new_operating_hours.as_ref(),
}
}
pub fn new_rates(&self) -> Option<&afac::Rates> {
match self {
Self::RefillPointStatus(v) => v.new_rates.as_ref(),
Self::ElectricChargingPointStatus(v) => v.new_rates.as_ref(),
}
}
pub fn fault(&self) -> Option<&com::AnyFault> {
match self {
Self::RefillPointStatus(v) => v.fault.as_ref(),
Self::ElectricChargingPointStatus(v) => v.fault.as_ref(),
}
}
pub fn facility_object_status_extension(&self) -> Option<&Extension> {
match self {
Self::RefillPointStatus(v) => v.facility_object_status_extension.as_deref(),
Self::ElectricChargingPointStatus(v) => v.facility_object_status_extension.as_deref(),
}
}
pub fn supplemental_facility_status(&self) -> &[afac::SupplementalFacilityStatus] {
match self {
Self::RefillPointStatus(v) => &v.supplemental_facility_status,
Self::ElectricChargingPointStatus(v) => &v.supplemental_facility_status,
}
}
pub fn facility_status_extension(&self) -> Option<&Extension> {
match self {
Self::RefillPointStatus(v) => v.facility_status_extension.as_deref(),
Self::ElectricChargingPointStatus(v) => v.facility_status_extension.as_deref(),
}
}
pub fn status(&self) -> Option<&RefillPointStatusEnum> {
match self {
Self::RefillPointStatus(v) => v.status.as_ref(),
Self::ElectricChargingPointStatus(v) => v.status.as_ref(),
}
}
pub fn units_in_stock(&self) -> Option<&Units> {
match self {
Self::RefillPointStatus(v) => v.units_in_stock.as_ref(),
Self::ElectricChargingPointStatus(v) => v.units_in_stock.as_ref(),
}
}
pub fn energy_rate_update(&self) -> &[EnergyRateUpdate] {
match self {
Self::RefillPointStatus(v) => &v.energy_rate_update,
Self::ElectricChargingPointStatus(v) => &v.energy_rate_update,
}
}
pub fn waiting_time(&self) -> Option<&afac::DurationValue> {
match self {
Self::RefillPointStatus(v) => v.waiting_time.as_deref(),
Self::ElectricChargingPointStatus(v) => v.waiting_time.as_deref(),
}
}
pub fn planned_refill_point_status(&self) -> &[PlannedRefillPointStatus] {
match self {
Self::RefillPointStatus(v) => &v.planned_refill_point_status,
Self::ElectricChargingPointStatus(v) => &v.planned_refill_point_status,
}
}
pub fn refill_point_status_extension(&self) -> Option<&Extension> {
match self {
Self::RefillPointStatus(v) => v.refill_point_status_extension.as_deref(),
Self::ElectricChargingPointStatus(v) => v.refill_point_status_extension.as_deref(),
}
}
}
impl AnyRefillPointStatus {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::RefillPointStatus(v) => v.write(w, tag, "", ""),
Self::ElectricChargingPointStatus(v) => v.write(w, tag, " xsi:type=\"aegi:ElectricChargingPointStatus\"", ""),
}
}
}