#[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, afir_energy_infrastructure as aegi, 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),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum BioethanolTypeEnum {
SuperE5,
SuperE10,
Unknown,
Other,
Extended(String),
}
impl BioethanolTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::SuperE5 => "superE5",
Self::SuperE10 => "superE10",
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),
"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,
DomesticA,
DomesticB,
DomesticC,
DomesticD,
DomesticE,
DomesticF,
DomesticG,
DomesticH,
DomesticI,
DomesticJ,
DomesticK,
DomesticL,
DomesticM,
DomesticN,
DomesticO,
Iec60309x2single16,
Iec60309x2three16,
Iec60309x2three32,
Iec60309x2three64,
Iec62196T1,
Iec62196T1COMBO,
Iec62196T2,
Iec62196T2COMBO,
Iec62196T3A,
Iec62196T3C,
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::DomesticA => "domesticA",
Self::DomesticB => "domesticB",
Self::DomesticC => "domesticC",
Self::DomesticD => "domesticD",
Self::DomesticE => "domesticE",
Self::DomesticF => "domesticF",
Self::DomesticG => "domesticG",
Self::DomesticH => "domesticH",
Self::DomesticI => "domesticI",
Self::DomesticJ => "domesticJ",
Self::DomesticK => "domesticK",
Self::DomesticL => "domesticL",
Self::DomesticM => "domesticM",
Self::DomesticN => "domesticN",
Self::DomesticO => "domesticO",
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::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),
"domesticA" => Some(Self::DomesticA),
"domesticB" => Some(Self::DomesticB),
"domesticC" => Some(Self::DomesticC),
"domesticD" => Some(Self::DomesticD),
"domesticE" => Some(Self::DomesticE),
"domesticF" => Some(Self::DomesticF),
"domesticG" => Some(Self::DomesticG),
"domesticH" => Some(Self::DomesticH),
"domesticI" => Some(Self::DomesticI),
"domesticJ" => Some(Self::DomesticJ),
"domesticK" => Some(Self::DomesticK),
"domesticL" => Some(Self::DomesticL),
"domesticM" => Some(Self::DomesticM),
"domesticN" => Some(Self::DomesticN),
"domesticO" => Some(Self::DomesticO),
"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),
"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 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 DieselTypeEnum {
CarDiesel,
TruckDiesel,
BioDiesel,
Unknown,
Extended(String),
}
impl DieselTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::CarDiesel => "carDiesel",
Self::TruckDiesel => "truckDiesel",
Self::BioDiesel => "bioDiesel",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for DieselTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"carDiesel" => Some(Self::CarDiesel),
"truckDiesel" => Some(Self::TruckDiesel),
"bioDiesel" => Some(Self::BioDiesel),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl DieselTypeEnum {
#[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 {
RoofedStation,
InBuilding,
OpenSpace,
Onstreet,
OnCompanySite,
Other,
Extended(String),
}
impl EnergyInfrastructureSiteTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::RoofedStation => "roofedStation",
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 {
"roofedStation" => Some(Self::RoofedStation),
"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 HydrogenFuellingProcessProtocolEnum {
Sae2601v2010,
Sae2601v2014,
Sae2601v2016,
McMethod,
Unknown,
Extended(String),
}
impl HydrogenFuellingProcessProtocolEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Sae2601v2010 => "sae2601v2010",
Self::Sae2601v2014 => "sae2601v2014",
Self::Sae2601v2016 => "sae2601v2016",
Self::McMethod => "mcMethod",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for HydrogenFuellingProcessProtocolEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"sae2601v2010" => Some(Self::Sae2601v2010),
"sae2601v2014" => Some(Self::Sae2601v2014),
"sae2601v2016" => Some(Self::Sae2601v2016),
"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 OrganicGasTypeEnum {
All,
Cng,
Lng,
Lpg,
Biogas,
Other,
Unknown,
Extended(String),
}
impl OrganicGasTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::All => "all",
Self::Cng => "cng",
Self::Lng => "lng",
Self::Lpg => "lpg",
Self::Biogas => "biogas",
Self::Other => "other",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for OrganicGasTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"all" => Some(Self::All),
"cng" => Some(Self::Cng),
"lng" => Some(Self::Lng),
"lpg" => Some(Self::Lpg),
"biogas" => Some(Self::Biogas),
"other" => Some(Self::Other),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl OrganicGasTypeEnum {
#[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 {
All,
Octane95,
Octane98,
Leaded,
Unleaded,
SuperE5,
SuperE10,
Other,
Unknown,
Extended(String),
}
impl PetrolTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::All => "all",
Self::Octane95 => "octane95",
Self::Octane98 => "octane98",
Self::Leaded => "leaded",
Self::Unleaded => "unleaded",
Self::SuperE5 => "superE5",
Self::SuperE10 => "superE10",
Self::Other => "other",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PetrolTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"all" => Some(Self::All),
"octane95" => Some(Self::Octane95),
"octane98" => Some(Self::Octane98),
"leaded" => Some(Self::Leaded),
"unleaded" => Some(Self::Unleaded),
"superE5" => Some(Self::SuperE5),
"superE10" => Some(Self::SuperE10),
"other" => Some(Self::Other),
"unknown" => Some(Self::Unknown),
_ => 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 PricingPolicyEnum {
PricePerChargingTime,
PricePerDeliveryUnit,
Contract,
FlatRate,
Unknown,
Free,
Other,
Extended(String),
}
impl PricingPolicyEnum {
pub fn as_str(&self) -> &str {
match self {
Self::PricePerChargingTime => "pricePerChargingTime",
Self::PricePerDeliveryUnit => "pricePerDeliveryUnit",
Self::Contract => "contract",
Self::FlatRate => "flatRate",
Self::Unknown => "unknown",
Self::Free => "free",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PricingPolicyEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"pricePerChargingTime" => Some(Self::PricePerChargingTime),
"pricePerDeliveryUnit" => Some(Self::PricePerDeliveryUnit),
"contract" => Some(Self::Contract),
"flatRate" => Some(Self::FlatRate),
"unknown" => Some(Self::Unknown),
"free" => Some(Self::Free),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PricingPolicyEnum {
#[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 RefillSolutionHydrogenEnum {
GaseousHydrogen350barCar,
GaseousHydrogen350barTruck,
GaseousHydrogen700barCar,
GaseousHydrogen700barTruck,
LiquidHydrogen,
CryoCompressedHydrogren,
Unknown,
Extended(String),
}
impl RefillSolutionHydrogenEnum {
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::Extended(v) => v,
}
}
}
impl Enumeration for RefillSolutionHydrogenEnum {
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),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RefillSolutionHydrogenEnum {
#[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,
SelfService,
Unattended,
Extended(String),
}
impl ServiceTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::FullService => "fullService",
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),
"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),
}
}
}
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 AssociatedParking {
pub r#type: Option<fac::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] = &[0x80bfe, 0x8080c, 0x80777, 0x80425, 0x70708, 0x70bfb, 0x706f4, 0x70426];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x70039);
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 {
0x80bfe => { let v = r.enumeration::<fac::FacilityTypeEnum>()?; r.set(&mut e0, v, 3070); }
0x8080c => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e1, v.map(Box::new), 2060); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e2, v, 1911); }
0x80425 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1061); }
0x70708 => { let v = r.value::<u64>()?; r.set(&mut e4, v, 1800); }
0x70bfb => { let v = r.value::<u64>()?; r.set(&mut e5, v, 3067); }
0x706f4 => { let v = r.value::<u64>()?; r.set(&mut e6, v, 1780); }
0x70426 => { 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("fac:type", v.literal())?; }
None => return Err(w.missing("fac:type")),
}
if let Some(v) = &self.facility_reference { v.write(w, "fac:facilityReference", "", " targetClass=\"fac:FacilityObject\"")?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
if let Some(v) = &self.associated_facility_extension { w.extension("fac:_associatedFacilityExtension", v)?; }
if let Some(v) = &self.car_parking_capacity { w.leaf("egi:carParkingCapacity", v)?; }
if let Some(v) = &self.truck_parking_capacity { w.leaf("egi:truckParkingCapacity", v)?; }
if let Some(v) = &self.bike_parking_capacity { w.leaf("egi:bikeParkingCapacity", v)?; }
if let Some(v) = &self.associated_parking_extension { w.extension("egi:_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 charging_mode: Option<ChargingModeEnum>,
pub connector_format: Option<ConnectorFormatTypeEnum>,
pub max_power_at_socket: Option<Watt>,
pub voltage: Option<Volt>,
pub maximum_current: Option<Ampere>,
pub connector_extension: Option<Box<Extension>>,
}
impl Connector {
const FIELDS: &'static [u32] = &[0x70737, 0x709e6, 0x70749, 0x70716, 0x70736, 0x70901, 0x70c69, 0x70906, 0x70446];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x7005a);
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;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x70737 => { let v = r.enumeration::<ConnectorTypeEnum>()?; r.set(&mut e0, v, 1847); }
0x709e6 => { let v = r.string()?; r.set(&mut e1, v, 2534); }
0x70749 => { let v = r.string()?; e2.extend(v); }
0x70716 => { let v = r.enumeration::<ChargingModeEnum>()?; r.set(&mut e3, v, 1814); }
0x70736 => { let v = r.enumeration::<ConnectorFormatTypeEnum>()?; r.set(&mut e4, v, 1846); }
0x70901 => { let v = r.value::<f32>()?; r.set(&mut e5, v, 2305); }
0x70c69 => { let v = r.value::<f32>()?; r.set(&mut e6, v, 3177); }
0x70906 => { let v = r.value::<f32>()?; r.set(&mut e7, v, 2310); }
0x70446 => { 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(&e5, 2305);
let v = Self {
connector_type: e0,
other_connector: e1,
country_of_domestic_socket: e2,
charging_mode: e3,
connector_format: e4,
max_power_at_socket: e5,
voltage: e6,
maximum_current: 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("egi:connectorType", v.literal())?; }
None => return Err(w.missing("egi:connectorType")),
}
if let Some(v) = &self.other_connector { w.max_len("otherConnector", v, 1024)?; w.leaf("egi:otherConnector", v)?; }
for v in &self.country_of_domestic_socket { w.max_len("countryOfDomesticSocket", v, 2)?; w.leaf("egi:countryOfDomesticSocket", v)?; }
if let Some(v) = &self.charging_mode { w.enumeration("egi:chargingMode", v.literal())?; }
if let Some(v) = &self.connector_format { w.enumeration("egi:connectorFormat", v.literal())?; }
match &self.max_power_at_socket {
Some(v) => { w.leaf("egi:maxPowerAtSocket", v)?; }
None => return Err(w.missing("egi:maxPowerAtSocket")),
}
if let Some(v) = &self.voltage { w.leaf("egi:voltage", v)?; }
if let Some(v) = &self.maximum_current { w.leaf("egi:maximumCurrent", v)?; }
if let Some(v) = &self.connector_extension { w.extension("egi:_connectorExtension", 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 external_identifier: Option<String>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<fac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<fac::Image>,
pub operating_hours: Option<fac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<fac::Organisation>,
pub operator: Option<fac::Organisation>,
pub associated_facility: Vec<fac::AnyAssociatedFacility>,
pub rates: Option<fac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<fac::Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<fac::SupplementalFacility>,
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<fac::ReservationTypeEnum>,
pub service_type: Option<Box<ServiceType>>,
pub refill_point_extension: Option<Box<Extension>>,
pub diesel_type: Vec<DieselTypeEnum>,
pub cetane: Option<com::NonNegativeInteger>,
pub diesel_refill_point_extension: Option<Box<Extension>>,
}
impl DieselRefillPoint {
const FIELDS: &'static [u32] = &[0x80949, 0x806ad, 0x80805, 0x808ba, 0x80777, 0x8066b, 0x80690, 0x80887, 0x80a2d, 0x80a2c, 0x809c5, 0x808e8, 0x809f8, 0x809d2, 0x806d3, 0x80ab0, 0x806c6, 0x80786, 0x80497, 0x80b90, 0x80496, 0x7076d, 0x70907, 0x70936, 0x70946, 0x70ae4, 0x70b34, 0x70592, 0x70784, 0x70713, 0x70467];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x7007c);
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 = None;
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 = Vec::new();
let mut e15 = None;
let mut e16 = Vec::new();
let mut e17 = None;
let mut e18 = None;
let mut e19 = Vec::new();
let mut e20 = None;
let mut e21 = None;
let mut e22 = None;
let mut e23 = None;
let mut e24 = None;
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = Vec::new();
let mut e29 = None;
let mut e30 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x806ad => { let v = r.multilingual()?; e1.extend(v); }
0x80805 => { let v = r.string()?; r.set(&mut e2, v, 2053); }
0x808ba => { let v = r.date_time()?; r.set(&mut e3, v, 2234); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e4, v, 1911); }
0x8066b => { let v = r.enumeration::<fac::AccessibilityEnum>()?; e5.extend(v); }
0x80690 => { let v = r.multilingual()?; e6.extend(v); }
0x80887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x80a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x80a2c => { let v = Some(fac::Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x808e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x809f8 => { let v = fac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = fac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = fac::AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = fac::Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(fac::Dimension::read(r)?); r.set(&mut e17, v.map(Box::new), 1926); }
0x80497 => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1175); }
0x80b90 => { let v = fac::SupplementalFacility::read(r)?; e19.extend(v); }
0x80496 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1174); }
0x7076d => { let v = r.enumeration::<DeliveryUnitEnum>()?; r.set(&mut e21, v, 1901); }
0x70907 => { let v = r.value::<f32>()?; r.set(&mut e22, v, 2311); }
0x70936 => { let v = r.value::<f32>()?; r.set(&mut e23, v, 2358); }
0x70946 => { let v = r.multilingual()?; r.set(&mut e24, v, 2374); }
0x70ae4 => { let v = r.enumeration::<fac::ReservationTypeEnum>()?; r.set(&mut e25, v, 2788); }
0x70b34 => { let v = Some(ServiceType::read(r)?); r.set(&mut e26, v.map(Box::new), 2868); }
0x70592 => { let v = r.raw()?; r.set(&mut e27, v.map(Box::new), 1426); }
0x70784 => { let v = r.enumeration::<DieselTypeEnum>()?; e28.extend(v); }
0x70713 => { let v = r.value::<u64>()?; r.set(&mut e29, v, 1811); }
0x70467 => { let v = r.raw()?; r.set(&mut e30, v.map(Box::new), 1127); }
_ => 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,
external_identifier: e2,
last_updated: e3,
description: e4,
accessibility: e5,
additional_information: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
associated_facility: e14,
rates: e15,
applicable_for_vehicles: e16,
dimension: e17,
facility_object_extension: e18,
supplemental_facility: e19,
facility_extension: e20,
delivery_unit: e21,
maximum_delivery_amount: e22,
minimum_delivery_amount: e23,
model_type: e24,
reservation: e25,
service_type: e26,
refill_point_extension: e27,
diesel_type: e28,
cetane: e29,
diesel_refill_point_extension: e30,
};
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("fac:name", v)?; }
for v in &self.alias { w.multilingual("fac:alias", v)?; }
if let Some(v) = &self.external_identifier { w.max_len("externalIdentifier", v, 1024)?; w.leaf("fac:externalIdentifier", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
for v in &self.accessibility { w.enumeration("fac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("fac:additionalInformation", v)?; }
for v in &self.information_website { v.write(w, "fac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "fac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "fac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "fac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "fac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "fac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "fac:operator")?; }
for v in &self.associated_facility { v.write(w, "fac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "fac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "fac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "fac:dimension", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("fac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "fac:supplementalFacility")?; }
if let Some(v) = &self.facility_extension { w.extension("fac:_facilityExtension", v)?; }
if let Some(v) = &self.delivery_unit { w.enumeration("egi:deliveryUnit", v.literal())?; }
if let Some(v) = &self.maximum_delivery_amount { w.leaf("egi:maximumDeliveryAmount", v)?; }
if let Some(v) = &self.minimum_delivery_amount { w.leaf("egi:minimumDeliveryAmount", v)?; }
if let Some(v) = &self.model_type { w.multilingual("egi:modelType", v)?; }
if let Some(v) = &self.reservation { w.enumeration("egi:reservation", v.literal())?; }
if let Some(v) = &self.service_type { v.write(w, "egi:serviceType", "", "")?; }
if let Some(v) = &self.refill_point_extension { w.extension("egi:_refillPointExtension", v)?; }
for v in &self.diesel_type { w.enumeration("egi:dieselType", v.literal())?; }
if let Some(v) = &self.cetane { w.leaf("egi:cetane", v)?; }
if let Some(v) = &self.diesel_refill_point_extension { w.extension("egi:_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 external_identifier: Option<String>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<fac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<fac::Image>,
pub operating_hours: Option<fac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<fac::Organisation>,
pub operator: Option<fac::Organisation>,
pub associated_facility: Vec<fac::AnyAssociatedFacility>,
pub rates: Option<fac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<fac::Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub availability: Option<fac::AvailabilityEnum>,
pub quantity: Option<com::NonNegativeInteger>,
pub regularly_cleaned: Option<com::Boolean>,
pub applicable_for_user: Vec<fac::UserTypeEnum>,
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] = &[0x80949, 0x806ad, 0x80805, 0x808ba, 0x80777, 0x8066b, 0x80690, 0x80887, 0x80a2d, 0x80a2c, 0x809c5, 0x808e8, 0x809f8, 0x809d2, 0x806d3, 0x80ab0, 0x806c6, 0x80786, 0x80497, 0x806dc, 0x80a98, 0x80acc, 0x806c5, 0x805dc, 0x707b8, 0x7047b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x70090);
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 = None;
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 = 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 = None;
let mut e22 = Vec::new();
let mut e23 = None;
let mut e24 = None;
let mut e25 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x806ad => { let v = r.multilingual()?; e1.extend(v); }
0x80805 => { let v = r.string()?; r.set(&mut e2, v, 2053); }
0x808ba => { let v = r.date_time()?; r.set(&mut e3, v, 2234); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e4, v, 1911); }
0x8066b => { let v = r.enumeration::<fac::AccessibilityEnum>()?; e5.extend(v); }
0x80690 => { let v = r.multilingual()?; e6.extend(v); }
0x80887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x80a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x80a2c => { let v = Some(fac::Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x808e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x809f8 => { let v = fac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = fac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = fac::AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = fac::Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(fac::Dimension::read(r)?); r.set(&mut e17, v.map(Box::new), 1926); }
0x80497 => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1175); }
0x806dc => { let v = r.enumeration::<fac::AvailabilityEnum>()?; r.set(&mut e19, v, 1756); }
0x80a98 => { let v = r.value::<u64>()?; r.set(&mut e20, v, 2712); }
0x80acc => { let v = r.value::<bool>()?; r.set(&mut e21, v, 2764); }
0x806c5 => { let v = r.enumeration::<fac::UserTypeEnum>()?; e22.extend(v); }
0x805dc => { let v = r.raw()?; r.set(&mut e23, v.map(Box::new), 1500); }
0x707b8 => { let v = Some(ElectricChargingPoint::read(r)?); r.set(&mut e24, v.map(Box::new), 1976); }
0x7047b => { let v = r.raw()?; r.set(&mut e25, v.map(Box::new), 1147); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e24, 1976);
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
external_identifier: e2,
last_updated: e3,
description: e4,
accessibility: e5,
additional_information: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
associated_facility: e14,
rates: e15,
applicable_for_vehicles: e16,
dimension: e17,
facility_object_extension: e18,
availability: e19,
quantity: e20,
regularly_cleaned: e21,
applicable_for_user: e22,
supplemental_facility_extension: e23,
electric_charging_point: e24,
electric_charging_equipment_extension: e25,
};
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("fac:name", v)?; }
for v in &self.alias { w.multilingual("fac:alias", v)?; }
if let Some(v) = &self.external_identifier { w.max_len("externalIdentifier", v, 1024)?; w.leaf("fac:externalIdentifier", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
for v in &self.accessibility { w.enumeration("fac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("fac:additionalInformation", v)?; }
for v in &self.information_website { v.write(w, "fac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "fac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "fac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "fac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "fac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "fac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "fac:operator")?; }
for v in &self.associated_facility { v.write(w, "fac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "fac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "fac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "fac:dimension", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("fac:_facilityObjectExtension", v)?; }
if let Some(v) = &self.availability { w.enumeration("fac:availability", v.literal())?; }
if let Some(v) = &self.quantity { w.leaf("fac:quantity", v)?; }
if let Some(v) = &self.regularly_cleaned { w.leaf("fac:regularlyCleaned", v)?; }
for v in &self.applicable_for_user { w.enumeration("fac:applicableForUser", v.literal())?; }
if let Some(v) = &self.supplemental_facility_extension { w.extension("fac:_supplementalFacilityExtension", v)?; }
match &self.electric_charging_point {
Some(v) => { v.write(w, "egi:electricChargingPoint", "", "")?; }
None => return Err(w.missing("egi:electricChargingPoint")),
}
if let Some(v) = &self.electric_charging_equipment_extension { w.extension("egi:_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 external_identifier: Option<String>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<fac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<fac::Image>,
pub operating_hours: Option<fac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<fac::Organisation>,
pub operator: Option<fac::Organisation>,
pub associated_facility: Vec<fac::AnyAssociatedFacility>,
pub rates: Option<fac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<fac::Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<fac::SupplementalFacility>,
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<fac::ReservationTypeEnum>,
pub service_type: Option<Box<ServiceType>>,
pub refill_point_extension: Option<Box<Extension>>,
pub usage_type: Vec<ChargingPointUsageTypeEnum>,
pub vehicle_to_grid_communication_type: Vec<VehicleToGridCommunicationTypeEnum>,
pub available_voltage: Vec<Volt>,
pub available_charging_power: Vec<Watt>,
pub connector: Vec<Connector>,
pub electric_energy_mix: Vec<ElectricEnergyMix>,
pub vehicle_space: Vec<VehicleSpace>,
pub electric_charging_point_extension: Option<Box<Extension>>,
}
impl ElectricChargingPoint {
const FIELDS: &'static [u32] = &[0x80949, 0x806ad, 0x80805, 0x808ba, 0x80777, 0x8066b, 0x80690, 0x80887, 0x80a2d, 0x80a2c, 0x809c5, 0x808e8, 0x809f8, 0x809d2, 0x806d3, 0x80ab0, 0x806c6, 0x80786, 0x80497, 0x80b90, 0x80496, 0x7076d, 0x70907, 0x70936, 0x70946, 0x70ae4, 0x70b34, 0x70592, 0x70c1a, 0x70c48, 0x706e2, 0x706df, 0x70735, 0x707b9, 0x70c46, 0x7047c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x70091);
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 = None;
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 = Vec::new();
let mut e15 = None;
let mut e16 = Vec::new();
let mut e17 = None;
let mut e18 = None;
let mut e19 = Vec::new();
let mut e20 = None;
let mut e21 = None;
let mut e22 = None;
let mut e23 = None;
let mut e24 = None;
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = Vec::new();
let mut e29 = Vec::new();
let mut e30 = Vec::new();
let mut e31 = Vec::new();
let mut e32 = Vec::new();
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 {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x806ad => { let v = r.multilingual()?; e1.extend(v); }
0x80805 => { let v = r.string()?; r.set(&mut e2, v, 2053); }
0x808ba => { let v = r.date_time()?; r.set(&mut e3, v, 2234); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e4, v, 1911); }
0x8066b => { let v = r.enumeration::<fac::AccessibilityEnum>()?; e5.extend(v); }
0x80690 => { let v = r.multilingual()?; e6.extend(v); }
0x80887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x80a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x80a2c => { let v = Some(fac::Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x808e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x809f8 => { let v = fac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = fac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = fac::AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = fac::Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(fac::Dimension::read(r)?); r.set(&mut e17, v.map(Box::new), 1926); }
0x80497 => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1175); }
0x80b90 => { let v = fac::SupplementalFacility::read(r)?; e19.extend(v); }
0x80496 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1174); }
0x7076d => { let v = r.enumeration::<DeliveryUnitEnum>()?; r.set(&mut e21, v, 1901); }
0x70907 => { let v = r.value::<f32>()?; r.set(&mut e22, v, 2311); }
0x70936 => { let v = r.value::<f32>()?; r.set(&mut e23, v, 2358); }
0x70946 => { let v = r.multilingual()?; r.set(&mut e24, v, 2374); }
0x70ae4 => { let v = r.enumeration::<fac::ReservationTypeEnum>()?; r.set(&mut e25, v, 2788); }
0x70b34 => { let v = Some(ServiceType::read(r)?); r.set(&mut e26, v.map(Box::new), 2868); }
0x70592 => { let v = r.raw()?; r.set(&mut e27, v.map(Box::new), 1426); }
0x70c1a => { let v = r.enumeration::<ChargingPointUsageTypeEnum>()?; e28.extend(v); }
0x70c48 => { let v = r.enumeration::<VehicleToGridCommunicationTypeEnum>()?; e29.extend(v); }
0x706e2 => { let v = r.value::<f32>()?; e30.extend(v); }
0x706df => { let v = r.value::<f32>()?; e31.extend(v); }
0x70735 => { let v = Some(Connector::read(r)?); e32.extend(v); }
0x707b9 => { let v = Some(ElectricEnergyMix::read(r)?); e33.extend(v); }
0x70c46 => { let v = Some(VehicleSpace::read(r)?); e34.extend(v); }
0x7047c => { let v = r.raw()?; r.set(&mut e35, v.map(Box::new), 1148); }
_ => 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,
external_identifier: e2,
last_updated: e3,
description: e4,
accessibility: e5,
additional_information: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
associated_facility: e14,
rates: e15,
applicable_for_vehicles: e16,
dimension: e17,
facility_object_extension: e18,
supplemental_facility: e19,
facility_extension: e20,
delivery_unit: e21,
maximum_delivery_amount: e22,
minimum_delivery_amount: e23,
model_type: e24,
reservation: e25,
service_type: e26,
refill_point_extension: e27,
usage_type: e28,
vehicle_to_grid_communication_type: e29,
available_voltage: e30,
available_charging_power: e31,
connector: e32,
electric_energy_mix: e33,
vehicle_space: e34,
electric_charging_point_extension: e35,
};
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("fac:name", v)?; }
for v in &self.alias { w.multilingual("fac:alias", v)?; }
if let Some(v) = &self.external_identifier { w.max_len("externalIdentifier", v, 1024)?; w.leaf("fac:externalIdentifier", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
for v in &self.accessibility { w.enumeration("fac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("fac:additionalInformation", v)?; }
for v in &self.information_website { v.write(w, "fac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "fac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "fac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "fac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "fac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "fac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "fac:operator")?; }
for v in &self.associated_facility { v.write(w, "fac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "fac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "fac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "fac:dimension", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("fac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "fac:supplementalFacility")?; }
if let Some(v) = &self.facility_extension { w.extension("fac:_facilityExtension", v)?; }
if let Some(v) = &self.delivery_unit { w.enumeration("egi:deliveryUnit", v.literal())?; }
if let Some(v) = &self.maximum_delivery_amount { w.leaf("egi:maximumDeliveryAmount", v)?; }
if let Some(v) = &self.minimum_delivery_amount { w.leaf("egi:minimumDeliveryAmount", v)?; }
if let Some(v) = &self.model_type { w.multilingual("egi:modelType", v)?; }
if let Some(v) = &self.reservation { w.enumeration("egi:reservation", v.literal())?; }
if let Some(v) = &self.service_type { v.write(w, "egi:serviceType", "", "")?; }
if let Some(v) = &self.refill_point_extension { w.extension("egi:_refillPointExtension", v)?; }
for v in &self.usage_type { w.enumeration("egi:usageType", v.literal())?; }
for v in &self.vehicle_to_grid_communication_type { w.enumeration("egi:vehicleToGridCommunicationType", v.literal())?; }
for v in &self.available_voltage { w.leaf("egi:availableVoltage", v)?; }
for v in &self.available_charging_power { w.leaf("egi:availableChargingPower", v)?; }
for v in &self.connector { v.write(w, "egi:connector", "", "")?; }
for v in &self.electric_energy_mix { v.write(w, "egi:electricEnergyMix", "", "")?; }
for v in &self.vehicle_space { v.write(w, "egi:vehicleSpace", "", "")?; }
if let Some(v) = &self.electric_charging_point_extension { w.extension("egi:_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<fac::OpeningStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<fac::OperatingHours>,
pub new_rates: Option<fac::Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
pub supplemental_facility_status: Vec<fac::SupplementalFacilityStatus>,
pub facility_status_extension: Option<Box<Extension>>,
pub status: Option<RefillPointStatusEnum>,
pub units_in_stock: Option<Units>,
pub waiting_time: Option<Box<fac::DurationValue>>,
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_energy_mix_override: Vec<ElectricEnergyMix>,
pub electric_charging_point_status_extension: Option<Box<Extension>>,
}
impl ElectricChargingPointStatus {
const FIELDS: &'static [u32] = &[0x80aba, 0x808ba, 0x809a8, 0x80aca, 0x80b77, 0x80958, 0x80959, 0x8080d, 0x80498, 0x80b91, 0x80499, 0x70b73, 0x70c0a, 0x70c6b, 0x70593, 0x70ad9, 0x70754, 0x70752, 0x7095a, 0x707ba, 0x7047d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x70092);
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 = 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 = None;
let mut e16 = None;
let mut e17 = None;
let mut e18 = Vec::new();
let mut e19 = Vec::new();
let mut e20 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x808ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x809a8 => { let v = r.enumeration::<fac::OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x80aca => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2762); }
0x80b77 => { let v = r.multilingual()?; r.set(&mut e4, v, 2935); }
0x80958 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e5, v, 2392); }
0x80959 => { let v = fac::Rates::read(r)?; r.set(&mut e6, v, 2393); }
0x8080d => { let v = com::AnyFault::read(r)?; r.set(&mut e7, v, 2061); }
0x80498 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1176); }
0x80b91 => { let v = Some(fac::SupplementalFacilityStatus::read(r)?); e9.extend(v); }
0x80499 => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1177); }
0x70b73 => { let v = r.enumeration::<RefillPointStatusEnum>()?; r.set(&mut e11, v, 2931); }
0x70c0a => { let v = r.value::<f32>()?; r.set(&mut e12, v, 3082); }
0x70c6b => { let v = Some(fac::DurationValue::read(r)?); r.set(&mut e13, v.map(Box::new), 3179); }
0x70593 => { let v = r.raw()?; r.set(&mut e14, v.map(Box::new), 1427); }
0x70ad9 => { let v = r.value::<f32>()?; r.set(&mut e15, v, 2777); }
0x70754 => { let v = r.value::<f32>()?; r.set(&mut e16, v, 1876); }
0x70752 => { let v = r.value::<f32>()?; r.set(&mut e17, v, 1874); }
0x7095a => { let v = r.date_time()?; e18.extend(v); }
0x707ba => { let v = Some(ElectricEnergyMix::read(r)?); e19.extend(v); }
0x7047d => { let v = r.raw()?; r.set(&mut e20, 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(&e11, 2931);
let v = Self {
reference: e0,
last_updated: e1,
opening_status: e2,
regular_operating_hours_in_force: e3,
status_description: e4,
new_operating_hours: e5,
new_rates: e6,
fault: e7,
facility_object_status_extension: e8,
supplemental_facility_status: e9,
facility_status_extension: e10,
status: e11,
units_in_stock: e12,
waiting_time: e13,
refill_point_status_extension: e14,
remaining_charging_time: e15,
current_voltage: e16,
current_charging_power: e17,
next_available_charging_slots: e18,
electric_energy_mix_override: e19,
electric_charging_point_status_extension: e20,
};
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, "fac:reference", "", " targetClass=\"fac:FacilityObject\"")?; }
None => return Err(w.missing("fac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("fac:openingStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("fac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("fac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "fac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "fac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "fac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("fac:_facilityObjectStatusExtension", v)?; }
for v in &self.supplemental_facility_status { v.write(w, "fac:supplementalFacilityStatus", "", "")?; }
if let Some(v) = &self.facility_status_extension { w.extension("fac:_facilityStatusExtension", v)?; }
match &self.status {
Some(v) => { w.enumeration("egi:status", v.literal())?; }
None => return Err(w.missing("egi:status")),
}
if let Some(v) = &self.units_in_stock { w.leaf("egi:unitsInStock", v)?; }
if let Some(v) = &self.waiting_time { v.write(w, "egi:waitingTime", "", "")?; }
if let Some(v) = &self.refill_point_status_extension { w.extension("egi:_refillPointStatusExtension", v)?; }
if let Some(v) = &self.remaining_charging_time { w.leaf("egi:remainingChargingTime", v)?; }
if let Some(v) = &self.current_voltage { w.leaf("egi:currentVoltage", v)?; }
if let Some(v) = &self.current_charging_power { w.leaf("egi:currentChargingPower", v)?; }
for v in &self.next_available_charging_slots { w.leaf("egi:nextAvailableChargingSlots", v)?; }
for v in &self.electric_energy_mix_override { v.write(w, "egi:electricEnergyMixOverride", "", "")?; }
if let Some(v) = &self.electric_charging_point_status_extension { w.extension("egi:_electricChargingPointStatusExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ElectricEnergyMix {
pub energy_mix_index: Option<com::Integer>,
pub energy_product_name: Option<MultilingualString>,
pub is_green_energy: Option<com::Boolean>,
pub carbon_dioxide_impact: Option<com::Float>,
pub nuclear_waste_impact: Option<com::Float>,
pub not_available: Option<com::Boolean>,
pub electric_energy_source_ratio: Vec<ElectricEnergySourceRatio>,
pub energy_provider: Option<fac::Organisation>,
pub rates: Option<fac::Rates>,
pub electric_energy_mix_extension: Option<Box<Extension>>,
}
impl ElectricEnergyMix {
const FIELDS: &'static [u32] = &[0x707d7, 0x7089b, 0x70709, 0x7096f, 0x7096d, 0x707bb, 0x707d8, 0x70ab0, 0x7047f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x70094);
let a0 = r.req_attr_value::<i64>(2002)?;
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 = None;
let mut e8 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x707d7 => { let v = r.multilingual()?; r.set(&mut e0, v, 2007); }
0x7089b => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2203); }
0x70709 => { let v = r.value::<f32>()?; r.set(&mut e2, v, 1801); }
0x7096f => { let v = r.value::<f32>()?; r.set(&mut e3, v, 2415); }
0x7096d => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2413); }
0x707bb => { let v = Some(ElectricEnergySourceRatio::read(r)?); e5.extend(v); }
0x707d8 => { let v = fac::Organisation::read(r)?; r.set(&mut e6, v, 2008); }
0x70ab0 => { let v = fac::Rates::read(r)?; r.set(&mut e7, v, 2736); }
0x7047f => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1151); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
energy_mix_index: a0,
energy_product_name: e0,
is_green_energy: e1,
carbon_dioxide_impact: e2,
nuclear_waste_impact: e3,
not_available: e4,
electric_energy_source_ratio: e5,
energy_provider: e6,
rates: e7,
electric_energy_mix_extension: e8,
};
r.close();
Ok(v)
}
}
impl ElectricEnergyMix {
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_mix_index {
Some(v) => { w.attr_value("energyMixIndex", v)?; }
None => return Err(w.missing_attr("energyMixIndex")),
}
if let Some(v) = &self.energy_product_name { w.multilingual("egi:energyProductName", v)?; }
if let Some(v) = &self.is_green_energy { w.leaf("egi:isGreenEnergy", v)?; }
if let Some(v) = &self.carbon_dioxide_impact { w.leaf("egi:carbonDioxideImpact", v)?; }
if let Some(v) = &self.nuclear_waste_impact { w.leaf("egi:nuclearWasteImpact", v)?; }
if let Some(v) = &self.not_available { w.leaf("egi:notAvailable", v)?; }
for v in &self.electric_energy_source_ratio { v.write(w, "egi:electricEnergySourceRatio", "", "")?; }
if let Some(v) = &self.energy_provider { v.write(w, "egi:energyProvider")?; }
if let Some(v) = &self.rates { v.write(w, "egi:rates")?; }
if let Some(v) = &self.electric_energy_mix_extension { w.extension("egi:_electricEnergyMixExtension", 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] = &[0x707dd, 0x709e7, 0x70b52, 0x70480];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x70095);
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 {
0x707dd => { let v = r.enumeration::<ElectricEnergySourceTypeEnum>()?; r.set(&mut e0, v, 2013); }
0x709e7 => { let v = r.string()?; r.set(&mut e1, v, 2535); }
0x70b52 => { let v = Some(com::PercentageValue::read(r)?); r.set(&mut e2, v.map(Box::new), 2898); }
0x70480 => { 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("egi:energySource", v.literal())?; }
None => return Err(w.missing("egi:energySource")),
}
if let Some(v) = &self.other_energy_source { w.max_len("otherEnergySource", v, 1024)?; w.leaf("egi:otherEnergySource", v)?; }
match &self.source_ratio_value {
Some(v) => { v.write(w, "egi:sourceRatioValue", "", "")?; }
None => return Err(w.missing("egi:sourceRatioValue")),
}
if let Some(v) = &self.electric_energy_source_ratio_extension { w.extension("egi:_electricEnergySourceRatioExtension", 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 external_identifier: Option<String>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<fac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<fac::Image>,
pub operating_hours: Option<fac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<fac::Organisation>,
pub operator: Option<fac::Organisation>,
pub associated_facility: Vec<fac::AnyAssociatedFacility>,
pub rates: Option<fac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<fac::Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<fac::SupplementalFacility>,
pub facility_extension: Option<Box<Extension>>,
pub type_of_site: Option<EnergyInfrastructureSiteTypeEnum>,
pub brand: Option<MultilingualString>,
pub exclusive_users: Vec<fac::UserTypeEnum>,
pub preferred_users: Vec<fac::UserTypeEnum>,
pub entrance: Vec<loc::Location>,
pub exit: Vec<loc::Location>,
pub energy_infrastructure_station: Vec<EnergyInfrastructureStation>,
pub energy_infrastructure_site_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureSite {
const FIELDS: &'static [u32] = &[0x80949, 0x806ad, 0x80805, 0x808ba, 0x80777, 0x8066b, 0x80690, 0x80887, 0x80a2d, 0x80a2c, 0x809c5, 0x808e8, 0x809f8, 0x809d2, 0x806d3, 0x80ab0, 0x806c6, 0x80786, 0x80497, 0x80b90, 0x80496, 0x70c04, 0x706fd, 0x707f5, 0x70a6c, 0x707e2, 0x707f7, 0x707cf, 0x70484];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x7009a);
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 = None;
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 = Vec::new();
let mut e15 = None;
let mut e16 = Vec::new();
let mut e17 = None;
let mut e18 = None;
let mut e19 = Vec::new();
let mut e20 = None;
let mut e21 = None;
let mut e22 = None;
let mut e23 = Vec::new();
let mut e24 = Vec::new();
let mut e25 = Vec::new();
let mut e26 = Vec::new();
let mut e27 = Vec::new();
let mut e28 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x806ad => { let v = r.multilingual()?; e1.extend(v); }
0x80805 => { let v = r.string()?; r.set(&mut e2, v, 2053); }
0x808ba => { let v = r.date_time()?; r.set(&mut e3, v, 2234); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e4, v, 1911); }
0x8066b => { let v = r.enumeration::<fac::AccessibilityEnum>()?; e5.extend(v); }
0x80690 => { let v = r.multilingual()?; e6.extend(v); }
0x80887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x80a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x80a2c => { let v = Some(fac::Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x808e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x809f8 => { let v = fac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = fac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = fac::AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = fac::Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(fac::Dimension::read(r)?); r.set(&mut e17, v.map(Box::new), 1926); }
0x80497 => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1175); }
0x80b90 => { let v = fac::SupplementalFacility::read(r)?; e19.extend(v); }
0x80496 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1174); }
0x70c04 => { let v = r.enumeration::<EnergyInfrastructureSiteTypeEnum>()?; r.set(&mut e21, v, 3076); }
0x706fd => { let v = r.multilingual()?; r.set(&mut e22, v, 1789); }
0x707f5 => { let v = r.enumeration::<fac::UserTypeEnum>()?; e23.extend(v); }
0x70a6c => { let v = r.enumeration::<fac::UserTypeEnum>()?; e24.extend(v); }
0x707e2 => { let v = loc::Location::read(r)?; e25.extend(v); }
0x707f7 => { let v = loc::Location::read(r)?; e26.extend(v); }
0x707cf => { let v = Some(EnergyInfrastructureStation::read(r)?); e27.extend(v); }
0x70484 => { let v = r.raw()?; r.set(&mut e28, 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,
external_identifier: e2,
last_updated: e3,
description: e4,
accessibility: e5,
additional_information: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
associated_facility: e14,
rates: e15,
applicable_for_vehicles: e16,
dimension: e17,
facility_object_extension: e18,
supplemental_facility: e19,
facility_extension: e20,
type_of_site: e21,
brand: e22,
exclusive_users: e23,
preferred_users: e24,
entrance: e25,
exit: e26,
energy_infrastructure_station: e27,
energy_infrastructure_site_extension: e28,
};
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("fac:name", v)?; }
for v in &self.alias { w.multilingual("fac:alias", v)?; }
if let Some(v) = &self.external_identifier { w.max_len("externalIdentifier", v, 1024)?; w.leaf("fac:externalIdentifier", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
for v in &self.accessibility { w.enumeration("fac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("fac:additionalInformation", v)?; }
for v in &self.information_website { v.write(w, "fac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "fac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "fac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "fac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "fac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "fac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "fac:operator")?; }
for v in &self.associated_facility { v.write(w, "fac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "fac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "fac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "fac:dimension", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("fac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "fac:supplementalFacility")?; }
if let Some(v) = &self.facility_extension { w.extension("fac:_facilityExtension", v)?; }
if let Some(v) = &self.type_of_site { w.enumeration("egi:typeOfSite", v.literal())?; }
if let Some(v) = &self.brand { w.multilingual("egi:brand", v)?; }
for v in &self.exclusive_users { w.enumeration("egi:exclusiveUsers", v.literal())?; }
for v in &self.preferred_users { w.enumeration("egi:preferredUsers", v.literal())?; }
for v in &self.entrance { v.write(w, "egi:entrance")?; }
for v in &self.exit { v.write(w, "egi:exit")?; }
for v in &self.energy_infrastructure_station { v.write(w, "egi:energyInfrastructureStation", "", "")?; }
if let Some(v) = &self.energy_infrastructure_site_extension { w.extension("egi:_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<fac::OpeningStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<fac::OperatingHours>,
pub new_rates: Option<fac::Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
pub supplemental_facility_status: Vec<fac::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 energy_infrastructure_site_status_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureSiteStatus {
const FIELDS: &'static [u32] = &[0x80aba, 0x808ba, 0x809a8, 0x80aca, 0x80b77, 0x80958, 0x80959, 0x8080d, 0x80498, 0x80b91, 0x80499, 0x706de, 0x706e1, 0x707d0, 0x70485];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x7009b);
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 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = Vec::new();
let mut e14 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x808ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x809a8 => { let v = r.enumeration::<fac::OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x80aca => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2762); }
0x80b77 => { let v = r.multilingual()?; r.set(&mut e4, v, 2935); }
0x80958 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e5, v, 2392); }
0x80959 => { let v = fac::Rates::read(r)?; r.set(&mut e6, v, 2393); }
0x8080d => { let v = com::AnyFault::read(r)?; r.set(&mut e7, v, 2061); }
0x80498 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1176); }
0x80b91 => { let v = Some(fac::SupplementalFacilityStatus::read(r)?); e9.extend(v); }
0x80499 => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1177); }
0x706de => { let v = r.value::<u64>()?; r.set(&mut e11, v, 1758); }
0x706e1 => { let v = r.value::<u64>()?; r.set(&mut e12, v, 1761); }
0x707d0 => { let v = Some(EnergyInfrastructureStationStatus::read(r)?); e13.extend(v); }
0x70485 => { let v = r.raw()?; r.set(&mut e14, 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,
regular_operating_hours_in_force: e3,
status_description: e4,
new_operating_hours: e5,
new_rates: e6,
fault: e7,
facility_object_status_extension: e8,
supplemental_facility_status: e9,
facility_status_extension: e10,
available_car_parking_places: e11,
available_truck_parking_places: e12,
energy_infrastructure_station_status: e13,
energy_infrastructure_site_status_extension: e14,
};
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, "fac:reference", "", " targetClass=\"fac:FacilityObject\"")?; }
None => return Err(w.missing("fac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("fac:openingStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("fac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("fac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "fac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "fac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "fac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("fac:_facilityObjectStatusExtension", v)?; }
for v in &self.supplemental_facility_status { v.write(w, "fac:supplementalFacilityStatus", "", "")?; }
if let Some(v) = &self.facility_status_extension { w.extension("fac:_facilityStatusExtension", v)?; }
if let Some(v) = &self.available_car_parking_places { w.leaf("egi:availableCarParkingPlaces", v)?; }
if let Some(v) = &self.available_truck_parking_places { w.leaf("egi:availableTruckParkingPlaces", v)?; }
for v in &self.energy_infrastructure_station_status { v.write(w, "egi:energyInfrastructureStationStatus", "", "")?; }
if let Some(v) = &self.energy_infrastructure_site_status_extension { w.extension("egi:_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 external_identifier: Option<String>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<fac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<fac::Image>,
pub operating_hours: Option<fac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<fac::Organisation>,
pub operator: Option<fac::Organisation>,
pub associated_facility: Vec<fac::AnyAssociatedFacility>,
pub rates: Option<fac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<fac::Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<fac::SupplementalFacility>,
pub facility_extension: Option<Box<Extension>>,
pub authentication_and_identification_methods: Vec<AuthenticationAndIdentificationEnum>,
pub number_of_refill_points: Option<com::NonNegativeInteger>,
pub refill_point_by_reference: Vec<com::VersionedReference>,
pub user_interface_language: Vec<com::Language>,
pub energy_provider: Option<fac::Organisation>,
pub energy_distributor: Option<fac::Organisation>,
pub service_type: Option<Box<ServiceType>>,
pub refill_point: Vec<RefillPoint>,
pub energy_infrastructure_station_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureStation {
const FIELDS: &'static [u32] = &[0x80949, 0x806ad, 0x80805, 0x808ba, 0x80777, 0x8066b, 0x80690, 0x80887, 0x80a2d, 0x80a2c, 0x809c5, 0x808e8, 0x809f8, 0x809d2, 0x806d3, 0x80ab0, 0x806c6, 0x80786, 0x80497, 0x80b90, 0x80496, 0x706d6, 0x70981, 0x70ac4, 0x70c1c, 0x707d8, 0x707cc, 0x70b34, 0x70ac3, 0x70486];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x7009c);
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 = None;
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 = Vec::new();
let mut e15 = None;
let mut e16 = Vec::new();
let mut e17 = None;
let mut e18 = None;
let mut e19 = Vec::new();
let mut e20 = None;
let mut e21 = Vec::new();
let mut e22 = None;
let mut e23 = Vec::new();
let mut e24 = Vec::new();
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = Vec::new();
let mut e29 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x806ad => { let v = r.multilingual()?; e1.extend(v); }
0x80805 => { let v = r.string()?; r.set(&mut e2, v, 2053); }
0x808ba => { let v = r.date_time()?; r.set(&mut e3, v, 2234); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e4, v, 1911); }
0x8066b => { let v = r.enumeration::<fac::AccessibilityEnum>()?; e5.extend(v); }
0x80690 => { let v = r.multilingual()?; e6.extend(v); }
0x80887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x80a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x80a2c => { let v = Some(fac::Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x808e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x809f8 => { let v = fac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = fac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = fac::AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = fac::Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(fac::Dimension::read(r)?); r.set(&mut e17, v.map(Box::new), 1926); }
0x80497 => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1175); }
0x80b90 => { let v = fac::SupplementalFacility::read(r)?; e19.extend(v); }
0x80496 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1174); }
0x706d6 => { let v = r.enumeration::<AuthenticationAndIdentificationEnum>()?; e21.extend(v); }
0x70981 => { let v = r.value::<u64>()?; r.set(&mut e22, v, 2433); }
0x70ac4 => { let v = Some(com::VersionedReference::read(r)?); e23.extend(v); }
0x70c1c => { let v = r.string()?; e24.extend(v); }
0x707d8 => { let v = fac::Organisation::read(r)?; r.set(&mut e25, v, 2008); }
0x707cc => { let v = fac::Organisation::read(r)?; r.set(&mut e26, v, 1996); }
0x70b34 => { let v = Some(ServiceType::read(r)?); r.set(&mut e27, v.map(Box::new), 2868); }
0x70ac3 => { let v = RefillPoint::read(r)?; e28.extend(v); }
0x70486 => { let v = r.raw()?; r.set(&mut e29, 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,
external_identifier: e2,
last_updated: e3,
description: e4,
accessibility: e5,
additional_information: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
associated_facility: e14,
rates: e15,
applicable_for_vehicles: e16,
dimension: e17,
facility_object_extension: e18,
supplemental_facility: e19,
facility_extension: e20,
authentication_and_identification_methods: e21,
number_of_refill_points: e22,
refill_point_by_reference: e23,
user_interface_language: e24,
energy_provider: e25,
energy_distributor: e26,
service_type: e27,
refill_point: e28,
energy_infrastructure_station_extension: e29,
};
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("fac:name", v)?; }
for v in &self.alias { w.multilingual("fac:alias", v)?; }
if let Some(v) = &self.external_identifier { w.max_len("externalIdentifier", v, 1024)?; w.leaf("fac:externalIdentifier", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
for v in &self.accessibility { w.enumeration("fac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("fac:additionalInformation", v)?; }
for v in &self.information_website { v.write(w, "fac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "fac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "fac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "fac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "fac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "fac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "fac:operator")?; }
for v in &self.associated_facility { v.write(w, "fac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "fac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "fac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "fac:dimension", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("fac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "fac:supplementalFacility")?; }
if let Some(v) = &self.facility_extension { w.extension("fac:_facilityExtension", v)?; }
for v in &self.authentication_and_identification_methods { w.enumeration("egi:authenticationAndIdentificationMethods", v.literal())?; }
if let Some(v) = &self.number_of_refill_points { w.leaf("egi:numberOfRefillPoints", v)?; }
for v in &self.refill_point_by_reference { v.write(w, "egi:refillPointByReference", "", "")?; }
for v in &self.user_interface_language { w.pattern("userInterfaceLanguage", v, Pattern::Language)?; w.leaf("egi:userInterfaceLanguage", v)?; }
if let Some(v) = &self.energy_provider { v.write(w, "egi:energyProvider")?; }
if let Some(v) = &self.energy_distributor { v.write(w, "egi:energyDistributor")?; }
if let Some(v) = &self.service_type { v.write(w, "egi:serviceType", "", "")?; }
for v in &self.refill_point { v.write(w, "egi:refillPoint")?; }
if let Some(v) = &self.energy_infrastructure_station_extension { w.extension("egi:_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<fac::OpeningStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<fac::OperatingHours>,
pub new_rates: Option<fac::Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
pub supplemental_facility_status: Vec<fac::SupplementalFacilityStatus>,
pub facility_status_extension: Option<Box<Extension>>,
pub is_available: Option<com::Boolean>,
pub refill_point_status: Vec<AnyRefillPointStatus>,
pub energy_infrastructure_station_status_extension: Option<Box<Extension>>,
}
impl EnergyInfrastructureStationStatus {
const FIELDS: &'static [u32] = &[0x80aba, 0x808ba, 0x809a8, 0x80aca, 0x80b77, 0x80958, 0x80959, 0x8080d, 0x80498, 0x80b91, 0x80499, 0x70898, 0x70ac5, 0x70487];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x7009d);
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 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = Vec::new();
let mut e13 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x808ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x809a8 => { let v = r.enumeration::<fac::OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x80aca => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2762); }
0x80b77 => { let v = r.multilingual()?; r.set(&mut e4, v, 2935); }
0x80958 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e5, v, 2392); }
0x80959 => { let v = fac::Rates::read(r)?; r.set(&mut e6, v, 2393); }
0x8080d => { let v = com::AnyFault::read(r)?; r.set(&mut e7, v, 2061); }
0x80498 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1176); }
0x80b91 => { let v = Some(fac::SupplementalFacilityStatus::read(r)?); e9.extend(v); }
0x80499 => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1177); }
0x70898 => { let v = r.value::<bool>()?; r.set(&mut e11, v, 2200); }
0x70ac5 => { let v = AnyRefillPointStatus::read(r)?; e12.extend(v); }
0x70487 => { let v = r.raw()?; r.set(&mut e13, 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,
regular_operating_hours_in_force: e3,
status_description: e4,
new_operating_hours: e5,
new_rates: e6,
fault: e7,
facility_object_status_extension: e8,
supplemental_facility_status: e9,
facility_status_extension: e10,
is_available: e11,
refill_point_status: e12,
energy_infrastructure_station_status_extension: e13,
};
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, "fac:reference", "", " targetClass=\"fac:FacilityObject\"")?; }
None => return Err(w.missing("fac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("fac:openingStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("fac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("fac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "fac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "fac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "fac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("fac:_facilityObjectStatusExtension", v)?; }
for v in &self.supplemental_facility_status { v.write(w, "fac:supplementalFacilityStatus", "", "")?; }
if let Some(v) = &self.facility_status_extension { w.extension("fac:_facilityStatusExtension", v)?; }
if let Some(v) = &self.is_available { w.leaf("egi:isAvailable", v)?; }
for v in &self.refill_point_status { v.write(w, "egi:refillPointStatus")?; }
if let Some(v) = &self.energy_infrastructure_station_status_extension { w.extension("egi:_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, 0x70b9b, 0x70857, 0x707ce, 0x70488];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x7009e);
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); }
0x70b9b => { let v = Some(com::VersionedReference::read(r)?); e5.extend(v); }
0x70857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e6, v.map(Box::new), 2135); }
0x707ce => { let v = Some(EnergyInfrastructureSiteStatus::read(r)?); e7.extend(v); }
0x70488 => { 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, "egi:tableReference", "", " targetClass=\"egi:EnergyInfrastructureTable\"")?; }
if let Some(v) = &self.header_information { v.write(w, "egi:headerInformation", "", "")?; }
for v in &self.energy_infrastructure_site_status { v.write(w, "egi:energyInfrastructureSiteStatus", "", "")?; }
if let Some(v) = &self.energy_infrastructure_status_publication_extension { w.extension("egi:_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] = &[0x70b9a, 0x707cd, 0x70489];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x7009f);
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 {
0x70b9a => { let v = r.string()?; r.set(&mut e0, v, 2970); }
0x707cd => { let v = Some(EnergyInfrastructureSite::read(r)?); e1.extend(v); }
0x70489 => { 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("egi:tableName", v)?; }
w.count("egi:energyInfrastructureSite", self.energy_infrastructure_site.len(), 1, usize::MAX)?;
for v in &self.energy_infrastructure_site { v.write(w, "egi:energyInfrastructureSite", "", "")?; }
if let Some(v) = &self.energy_infrastructure_table_extension { w.extension("egi:_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, 0x70857, 0x707d1, 0x7048a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x700a0);
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); }
0x70857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x707d1 => { let v = Some(EnergyInfrastructureTable::read(r)?); e6.extend(v); }
0x7048a => { 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, "egi:headerInformation", "", "")?; }
w.count("egi:energyInfrastructureTable", self.energy_infrastructure_table.len(), 1, usize::MAX)?;
for v in &self.energy_infrastructure_table { v.write(w, "egi:energyInfrastructureTable", "", "")?; }
if let Some(v) = &self.energy_infrastructure_table_publication_extension { w.extension("egi:_energyInfrastructureTablePublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct EnergyPricingPolicy {
pub pricing_policy: Vec<PricingPolicyEnum>,
pub combination_with_parking_fee: Option<com::Boolean>,
pub discount: Option<com::Percentage>,
pub maximum_delivery_fee: Option<fac::AmountOfMoney>,
pub minimum_delivery_fee: Option<fac::AmountOfMoney>,
pub additional_information: Option<MultilingualString>,
pub energy_pricing_policy_extension: Option<Box<Extension>>,
}
impl EnergyPricingPolicy {
const FIELDS: &'static [u32] = &[0x70a75, 0x70725, 0x70792, 0x70908, 0x70937, 0x70690, 0x7048c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x700a2);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x70a75 => { let v = r.enumeration::<PricingPolicyEnum>()?; e0.extend(v); }
0x70725 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1829); }
0x70792 => { let v = r.value::<f32>()?; r.set(&mut e2, v, 1938); }
0x70908 => { let v = r.value::<Decimal>()?; r.set(&mut e3, v, 2312); }
0x70937 => { let v = r.value::<Decimal>()?; r.set(&mut e4, v, 2359); }
0x70690 => { let v = r.multilingual()?; r.set(&mut e5, v, 1680); }
0x7048c => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1164); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
pricing_policy: e0,
combination_with_parking_fee: e1,
discount: e2,
maximum_delivery_fee: e3,
minimum_delivery_fee: e4,
additional_information: e5,
energy_pricing_policy_extension: e6,
};
r.close();
Ok(v)
}
}
impl EnergyPricingPolicy {
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)?;
for v in &self.pricing_policy { w.enumeration("egi:pricingPolicy", v.literal())?; }
if let Some(v) = &self.combination_with_parking_fee { w.leaf("egi:combinationWithParkingFee", v)?; }
if let Some(v) = &self.discount { w.leaf("egi:discount", v)?; }
if let Some(v) = &self.maximum_delivery_fee { w.digits("maximumDeliveryFee", v, 8, 2)?; w.leaf("egi:maximumDeliveryFee", v)?; }
if let Some(v) = &self.minimum_delivery_fee { w.digits("minimumDeliveryFee", v, 8, 2)?; w.leaf("egi:minimumDeliveryFee", v)?; }
if let Some(v) = &self.additional_information { w.multilingual("egi:additionalInformation", v)?; }
if let Some(v) = &self.energy_pricing_policy_extension { w.extension("egi:_energyPricingPolicyExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct HydrogenRefillPoint {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub external_identifier: Option<String>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<fac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<fac::Image>,
pub operating_hours: Option<fac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<fac::Organisation>,
pub operator: Option<fac::Organisation>,
pub associated_facility: Vec<fac::AnyAssociatedFacility>,
pub rates: Option<fac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<fac::Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<fac::SupplementalFacility>,
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<fac::ReservationTypeEnum>,
pub service_type: Option<Box<ServiceType>>,
pub refill_point_extension: Option<Box<Extension>>,
pub refill_solution: Option<RefillSolutionHydrogenEnum>,
pub process_protocol: Option<HydrogenFuellingProcessProtocolEnum>,
pub renewable_sources_ratio: Option<com::Percentage>,
pub hydrogen_refill_point_extension: Option<Box<Extension>>,
}
impl HydrogenRefillPoint {
const FIELDS: &'static [u32] = &[0x80949, 0x806ad, 0x80805, 0x808ba, 0x80777, 0x8066b, 0x80690, 0x80887, 0x80a2d, 0x80a2c, 0x809c5, 0x808e8, 0x809f8, 0x809d2, 0x806d3, 0x80ab0, 0x806c6, 0x80786, 0x80497, 0x80b90, 0x80496, 0x7076d, 0x70907, 0x70936, 0x70946, 0x70ae4, 0x70b34, 0x70592, 0x70ac6, 0x70a7f, 0x70add, 0x704c2];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x700d8);
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 = None;
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 = Vec::new();
let mut e15 = None;
let mut e16 = Vec::new();
let mut e17 = None;
let mut e18 = None;
let mut e19 = Vec::new();
let mut e20 = None;
let mut e21 = None;
let mut e22 = None;
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 = None;
let mut e30 = None;
let mut e31 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x806ad => { let v = r.multilingual()?; e1.extend(v); }
0x80805 => { let v = r.string()?; r.set(&mut e2, v, 2053); }
0x808ba => { let v = r.date_time()?; r.set(&mut e3, v, 2234); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e4, v, 1911); }
0x8066b => { let v = r.enumeration::<fac::AccessibilityEnum>()?; e5.extend(v); }
0x80690 => { let v = r.multilingual()?; e6.extend(v); }
0x80887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x80a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x80a2c => { let v = Some(fac::Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x808e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x809f8 => { let v = fac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = fac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = fac::AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = fac::Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(fac::Dimension::read(r)?); r.set(&mut e17, v.map(Box::new), 1926); }
0x80497 => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1175); }
0x80b90 => { let v = fac::SupplementalFacility::read(r)?; e19.extend(v); }
0x80496 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1174); }
0x7076d => { let v = r.enumeration::<DeliveryUnitEnum>()?; r.set(&mut e21, v, 1901); }
0x70907 => { let v = r.value::<f32>()?; r.set(&mut e22, v, 2311); }
0x70936 => { let v = r.value::<f32>()?; r.set(&mut e23, v, 2358); }
0x70946 => { let v = r.multilingual()?; r.set(&mut e24, v, 2374); }
0x70ae4 => { let v = r.enumeration::<fac::ReservationTypeEnum>()?; r.set(&mut e25, v, 2788); }
0x70b34 => { let v = Some(ServiceType::read(r)?); r.set(&mut e26, v.map(Box::new), 2868); }
0x70592 => { let v = r.raw()?; r.set(&mut e27, v.map(Box::new), 1426); }
0x70ac6 => { let v = r.enumeration::<RefillSolutionHydrogenEnum>()?; r.set(&mut e28, v, 2758); }
0x70a7f => { let v = r.enumeration::<HydrogenFuellingProcessProtocolEnum>()?; r.set(&mut e29, v, 2687); }
0x70add => { let v = r.value::<f32>()?; r.set(&mut e30, v, 2781); }
0x704c2 => { let v = r.raw()?; r.set(&mut e31, v.map(Box::new), 1218); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e28, 2758);
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
external_identifier: e2,
last_updated: e3,
description: e4,
accessibility: e5,
additional_information: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
associated_facility: e14,
rates: e15,
applicable_for_vehicles: e16,
dimension: e17,
facility_object_extension: e18,
supplemental_facility: e19,
facility_extension: e20,
delivery_unit: e21,
maximum_delivery_amount: e22,
minimum_delivery_amount: e23,
model_type: e24,
reservation: e25,
service_type: e26,
refill_point_extension: e27,
refill_solution: e28,
process_protocol: e29,
renewable_sources_ratio: e30,
hydrogen_refill_point_extension: e31,
};
r.close();
Ok(v)
}
}
impl HydrogenRefillPoint {
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("fac:name", v)?; }
for v in &self.alias { w.multilingual("fac:alias", v)?; }
if let Some(v) = &self.external_identifier { w.max_len("externalIdentifier", v, 1024)?; w.leaf("fac:externalIdentifier", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
for v in &self.accessibility { w.enumeration("fac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("fac:additionalInformation", v)?; }
for v in &self.information_website { v.write(w, "fac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "fac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "fac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "fac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "fac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "fac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "fac:operator")?; }
for v in &self.associated_facility { v.write(w, "fac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "fac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "fac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "fac:dimension", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("fac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "fac:supplementalFacility")?; }
if let Some(v) = &self.facility_extension { w.extension("fac:_facilityExtension", v)?; }
if let Some(v) = &self.delivery_unit { w.enumeration("egi:deliveryUnit", v.literal())?; }
if let Some(v) = &self.maximum_delivery_amount { w.leaf("egi:maximumDeliveryAmount", v)?; }
if let Some(v) = &self.minimum_delivery_amount { w.leaf("egi:minimumDeliveryAmount", v)?; }
if let Some(v) = &self.model_type { w.multilingual("egi:modelType", v)?; }
if let Some(v) = &self.reservation { w.enumeration("egi:reservation", v.literal())?; }
if let Some(v) = &self.service_type { v.write(w, "egi:serviceType", "", "")?; }
if let Some(v) = &self.refill_point_extension { w.extension("egi:_refillPointExtension", v)?; }
match &self.refill_solution {
Some(v) => { w.enumeration("egi:refillSolution", v.literal())?; }
None => return Err(w.missing("egi:refillSolution")),
}
if let Some(v) = &self.process_protocol { w.enumeration("egi:processProtocol", v.literal())?; }
if let Some(v) = &self.renewable_sources_ratio { w.leaf("egi:renewableSourcesRatio", v)?; }
if let Some(v) = &self.hydrogen_refill_point_extension { w.extension("egi:_hydrogenRefillPointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OrganicGasRefillPoint {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub external_identifier: Option<String>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<fac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<fac::Image>,
pub operating_hours: Option<fac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<fac::Organisation>,
pub operator: Option<fac::Organisation>,
pub associated_facility: Vec<fac::AnyAssociatedFacility>,
pub rates: Option<fac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<fac::Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<fac::SupplementalFacility>,
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<fac::ReservationTypeEnum>,
pub service_type: Option<Box<ServiceType>>,
pub refill_point_extension: Option<Box<Extension>>,
pub organic_gas_type: Vec<OrganicGasTypeEnum>,
pub organic_gas_refill_point_extension: Option<Box<Extension>>,
}
impl OrganicGasRefillPoint {
const FIELDS: &'static [u32] = &[0x80949, 0x806ad, 0x80805, 0x808ba, 0x80777, 0x8066b, 0x80690, 0x80887, 0x80a2d, 0x80a2c, 0x809c5, 0x808e8, 0x809f8, 0x809d2, 0x806d3, 0x80ab0, 0x806c6, 0x80786, 0x80497, 0x80b90, 0x80496, 0x7076d, 0x70907, 0x70936, 0x70946, 0x70ae4, 0x70b34, 0x70592, 0x709da, 0x70535];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x70151);
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 = None;
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 = Vec::new();
let mut e15 = None;
let mut e16 = Vec::new();
let mut e17 = None;
let mut e18 = None;
let mut e19 = Vec::new();
let mut e20 = None;
let mut e21 = None;
let mut e22 = None;
let mut e23 = None;
let mut e24 = None;
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = Vec::new();
let mut e29 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x806ad => { let v = r.multilingual()?; e1.extend(v); }
0x80805 => { let v = r.string()?; r.set(&mut e2, v, 2053); }
0x808ba => { let v = r.date_time()?; r.set(&mut e3, v, 2234); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e4, v, 1911); }
0x8066b => { let v = r.enumeration::<fac::AccessibilityEnum>()?; e5.extend(v); }
0x80690 => { let v = r.multilingual()?; e6.extend(v); }
0x80887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x80a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x80a2c => { let v = Some(fac::Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x808e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x809f8 => { let v = fac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = fac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = fac::AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = fac::Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(fac::Dimension::read(r)?); r.set(&mut e17, v.map(Box::new), 1926); }
0x80497 => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1175); }
0x80b90 => { let v = fac::SupplementalFacility::read(r)?; e19.extend(v); }
0x80496 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1174); }
0x7076d => { let v = r.enumeration::<DeliveryUnitEnum>()?; r.set(&mut e21, v, 1901); }
0x70907 => { let v = r.value::<f32>()?; r.set(&mut e22, v, 2311); }
0x70936 => { let v = r.value::<f32>()?; r.set(&mut e23, v, 2358); }
0x70946 => { let v = r.multilingual()?; r.set(&mut e24, v, 2374); }
0x70ae4 => { let v = r.enumeration::<fac::ReservationTypeEnum>()?; r.set(&mut e25, v, 2788); }
0x70b34 => { let v = Some(ServiceType::read(r)?); r.set(&mut e26, v.map(Box::new), 2868); }
0x70592 => { let v = r.raw()?; r.set(&mut e27, v.map(Box::new), 1426); }
0x709da => { let v = r.enumeration::<OrganicGasTypeEnum>()?; e28.extend(v); }
0x70535 => { let v = r.raw()?; r.set(&mut e29, v.map(Box::new), 1333); }
_ => 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,
external_identifier: e2,
last_updated: e3,
description: e4,
accessibility: e5,
additional_information: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
associated_facility: e14,
rates: e15,
applicable_for_vehicles: e16,
dimension: e17,
facility_object_extension: e18,
supplemental_facility: e19,
facility_extension: e20,
delivery_unit: e21,
maximum_delivery_amount: e22,
minimum_delivery_amount: e23,
model_type: e24,
reservation: e25,
service_type: e26,
refill_point_extension: e27,
organic_gas_type: e28,
organic_gas_refill_point_extension: e29,
};
r.close();
Ok(v)
}
}
impl OrganicGasRefillPoint {
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("fac:name", v)?; }
for v in &self.alias { w.multilingual("fac:alias", v)?; }
if let Some(v) = &self.external_identifier { w.max_len("externalIdentifier", v, 1024)?; w.leaf("fac:externalIdentifier", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
for v in &self.accessibility { w.enumeration("fac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("fac:additionalInformation", v)?; }
for v in &self.information_website { v.write(w, "fac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "fac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "fac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "fac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "fac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "fac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "fac:operator")?; }
for v in &self.associated_facility { v.write(w, "fac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "fac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "fac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "fac:dimension", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("fac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "fac:supplementalFacility")?; }
if let Some(v) = &self.facility_extension { w.extension("fac:_facilityExtension", v)?; }
if let Some(v) = &self.delivery_unit { w.enumeration("egi:deliveryUnit", v.literal())?; }
if let Some(v) = &self.maximum_delivery_amount { w.leaf("egi:maximumDeliveryAmount", v)?; }
if let Some(v) = &self.minimum_delivery_amount { w.leaf("egi:minimumDeliveryAmount", v)?; }
if let Some(v) = &self.model_type { w.multilingual("egi:modelType", v)?; }
if let Some(v) = &self.reservation { w.enumeration("egi:reservation", v.literal())?; }
if let Some(v) = &self.service_type { v.write(w, "egi:serviceType", "", "")?; }
if let Some(v) = &self.refill_point_extension { w.extension("egi:_refillPointExtension", v)?; }
for v in &self.organic_gas_type { w.enumeration("egi:organicGasType", v.literal())?; }
if let Some(v) = &self.organic_gas_refill_point_extension { w.extension("egi:_organicGasRefillPointExtension", 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 external_identifier: Option<String>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<fac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<fac::Image>,
pub operating_hours: Option<fac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<fac::Organisation>,
pub operator: Option<fac::Organisation>,
pub associated_facility: Vec<fac::AnyAssociatedFacility>,
pub rates: Option<fac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<fac::Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<fac::SupplementalFacility>,
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<fac::ReservationTypeEnum>,
pub service_type: Option<Box<ServiceType>>,
pub refill_point_extension: Option<Box<Extension>>,
pub petrol_type: Vec<PetrolTypeEnum>,
pub octane: Option<com::NonNegativeInteger>,
pub bioethanol_percentage: Option<com::Percentage>,
pub bioethanol_type: Option<BioethanolTypeEnum>,
pub petrol_refill_point_extension: Option<Box<Extension>>,
}
impl PetrolRefillPoint {
const FIELDS: &'static [u32] = &[0x80949, 0x806ad, 0x80805, 0x808ba, 0x80777, 0x8066b, 0x80690, 0x80887, 0x80a2d, 0x80a2c, 0x809c5, 0x808e8, 0x809f8, 0x809d2, 0x806d3, 0x80ab0, 0x806c6, 0x80786, 0x80497, 0x80b90, 0x80496, 0x7076d, 0x70907, 0x70936, 0x70946, 0x70ae4, 0x70b34, 0x70592, 0x70a2b, 0x709a2, 0x706f7, 0x706f9, 0x70554];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x70171);
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 = None;
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 = Vec::new();
let mut e15 = None;
let mut e16 = Vec::new();
let mut e17 = None;
let mut e18 = None;
let mut e19 = Vec::new();
let mut e20 = None;
let mut e21 = None;
let mut e22 = None;
let mut e23 = None;
let mut e24 = None;
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = Vec::new();
let mut e29 = None;
let mut e30 = None;
let mut e31 = None;
let mut e32 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x806ad => { let v = r.multilingual()?; e1.extend(v); }
0x80805 => { let v = r.string()?; r.set(&mut e2, v, 2053); }
0x808ba => { let v = r.date_time()?; r.set(&mut e3, v, 2234); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e4, v, 1911); }
0x8066b => { let v = r.enumeration::<fac::AccessibilityEnum>()?; e5.extend(v); }
0x80690 => { let v = r.multilingual()?; e6.extend(v); }
0x80887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x80a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x80a2c => { let v = Some(fac::Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x808e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x809f8 => { let v = fac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = fac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = fac::AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = fac::Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(fac::Dimension::read(r)?); r.set(&mut e17, v.map(Box::new), 1926); }
0x80497 => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1175); }
0x80b90 => { let v = fac::SupplementalFacility::read(r)?; e19.extend(v); }
0x80496 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1174); }
0x7076d => { let v = r.enumeration::<DeliveryUnitEnum>()?; r.set(&mut e21, v, 1901); }
0x70907 => { let v = r.value::<f32>()?; r.set(&mut e22, v, 2311); }
0x70936 => { let v = r.value::<f32>()?; r.set(&mut e23, v, 2358); }
0x70946 => { let v = r.multilingual()?; r.set(&mut e24, v, 2374); }
0x70ae4 => { let v = r.enumeration::<fac::ReservationTypeEnum>()?; r.set(&mut e25, v, 2788); }
0x70b34 => { let v = Some(ServiceType::read(r)?); r.set(&mut e26, v.map(Box::new), 2868); }
0x70592 => { let v = r.raw()?; r.set(&mut e27, v.map(Box::new), 1426); }
0x70a2b => { let v = r.enumeration::<PetrolTypeEnum>()?; e28.extend(v); }
0x709a2 => { let v = r.value::<u64>()?; r.set(&mut e29, v, 2466); }
0x706f7 => { let v = r.value::<f32>()?; r.set(&mut e30, v, 1783); }
0x706f9 => { let v = r.enumeration::<BioethanolTypeEnum>()?; r.set(&mut e31, v, 1785); }
0x70554 => { let v = r.raw()?; r.set(&mut e32, v.map(Box::new), 1364); }
_ => 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,
external_identifier: e2,
last_updated: e3,
description: e4,
accessibility: e5,
additional_information: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
associated_facility: e14,
rates: e15,
applicable_for_vehicles: e16,
dimension: e17,
facility_object_extension: e18,
supplemental_facility: e19,
facility_extension: e20,
delivery_unit: e21,
maximum_delivery_amount: e22,
minimum_delivery_amount: e23,
model_type: e24,
reservation: e25,
service_type: e26,
refill_point_extension: e27,
petrol_type: e28,
octane: e29,
bioethanol_percentage: e30,
bioethanol_type: e31,
petrol_refill_point_extension: e32,
};
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("fac:name", v)?; }
for v in &self.alias { w.multilingual("fac:alias", v)?; }
if let Some(v) = &self.external_identifier { w.max_len("externalIdentifier", v, 1024)?; w.leaf("fac:externalIdentifier", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
for v in &self.accessibility { w.enumeration("fac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("fac:additionalInformation", v)?; }
for v in &self.information_website { v.write(w, "fac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "fac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "fac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "fac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "fac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "fac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "fac:operator")?; }
for v in &self.associated_facility { v.write(w, "fac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "fac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "fac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "fac:dimension", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("fac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "fac:supplementalFacility")?; }
if let Some(v) = &self.facility_extension { w.extension("fac:_facilityExtension", v)?; }
if let Some(v) = &self.delivery_unit { w.enumeration("egi:deliveryUnit", v.literal())?; }
if let Some(v) = &self.maximum_delivery_amount { w.leaf("egi:maximumDeliveryAmount", v)?; }
if let Some(v) = &self.minimum_delivery_amount { w.leaf("egi:minimumDeliveryAmount", v)?; }
if let Some(v) = &self.model_type { w.multilingual("egi:modelType", v)?; }
if let Some(v) = &self.reservation { w.enumeration("egi:reservation", v.literal())?; }
if let Some(v) = &self.service_type { v.write(w, "egi:serviceType", "", "")?; }
if let Some(v) = &self.refill_point_extension { w.extension("egi:_refillPointExtension", v)?; }
for v in &self.petrol_type { w.enumeration("egi:petrolType", v.literal())?; }
if let Some(v) = &self.octane { w.leaf("egi:octane", v)?; }
if let Some(v) = &self.bioethanol_percentage { w.leaf("egi:bioethanolPercentage", v)?; }
if let Some(v) = &self.bioethanol_type { w.enumeration("egi:bioethanolType", v.literal())?; }
if let Some(v) = &self.petrol_refill_point_extension { w.extension("egi:_petrolRefillPointExtension", 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<fac::OpeningStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<fac::OperatingHours>,
pub new_rates: Option<fac::Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
pub supplemental_facility_status: Vec<fac::SupplementalFacilityStatus>,
pub facility_status_extension: Option<Box<Extension>>,
pub status: Option<RefillPointStatusEnum>,
pub units_in_stock: Option<Units>,
pub waiting_time: Option<Box<fac::DurationValue>>,
pub refill_point_status_extension: Option<Box<Extension>>,
}
impl RefillPointStatus {
const FIELDS: &'static [u32] = &[0x80aba, 0x808ba, 0x809a8, 0x80aca, 0x80b77, 0x80958, 0x80959, 0x8080d, 0x80498, 0x80b91, 0x80499, 0x70b73, 0x70c0a, 0x70c6b, 0x70593];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x701b1);
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 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x808ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x809a8 => { let v = r.enumeration::<fac::OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x80aca => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2762); }
0x80b77 => { let v = r.multilingual()?; r.set(&mut e4, v, 2935); }
0x80958 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e5, v, 2392); }
0x80959 => { let v = fac::Rates::read(r)?; r.set(&mut e6, v, 2393); }
0x8080d => { let v = com::AnyFault::read(r)?; r.set(&mut e7, v, 2061); }
0x80498 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1176); }
0x80b91 => { let v = Some(fac::SupplementalFacilityStatus::read(r)?); e9.extend(v); }
0x80499 => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1177); }
0x70b73 => { let v = r.enumeration::<RefillPointStatusEnum>()?; r.set(&mut e11, v, 2931); }
0x70c0a => { let v = r.value::<f32>()?; r.set(&mut e12, v, 3082); }
0x70c6b => { let v = Some(fac::DurationValue::read(r)?); r.set(&mut e13, v.map(Box::new), 3179); }
0x70593 => { let v = r.raw()?; r.set(&mut e14, 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(&e11, 2931);
let v = Self {
reference: e0,
last_updated: e1,
opening_status: e2,
regular_operating_hours_in_force: e3,
status_description: e4,
new_operating_hours: e5,
new_rates: e6,
fault: e7,
facility_object_status_extension: e8,
supplemental_facility_status: e9,
facility_status_extension: e10,
status: e11,
units_in_stock: e12,
waiting_time: e13,
refill_point_status_extension: e14,
};
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, "fac:reference", "", " targetClass=\"fac:FacilityObject\"")?; }
None => return Err(w.missing("fac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("fac:openingStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("fac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("fac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "fac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "fac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "fac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("fac:_facilityObjectStatusExtension", v)?; }
for v in &self.supplemental_facility_status { v.write(w, "fac:supplementalFacilityStatus", "", "")?; }
if let Some(v) = &self.facility_status_extension { w.extension("fac:_facilityStatusExtension", v)?; }
match &self.status {
Some(v) => { w.enumeration("egi:status", v.literal())?; }
None => return Err(w.missing("egi:status")),
}
if let Some(v) = &self.units_in_stock { w.leaf("egi:unitsInStock", v)?; }
if let Some(v) = &self.waiting_time { v.write(w, "egi:waitingTime", "", "")?; }
if let Some(v) = &self.refill_point_status_extension { w.extension("egi:_refillPointStatusExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ServiceType {
pub service_type: Vec<ServiceTypeEnum>,
pub service_type_extension: Option<Box<Extension>>,
}
impl ServiceType {
const FIELDS: &'static [u32] = &[0x70b34, 0x705b7];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x701d6);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x70b34 => { let v = r.enumeration::<ServiceTypeEnum>()?; e0.extend(v); }
0x705b7 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1463); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
service_type: e0,
service_type_extension: e1,
};
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)?;
for v in &self.service_type { w.enumeration("egi:serviceType", v.literal())?; }
if let Some(v) = &self.service_type_extension { w.extension("egi:_serviceTypeExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct VehicleSpace {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub alias: Vec<MultilingualString>,
pub external_identifier: Option<String>,
pub last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<fac::AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<fac::Image>,
pub operating_hours: Option<fac::OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<fac::Organisation>,
pub operator: Option<fac::Organisation>,
pub associated_facility: Vec<fac::AnyAssociatedFacility>,
pub rates: Option<fac::Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<fac::Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub supplemental_facility: Vec<fac::SupplementalFacility>,
pub facility_extension: Option<Box<Extension>>,
pub parking_allowed_after_charging: Option<com::Boolean>,
pub vehicle_space_extension: Option<Box<Extension>>,
}
impl VehicleSpace {
const FIELDS: &'static [u32] = &[0x80949, 0x806ad, 0x80805, 0x808ba, 0x80777, 0x8066b, 0x80690, 0x80887, 0x80a2d, 0x80a2c, 0x809c5, 0x808e8, 0x809f8, 0x809d2, 0x806d3, 0x80ab0, 0x806c6, 0x80786, 0x80497, 0x80b90, 0x80496, 0x709ff, 0x70643];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x70266);
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 = None;
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 = Vec::new();
let mut e15 = None;
let mut e16 = Vec::new();
let mut e17 = None;
let mut e18 = None;
let mut e19 = Vec::new();
let mut e20 = None;
let mut e21 = None;
let mut e22 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x806ad => { let v = r.multilingual()?; e1.extend(v); }
0x80805 => { let v = r.string()?; r.set(&mut e2, v, 2053); }
0x808ba => { let v = r.date_time()?; r.set(&mut e3, v, 2234); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e4, v, 1911); }
0x8066b => { let v = r.enumeration::<fac::AccessibilityEnum>()?; e5.extend(v); }
0x80690 => { let v = r.multilingual()?; e6.extend(v); }
0x80887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x80a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x80a2c => { let v = Some(fac::Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = fac::OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x808e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x809f8 => { let v = fac::Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = fac::Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = fac::AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = fac::Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(fac::Dimension::read(r)?); r.set(&mut e17, v.map(Box::new), 1926); }
0x80497 => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1175); }
0x80b90 => { let v = fac::SupplementalFacility::read(r)?; e19.extend(v); }
0x80496 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1174); }
0x709ff => { let v = r.value::<bool>()?; r.set(&mut e21, v, 2559); }
0x70643 => { let v = r.raw()?; r.set(&mut e22, v.map(Box::new), 1603); }
_ => 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,
external_identifier: e2,
last_updated: e3,
description: e4,
accessibility: e5,
additional_information: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
associated_facility: e14,
rates: e15,
applicable_for_vehicles: e16,
dimension: e17,
facility_object_extension: e18,
supplemental_facility: e19,
facility_extension: e20,
parking_allowed_after_charging: e21,
vehicle_space_extension: e22,
};
r.close();
Ok(v)
}
}
impl VehicleSpace {
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("fac:name", v)?; }
for v in &self.alias { w.multilingual("fac:alias", v)?; }
if let Some(v) = &self.external_identifier { w.max_len("externalIdentifier", v, 1024)?; w.leaf("fac:externalIdentifier", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
for v in &self.accessibility { w.enumeration("fac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("fac:additionalInformation", v)?; }
for v in &self.information_website { v.write(w, "fac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "fac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "fac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "fac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "fac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "fac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "fac:operator")?; }
for v in &self.associated_facility { v.write(w, "fac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "fac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "fac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "fac:dimension", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("fac:_facilityObjectExtension", v)?; }
for v in &self.supplemental_facility { v.write(w, "fac:supplementalFacility")?; }
if let Some(v) = &self.facility_extension { w.extension("fac:_facilityExtension", v)?; }
if let Some(v) = &self.parking_allowed_after_charging { w.leaf("egi:parkingAllowedAfterCharging", v)?; }
if let Some(v) = &self.vehicle_space_extension { w.extension("egi:_vehicleSpaceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum RefillPoint {
DieselRefillPoint(Box<DieselRefillPoint>),
ElectricChargingPoint(Box<ElectricChargingPoint>),
HydrogenRefillPoint(Box<HydrogenRefillPoint>),
OrganicGasRefillPoint(Box<OrganicGasRefillPoint>),
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(0x7007c) => Self::DieselRefillPoint(Box::new(DieselRefillPoint::read(r)?)),
Some(0x70091) => Self::ElectricChargingPoint(Box::new(ElectricChargingPoint::read(r)?)),
Some(0x700d8) => Self::HydrogenRefillPoint(Box::new(HydrogenRefillPoint::read(r)?)),
Some(0x70151) => Self::OrganicGasRefillPoint(Box::new(OrganicGasRefillPoint::read(r)?)),
Some(0x70171) => Self::PetrolRefillPoint(Box::new(PetrolRefillPoint::read(r)?)),
_ => {
r.unknown_type("RefillPoint")?;
return Ok(None);
}
}))
}
pub fn id(&self) -> Option<&str> {
match self {
Self::DieselRefillPoint(v) => v.id.as_deref(),
Self::ElectricChargingPoint(v) => v.id.as_deref(),
Self::HydrogenRefillPoint(v) => v.id.as_deref(),
Self::OrganicGasRefillPoint(v) => v.id.as_deref(),
Self::PetrolRefillPoint(v) => v.id.as_deref(),
}
}
pub fn version(&self) -> Option<&str> {
match self {
Self::DieselRefillPoint(v) => v.version.as_deref(),
Self::ElectricChargingPoint(v) => v.version.as_deref(),
Self::HydrogenRefillPoint(v) => v.version.as_deref(),
Self::OrganicGasRefillPoint(v) => v.version.as_deref(),
Self::PetrolRefillPoint(v) => v.version.as_deref(),
}
}
pub fn name(&self) -> Option<&MultilingualString> {
match self {
Self::DieselRefillPoint(v) => v.name.as_ref(),
Self::ElectricChargingPoint(v) => v.name.as_ref(),
Self::HydrogenRefillPoint(v) => v.name.as_ref(),
Self::OrganicGasRefillPoint(v) => v.name.as_ref(),
Self::PetrolRefillPoint(v) => v.name.as_ref(),
}
}
pub fn alias(&self) -> &[MultilingualString] {
match self {
Self::DieselRefillPoint(v) => &v.alias,
Self::ElectricChargingPoint(v) => &v.alias,
Self::HydrogenRefillPoint(v) => &v.alias,
Self::OrganicGasRefillPoint(v) => &v.alias,
Self::PetrolRefillPoint(v) => &v.alias,
}
}
pub fn external_identifier(&self) -> Option<&str> {
match self {
Self::DieselRefillPoint(v) => v.external_identifier.as_deref(),
Self::ElectricChargingPoint(v) => v.external_identifier.as_deref(),
Self::HydrogenRefillPoint(v) => v.external_identifier.as_deref(),
Self::OrganicGasRefillPoint(v) => v.external_identifier.as_deref(),
Self::PetrolRefillPoint(v) => v.external_identifier.as_deref(),
}
}
pub fn last_updated(&self) -> Option<&DateTime> {
match self {
Self::DieselRefillPoint(v) => v.last_updated.as_ref(),
Self::ElectricChargingPoint(v) => v.last_updated.as_ref(),
Self::HydrogenRefillPoint(v) => v.last_updated.as_ref(),
Self::OrganicGasRefillPoint(v) => v.last_updated.as_ref(),
Self::PetrolRefillPoint(v) => v.last_updated.as_ref(),
}
}
pub fn description(&self) -> Option<&MultilingualString> {
match self {
Self::DieselRefillPoint(v) => v.description.as_ref(),
Self::ElectricChargingPoint(v) => v.description.as_ref(),
Self::HydrogenRefillPoint(v) => v.description.as_ref(),
Self::OrganicGasRefillPoint(v) => v.description.as_ref(),
Self::PetrolRefillPoint(v) => v.description.as_ref(),
}
}
pub fn accessibility(&self) -> &[fac::AccessibilityEnum] {
match self {
Self::DieselRefillPoint(v) => &v.accessibility,
Self::ElectricChargingPoint(v) => &v.accessibility,
Self::HydrogenRefillPoint(v) => &v.accessibility,
Self::OrganicGasRefillPoint(v) => &v.accessibility,
Self::PetrolRefillPoint(v) => &v.accessibility,
}
}
pub fn additional_information(&self) -> &[MultilingualString] {
match self {
Self::DieselRefillPoint(v) => &v.additional_information,
Self::ElectricChargingPoint(v) => &v.additional_information,
Self::HydrogenRefillPoint(v) => &v.additional_information,
Self::OrganicGasRefillPoint(v) => &v.additional_information,
Self::PetrolRefillPoint(v) => &v.additional_information,
}
}
pub fn information_website(&self) -> &[com::UrlLink] {
match self {
Self::DieselRefillPoint(v) => &v.information_website,
Self::ElectricChargingPoint(v) => &v.information_website,
Self::HydrogenRefillPoint(v) => &v.information_website,
Self::OrganicGasRefillPoint(v) => &v.information_website,
Self::PetrolRefillPoint(v) => &v.information_website,
}
}
pub fn photo_url(&self) -> &[com::UrlLink] {
match self {
Self::DieselRefillPoint(v) => &v.photo_url,
Self::ElectricChargingPoint(v) => &v.photo_url,
Self::HydrogenRefillPoint(v) => &v.photo_url,
Self::OrganicGasRefillPoint(v) => &v.photo_url,
Self::PetrolRefillPoint(v) => &v.photo_url,
}
}
pub fn photo(&self) -> &[fac::Image] {
match self {
Self::DieselRefillPoint(v) => &v.photo,
Self::ElectricChargingPoint(v) => &v.photo,
Self::HydrogenRefillPoint(v) => &v.photo,
Self::OrganicGasRefillPoint(v) => &v.photo,
Self::PetrolRefillPoint(v) => &v.photo,
}
}
pub fn operating_hours(&self) -> Option<&fac::OperatingHours> {
match self {
Self::DieselRefillPoint(v) => v.operating_hours.as_ref(),
Self::ElectricChargingPoint(v) => v.operating_hours.as_ref(),
Self::HydrogenRefillPoint(v) => v.operating_hours.as_ref(),
Self::OrganicGasRefillPoint(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::DieselRefillPoint(v) => v.location_reference.as_ref(),
Self::ElectricChargingPoint(v) => v.location_reference.as_ref(),
Self::HydrogenRefillPoint(v) => v.location_reference.as_ref(),
Self::OrganicGasRefillPoint(v) => v.location_reference.as_ref(),
Self::PetrolRefillPoint(v) => v.location_reference.as_ref(),
}
}
pub fn owner(&self) -> Option<&fac::Organisation> {
match self {
Self::DieselRefillPoint(v) => v.owner.as_ref(),
Self::ElectricChargingPoint(v) => v.owner.as_ref(),
Self::HydrogenRefillPoint(v) => v.owner.as_ref(),
Self::OrganicGasRefillPoint(v) => v.owner.as_ref(),
Self::PetrolRefillPoint(v) => v.owner.as_ref(),
}
}
pub fn operator(&self) -> Option<&fac::Organisation> {
match self {
Self::DieselRefillPoint(v) => v.operator.as_ref(),
Self::ElectricChargingPoint(v) => v.operator.as_ref(),
Self::HydrogenRefillPoint(v) => v.operator.as_ref(),
Self::OrganicGasRefillPoint(v) => v.operator.as_ref(),
Self::PetrolRefillPoint(v) => v.operator.as_ref(),
}
}
pub fn associated_facility(&self) -> &[fac::AnyAssociatedFacility] {
match self {
Self::DieselRefillPoint(v) => &v.associated_facility,
Self::ElectricChargingPoint(v) => &v.associated_facility,
Self::HydrogenRefillPoint(v) => &v.associated_facility,
Self::OrganicGasRefillPoint(v) => &v.associated_facility,
Self::PetrolRefillPoint(v) => &v.associated_facility,
}
}
pub fn rates(&self) -> Option<&fac::Rates> {
match self {
Self::DieselRefillPoint(v) => v.rates.as_ref(),
Self::ElectricChargingPoint(v) => v.rates.as_ref(),
Self::HydrogenRefillPoint(v) => v.rates.as_ref(),
Self::OrganicGasRefillPoint(v) => v.rates.as_ref(),
Self::PetrolRefillPoint(v) => v.rates.as_ref(),
}
}
pub fn applicable_for_vehicles(&self) -> &[com::VehicleCharacteristics] {
match self {
Self::DieselRefillPoint(v) => &v.applicable_for_vehicles,
Self::ElectricChargingPoint(v) => &v.applicable_for_vehicles,
Self::HydrogenRefillPoint(v) => &v.applicable_for_vehicles,
Self::OrganicGasRefillPoint(v) => &v.applicable_for_vehicles,
Self::PetrolRefillPoint(v) => &v.applicable_for_vehicles,
}
}
pub fn dimension(&self) -> Option<&fac::Dimension> {
match self {
Self::DieselRefillPoint(v) => v.dimension.as_deref(),
Self::ElectricChargingPoint(v) => v.dimension.as_deref(),
Self::HydrogenRefillPoint(v) => v.dimension.as_deref(),
Self::OrganicGasRefillPoint(v) => v.dimension.as_deref(),
Self::PetrolRefillPoint(v) => v.dimension.as_deref(),
}
}
pub fn facility_object_extension(&self) -> Option<&Extension> {
match self {
Self::DieselRefillPoint(v) => v.facility_object_extension.as_deref(),
Self::ElectricChargingPoint(v) => v.facility_object_extension.as_deref(),
Self::HydrogenRefillPoint(v) => v.facility_object_extension.as_deref(),
Self::OrganicGasRefillPoint(v) => v.facility_object_extension.as_deref(),
Self::PetrolRefillPoint(v) => v.facility_object_extension.as_deref(),
}
}
pub fn supplemental_facility(&self) -> &[fac::SupplementalFacility] {
match self {
Self::DieselRefillPoint(v) => &v.supplemental_facility,
Self::ElectricChargingPoint(v) => &v.supplemental_facility,
Self::HydrogenRefillPoint(v) => &v.supplemental_facility,
Self::OrganicGasRefillPoint(v) => &v.supplemental_facility,
Self::PetrolRefillPoint(v) => &v.supplemental_facility,
}
}
pub fn facility_extension(&self) -> Option<&Extension> {
match self {
Self::DieselRefillPoint(v) => v.facility_extension.as_deref(),
Self::ElectricChargingPoint(v) => v.facility_extension.as_deref(),
Self::HydrogenRefillPoint(v) => v.facility_extension.as_deref(),
Self::OrganicGasRefillPoint(v) => v.facility_extension.as_deref(),
Self::PetrolRefillPoint(v) => v.facility_extension.as_deref(),
}
}
pub fn delivery_unit(&self) -> Option<&DeliveryUnitEnum> {
match self {
Self::DieselRefillPoint(v) => v.delivery_unit.as_ref(),
Self::ElectricChargingPoint(v) => v.delivery_unit.as_ref(),
Self::HydrogenRefillPoint(v) => v.delivery_unit.as_ref(),
Self::OrganicGasRefillPoint(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::DieselRefillPoint(v) => v.maximum_delivery_amount.as_ref(),
Self::ElectricChargingPoint(v) => v.maximum_delivery_amount.as_ref(),
Self::HydrogenRefillPoint(v) => v.maximum_delivery_amount.as_ref(),
Self::OrganicGasRefillPoint(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::DieselRefillPoint(v) => v.minimum_delivery_amount.as_ref(),
Self::ElectricChargingPoint(v) => v.minimum_delivery_amount.as_ref(),
Self::HydrogenRefillPoint(v) => v.minimum_delivery_amount.as_ref(),
Self::OrganicGasRefillPoint(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::DieselRefillPoint(v) => v.model_type.as_ref(),
Self::ElectricChargingPoint(v) => v.model_type.as_ref(),
Self::HydrogenRefillPoint(v) => v.model_type.as_ref(),
Self::OrganicGasRefillPoint(v) => v.model_type.as_ref(),
Self::PetrolRefillPoint(v) => v.model_type.as_ref(),
}
}
pub fn reservation(&self) -> Option<&fac::ReservationTypeEnum> {
match self {
Self::DieselRefillPoint(v) => v.reservation.as_ref(),
Self::ElectricChargingPoint(v) => v.reservation.as_ref(),
Self::HydrogenRefillPoint(v) => v.reservation.as_ref(),
Self::OrganicGasRefillPoint(v) => v.reservation.as_ref(),
Self::PetrolRefillPoint(v) => v.reservation.as_ref(),
}
}
pub fn service_type(&self) -> Option<&ServiceType> {
match self {
Self::DieselRefillPoint(v) => v.service_type.as_deref(),
Self::ElectricChargingPoint(v) => v.service_type.as_deref(),
Self::HydrogenRefillPoint(v) => v.service_type.as_deref(),
Self::OrganicGasRefillPoint(v) => v.service_type.as_deref(),
Self::PetrolRefillPoint(v) => v.service_type.as_deref(),
}
}
pub fn refill_point_extension(&self) -> Option<&Extension> {
match self {
Self::DieselRefillPoint(v) => v.refill_point_extension.as_deref(),
Self::ElectricChargingPoint(v) => v.refill_point_extension.as_deref(),
Self::HydrogenRefillPoint(v) => v.refill_point_extension.as_deref(),
Self::OrganicGasRefillPoint(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::DieselRefillPoint(v) => v.write(w, tag, " xsi:type=\"egi:DieselRefillPoint\"", ""),
Self::ElectricChargingPoint(v) => v.write(w, tag, " xsi:type=\"egi:ElectricChargingPoint\"", ""),
Self::HydrogenRefillPoint(v) => v.write(w, tag, " xsi:type=\"egi:HydrogenRefillPoint\"", ""),
Self::OrganicGasRefillPoint(v) => v.write(w, tag, " xsi:type=\"egi:OrganicGasRefillPoint\"", ""),
Self::PetrolRefillPoint(v) => v.write(w, tag, " xsi:type=\"egi: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(0x701b1) => Self::RefillPointStatus(Box::new(RefillPointStatus::read(r)?)),
Some(0x70092) => 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<&fac::OpeningStatusEnum> {
match self {
Self::RefillPointStatus(v) => v.opening_status.as_ref(),
Self::ElectricChargingPointStatus(v) => v.opening_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<&fac::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<&fac::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) -> &[fac::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 waiting_time(&self) -> Option<&fac::DurationValue> {
match self {
Self::RefillPointStatus(v) => v.waiting_time.as_deref(),
Self::ElectricChargingPointStatus(v) => v.waiting_time.as_deref(),
}
}
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=\"egi:ElectricChargingPointStatus\"", ""),
}
}
}