#[allow(unused_imports)]
use super::{common as com, common_extension as comx, location_referencing as loc, location_extension as locx, situation as sit, road_traffic_data as roa, vms, parking as prk, energy_infrastructure as egi, afir_energy_infrastructure as aegi, 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};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AccessibilityEnum {
BarrierFreeAccessible,
DisabilityAccessible,
WheelChairAccessible,
DisabilityFacilities,
OrientationSystemForBlindPeople,
Marking,
None,
Unknown,
Other,
Extended(String),
}
impl AccessibilityEnum {
pub fn as_str(&self) -> &str {
match self {
Self::BarrierFreeAccessible => "barrierFreeAccessible",
Self::DisabilityAccessible => "disabilityAccessible",
Self::WheelChairAccessible => "wheelChairAccessible",
Self::DisabilityFacilities => "disabilityFacilities",
Self::OrientationSystemForBlindPeople => "orientationSystemForBlindPeople",
Self::Marking => "marking",
Self::None => "none",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for AccessibilityEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"barrierFreeAccessible" => Some(Self::BarrierFreeAccessible),
"disabilityAccessible" => Some(Self::DisabilityAccessible),
"wheelChairAccessible" => Some(Self::WheelChairAccessible),
"disabilityFacilities" => Some(Self::DisabilityFacilities),
"orientationSystemForBlindPeople" => Some(Self::OrientationSystemForBlindPeople),
"marking" => Some(Self::Marking),
"none" => Some(Self::None),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl AccessibilityEnum {
#[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 AmountOfMoney = Decimal;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AvailabilityEnum {
Available,
NotAvailable,
Unknown,
Extended(String),
}
impl AvailabilityEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Available => "available",
Self::NotAvailable => "notAvailable",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for AvailabilityEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"available" => Some(Self::Available),
"notAvailable" => Some(Self::NotAvailable),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl AvailabilityEnum {
#[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 CredentialTypeEnum {
Hangtag,
Permit,
LicensePlate,
Ticket,
Eticket,
Barcode,
Bluetooth,
Rfid,
QrCode,
Other,
Extended(String),
}
impl CredentialTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Hangtag => "hangtag",
Self::Permit => "permit",
Self::LicensePlate => "licensePlate",
Self::Ticket => "ticket",
Self::Eticket => "eticket",
Self::Barcode => "barcode",
Self::Bluetooth => "bluetooth",
Self::Rfid => "rfid",
Self::QrCode => "qrCode",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for CredentialTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"hangtag" => Some(Self::Hangtag),
"permit" => Some(Self::Permit),
"licensePlate" => Some(Self::LicensePlate),
"ticket" => Some(Self::Ticket),
"eticket" => Some(Self::Eticket),
"barcode" => Some(Self::Barcode),
"bluetooth" => Some(Self::Bluetooth),
"rfid" => Some(Self::Rfid),
"qrCode" => Some(Self::QrCode),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl CredentialTypeEnum {
#[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 CurrencyCode = String;
pub type Duration = String;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EnergySourceEnum {
All,
Battery,
Biodiesel,
Diesel,
DieselBatteryHybrid,
Ethanol,
Hydrogen,
LiquidGas,
Lpg,
Methane,
Petrol,
Petrol95Octane,
Petrol98Octane,
PetrolBatteryHybrid,
PetrolLeaded,
PetrolUnleaded,
Unknown,
Other,
Extended(String),
}
impl EnergySourceEnum {
pub fn as_str(&self) -> &str {
match self {
Self::All => "all",
Self::Battery => "battery",
Self::Biodiesel => "biodiesel",
Self::Diesel => "diesel",
Self::DieselBatteryHybrid => "dieselBatteryHybrid",
Self::Ethanol => "ethanol",
Self::Hydrogen => "hydrogen",
Self::LiquidGas => "liquidGas",
Self::Lpg => "lpg",
Self::Methane => "methane",
Self::Petrol => "petrol",
Self::Petrol95Octane => "petrol95Octane",
Self::Petrol98Octane => "petrol98Octane",
Self::PetrolBatteryHybrid => "petrolBatteryHybrid",
Self::PetrolLeaded => "petrolLeaded",
Self::PetrolUnleaded => "petrolUnleaded",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for EnergySourceEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"all" => Some(Self::All),
"battery" => Some(Self::Battery),
"biodiesel" => Some(Self::Biodiesel),
"diesel" => Some(Self::Diesel),
"dieselBatteryHybrid" => Some(Self::DieselBatteryHybrid),
"ethanol" => Some(Self::Ethanol),
"hydrogen" => Some(Self::Hydrogen),
"liquidGas" => Some(Self::LiquidGas),
"lpg" => Some(Self::Lpg),
"methane" => Some(Self::Methane),
"petrol" => Some(Self::Petrol),
"petrol95Octane" => Some(Self::Petrol95Octane),
"petrol98Octane" => Some(Self::Petrol98Octane),
"petrolBatteryHybrid" => Some(Self::PetrolBatteryHybrid),
"petrolLeaded" => Some(Self::PetrolLeaded),
"petrolUnleaded" => Some(Self::PetrolUnleaded),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl EnergySourceEnum {
#[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 EquipmentTypeEnum {
BikeParking,
CashMachine,
CopyMachineOrService,
Defibrillator,
DsrcReceiver,
DumpingStation,
ElectricChargingStation,
Elevator,
FaxMachineOrService,
FireExtinguisher,
FireHose,
FireHydrant,
FirstAidEquipment,
IceFreeScaffold,
InformationPoint,
InformationStele,
InternetTerminal,
InternetWireless,
LuggageLocker,
PaymentMachine,
PicnicFacilities,
Playground,
PublicCardPhone,
PublicCoinPhone,
PublicPhone,
RefuseBin,
SafeDeposit,
Shelter,
Shower,
SnowAndIceRemovalEquipment,
Toilet,
TollTerminal,
TyreAirPressureEquipment,
WaterBasin,
VendingMachine,
WaterSupply,
WasteDisposal,
WaterTap,
None,
Unknown,
Other,
Extended(String),
}
impl EquipmentTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::BikeParking => "bikeParking",
Self::CashMachine => "cashMachine",
Self::CopyMachineOrService => "copyMachineOrService",
Self::Defibrillator => "defibrillator",
Self::DsrcReceiver => "dsrcReceiver",
Self::DumpingStation => "dumpingStation",
Self::ElectricChargingStation => "electricChargingStation",
Self::Elevator => "elevator",
Self::FaxMachineOrService => "faxMachineOrService",
Self::FireExtinguisher => "fireExtinguisher",
Self::FireHose => "fireHose",
Self::FireHydrant => "fireHydrant",
Self::FirstAidEquipment => "firstAidEquipment",
Self::IceFreeScaffold => "iceFreeScaffold",
Self::InformationPoint => "informationPoint",
Self::InformationStele => "informationStele",
Self::InternetTerminal => "internetTerminal",
Self::InternetWireless => "internetWireless",
Self::LuggageLocker => "luggageLocker",
Self::PaymentMachine => "paymentMachine",
Self::PicnicFacilities => "picnicFacilities",
Self::Playground => "playground",
Self::PublicCardPhone => "publicCardPhone",
Self::PublicCoinPhone => "publicCoinPhone",
Self::PublicPhone => "publicPhone",
Self::RefuseBin => "refuseBin",
Self::SafeDeposit => "safeDeposit",
Self::Shelter => "shelter",
Self::Shower => "shower",
Self::SnowAndIceRemovalEquipment => "snowAndIceRemovalEquipment",
Self::Toilet => "toilet",
Self::TollTerminal => "tollTerminal",
Self::TyreAirPressureEquipment => "tyreAirPressureEquipment",
Self::WaterBasin => "waterBasin",
Self::VendingMachine => "vendingMachine",
Self::WaterSupply => "waterSupply",
Self::WasteDisposal => "wasteDisposal",
Self::WaterTap => "waterTap",
Self::None => "none",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for EquipmentTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"bikeParking" => Some(Self::BikeParking),
"cashMachine" => Some(Self::CashMachine),
"copyMachineOrService" => Some(Self::CopyMachineOrService),
"defibrillator" => Some(Self::Defibrillator),
"dsrcReceiver" => Some(Self::DsrcReceiver),
"dumpingStation" => Some(Self::DumpingStation),
"electricChargingStation" => Some(Self::ElectricChargingStation),
"elevator" => Some(Self::Elevator),
"faxMachineOrService" => Some(Self::FaxMachineOrService),
"fireExtinguisher" => Some(Self::FireExtinguisher),
"fireHose" => Some(Self::FireHose),
"fireHydrant" => Some(Self::FireHydrant),
"firstAidEquipment" => Some(Self::FirstAidEquipment),
"iceFreeScaffold" => Some(Self::IceFreeScaffold),
"informationPoint" => Some(Self::InformationPoint),
"informationStele" => Some(Self::InformationStele),
"internetTerminal" => Some(Self::InternetTerminal),
"internetWireless" => Some(Self::InternetWireless),
"luggageLocker" => Some(Self::LuggageLocker),
"paymentMachine" => Some(Self::PaymentMachine),
"picnicFacilities" => Some(Self::PicnicFacilities),
"playground" => Some(Self::Playground),
"publicCardPhone" => Some(Self::PublicCardPhone),
"publicCoinPhone" => Some(Self::PublicCoinPhone),
"publicPhone" => Some(Self::PublicPhone),
"refuseBin" => Some(Self::RefuseBin),
"safeDeposit" => Some(Self::SafeDeposit),
"shelter" => Some(Self::Shelter),
"shower" => Some(Self::Shower),
"snowAndIceRemovalEquipment" => Some(Self::SnowAndIceRemovalEquipment),
"toilet" => Some(Self::Toilet),
"tollTerminal" => Some(Self::TollTerminal),
"tyreAirPressureEquipment" => Some(Self::TyreAirPressureEquipment),
"waterBasin" => Some(Self::WaterBasin),
"vendingMachine" => Some(Self::VendingMachine),
"waterSupply" => Some(Self::WaterSupply),
"wasteDisposal" => Some(Self::WasteDisposal),
"waterTap" => Some(Self::WaterTap),
"none" => Some(Self::None),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl EquipmentTypeEnum {
#[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 FacilityTypeEnum {
Airport,
CarPark,
CarRentalStation,
ElectricChargingStation,
EnergyInfrastructureSite,
LorryParkingSite,
ParkingSite,
PetrolStation,
PublicTransportDepot,
PublicTransportHub,
ShoppingCentre,
TrainStation,
Other,
Extended(String),
}
impl FacilityTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Airport => "airport",
Self::CarPark => "carPark",
Self::CarRentalStation => "carRentalStation",
Self::ElectricChargingStation => "electricChargingStation",
Self::EnergyInfrastructureSite => "energyInfrastructureSite",
Self::LorryParkingSite => "lorryParkingSite",
Self::ParkingSite => "parkingSite",
Self::PetrolStation => "petrolStation",
Self::PublicTransportDepot => "publicTransportDepot",
Self::PublicTransportHub => "publicTransportHub",
Self::ShoppingCentre => "shoppingCentre",
Self::TrainStation => "trainStation",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for FacilityTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"airport" => Some(Self::Airport),
"carPark" => Some(Self::CarPark),
"carRentalStation" => Some(Self::CarRentalStation),
"electricChargingStation" => Some(Self::ElectricChargingStation),
"energyInfrastructureSite" => Some(Self::EnergyInfrastructureSite),
"lorryParkingSite" => Some(Self::LorryParkingSite),
"parkingSite" => Some(Self::ParkingSite),
"petrolStation" => Some(Self::PetrolStation),
"publicTransportDepot" => Some(Self::PublicTransportDepot),
"publicTransportHub" => Some(Self::PublicTransportHub),
"shoppingCentre" => Some(Self::ShoppingCentre),
"trainStation" => Some(Self::TrainStation),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl FacilityTypeEnum {
#[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 ImageFormatEnum {
Bmp,
Gif,
Jpeg,
Png,
Extended(String),
}
impl ImageFormatEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Bmp => "bmp",
Self::Gif => "gif",
Self::Jpeg => "jpeg",
Self::Png => "png",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ImageFormatEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"bmp" => Some(Self::Bmp),
"gif" => Some(Self::Gif),
"jpeg" => Some(Self::Jpeg),
"png" => Some(Self::Png),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ImageFormatEnum {
#[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 IndexReference = com::Integer;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MeansOfPaymentEnum {
PaymentCreditCard,
CashBillsOnly,
CashCoinsOnly,
TollTag,
MobileAccount,
CashCoinsAndBills,
Prepay,
PaymentDebitCard,
PaymentValueCard,
Unknown,
Extended(String),
}
impl MeansOfPaymentEnum {
pub fn as_str(&self) -> &str {
match self {
Self::PaymentCreditCard => "paymentCreditCard",
Self::CashBillsOnly => "cashBillsOnly",
Self::CashCoinsOnly => "cashCoinsOnly",
Self::TollTag => "tollTag",
Self::MobileAccount => "mobileAccount",
Self::CashCoinsAndBills => "cashCoinsAndBills",
Self::Prepay => "prepay",
Self::PaymentDebitCard => "paymentDebitCard",
Self::PaymentValueCard => "paymentValueCard",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for MeansOfPaymentEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"paymentCreditCard" => Some(Self::PaymentCreditCard),
"cashBillsOnly" => Some(Self::CashBillsOnly),
"cashCoinsOnly" => Some(Self::CashCoinsOnly),
"tollTag" => Some(Self::TollTag),
"mobileAccount" => Some(Self::MobileAccount),
"cashCoinsAndBills" => Some(Self::CashCoinsAndBills),
"prepay" => Some(Self::Prepay),
"paymentDebitCard" => Some(Self::PaymentDebitCard),
"paymentValueCard" => Some(Self::PaymentValueCard),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl MeansOfPaymentEnum {
#[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 OpeningStatusEnum {
Open,
OpenWithServiceLimitation,
Closed,
ClosedOnHoliday,
ClosedOnMaintenance,
TemporarilyClosed,
StatusUnknown,
Other,
Extended(String),
}
impl OpeningStatusEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Open => "open",
Self::OpenWithServiceLimitation => "openWithServiceLimitation",
Self::Closed => "closed",
Self::ClosedOnHoliday => "closedOnHoliday",
Self::ClosedOnMaintenance => "closedOnMaintenance",
Self::TemporarilyClosed => "temporarilyClosed",
Self::StatusUnknown => "statusUnknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for OpeningStatusEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"open" => Some(Self::Open),
"openWithServiceLimitation" => Some(Self::OpenWithServiceLimitation),
"closed" => Some(Self::Closed),
"closedOnHoliday" => Some(Self::ClosedOnHoliday),
"closedOnMaintenance" => Some(Self::ClosedOnMaintenance),
"temporarilyClosed" => Some(Self::TemporarilyClosed),
"statusUnknown" => Some(Self::StatusUnknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl OpeningStatusEnum {
#[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 OperationStatusEnum {
InOperation,
LimitedOperation,
NotInOperation,
NotInOperationAbnormal,
TechnicalDefect,
Unknown,
Extended(String),
}
impl OperationStatusEnum {
pub fn as_str(&self) -> &str {
match self {
Self::InOperation => "inOperation",
Self::LimitedOperation => "limitedOperation",
Self::NotInOperation => "notInOperation",
Self::NotInOperationAbnormal => "notInOperationAbnormal",
Self::TechnicalDefect => "technicalDefect",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for OperationStatusEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"inOperation" => Some(Self::InOperation),
"limitedOperation" => Some(Self::LimitedOperation),
"notInOperation" => Some(Self::NotInOperation),
"notInOperationAbnormal" => Some(Self::NotInOperationAbnormal),
"technicalDefect" => Some(Self::TechnicalDefect),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl OperationStatusEnum {
#[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 OrganisationTypeEnum {
PublicSector,
PrivateSector,
Extended(String),
}
impl OrganisationTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::PublicSector => "publicSector",
Self::PrivateSector => "privateSector",
Self::Extended(v) => v,
}
}
}
impl Enumeration for OrganisationTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"publicSector" => Some(Self::PublicSector),
"privateSector" => Some(Self::PrivateSector),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl OrganisationTypeEnum {
#[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 PaymentBrandsEnum {
AmericanExpress,
ApplePay,
Cirrus,
DinersClub,
DiscoverCard,
GiroCard,
Maestro,
MasterCard,
Visa,
Vpay,
Other,
Extended(String),
}
impl PaymentBrandsEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AmericanExpress => "americanExpress",
Self::ApplePay => "applePay",
Self::Cirrus => "cirrus",
Self::DinersClub => "dinersClub",
Self::DiscoverCard => "discoverCard",
Self::GiroCard => "giroCard",
Self::Maestro => "maestro",
Self::MasterCard => "masterCard",
Self::Visa => "visa",
Self::Vpay => "vpay",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PaymentBrandsEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"americanExpress" => Some(Self::AmericanExpress),
"applePay" => Some(Self::ApplePay),
"cirrus" => Some(Self::Cirrus),
"dinersClub" => Some(Self::DinersClub),
"discoverCard" => Some(Self::DiscoverCard),
"giroCard" => Some(Self::GiroCard),
"maestro" => Some(Self::Maestro),
"masterCard" => Some(Self::MasterCard),
"visa" => Some(Self::Visa),
"vpay" => Some(Self::Vpay),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PaymentBrandsEnum {
#[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 PaymentTimingEnum {
Prepay,
PayOnEntry,
PayPriorToExit,
PayAfterExit,
PayAndExit,
Other,
Extended(String),
}
impl PaymentTimingEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Prepay => "prepay",
Self::PayOnEntry => "payOnEntry",
Self::PayPriorToExit => "payPriorToExit",
Self::PayAfterExit => "payAfterExit",
Self::PayAndExit => "payAndExit",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PaymentTimingEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"prepay" => Some(Self::Prepay),
"payOnEntry" => Some(Self::PayOnEntry),
"payPriorToExit" => Some(Self::PayPriorToExit),
"payAfterExit" => Some(Self::PayAfterExit),
"payAndExit" => Some(Self::PayAndExit),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PaymentTimingEnum {
#[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 RateAvailabilityTypeEnum {
Private,
Public,
Restricted,
Extended(String),
}
impl RateAvailabilityTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Private => "private",
Self::Public => "public",
Self::Restricted => "restricted",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RateAvailabilityTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"private" => Some(Self::Private),
"public" => Some(Self::Public),
"restricted" => Some(Self::Restricted),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RateAvailabilityTypeEnum {
#[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 RateLineTypeEnum {
FlatRate,
IncrementingRate,
FlatRateTier,
PerUnit,
Extended(String),
}
impl RateLineTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::FlatRate => "flatRate",
Self::IncrementingRate => "incrementingRate",
Self::FlatRateTier => "flatRateTier",
Self::PerUnit => "perUnit",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RateLineTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"flatRate" => Some(Self::FlatRate),
"incrementingRate" => Some(Self::IncrementingRate),
"flatRateTier" => Some(Self::FlatRateTier),
"perUnit" => Some(Self::PerUnit),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RateLineTypeEnum {
#[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 RateTypeEnum {
Contract,
Daily,
Event,
Hourly,
Extended(String),
}
impl RateTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Contract => "contract",
Self::Daily => "daily",
Self::Event => "event",
Self::Hourly => "hourly",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RateTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"contract" => Some(Self::Contract),
"daily" => Some(Self::Daily),
"event" => Some(Self::Event),
"hourly" => Some(Self::Hourly),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RateTypeEnum {
#[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 RateUsageConditionsTypeEnum {
FixedDuration,
FixedNumber,
Once,
Unlimited,
Extended(String),
}
impl RateUsageConditionsTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::FixedDuration => "fixedDuration",
Self::FixedNumber => "fixedNumber",
Self::Once => "once",
Self::Unlimited => "unlimited",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RateUsageConditionsTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"fixedDuration" => Some(Self::FixedDuration),
"fixedNumber" => Some(Self::FixedNumber),
"once" => Some(Self::Once),
"unlimited" => Some(Self::Unlimited),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RateUsageConditionsTypeEnum {
#[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 RefundTypeEnum {
SurchargeNonRefundable,
SurchargePartiallyRefundable,
SurchargeFullyRefundable,
Extended(String),
}
impl RefundTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::SurchargeNonRefundable => "surchargeNonRefundable",
Self::SurchargePartiallyRefundable => "surchargePartiallyRefundable",
Self::SurchargeFullyRefundable => "surchargeFullyRefundable",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RefundTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"surchargeNonRefundable" => Some(Self::SurchargeNonRefundable),
"surchargePartiallyRefundable" => Some(Self::SurchargePartiallyRefundable),
"surchargeFullyRefundable" => Some(Self::SurchargeFullyRefundable),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RefundTypeEnum {
#[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 ReservationTypeEnum {
Optional,
Mandatory,
NotAvailable,
Partly,
Unknown,
Unspecified,
Extended(String),
}
impl ReservationTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Optional => "optional",
Self::Mandatory => "mandatory",
Self::NotAvailable => "notAvailable",
Self::Partly => "partly",
Self::Unknown => "unknown",
Self::Unspecified => "unspecified",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ReservationTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"optional" => Some(Self::Optional),
"mandatory" => Some(Self::Mandatory),
"notAvailable" => Some(Self::NotAvailable),
"partly" => Some(Self::Partly),
"unknown" => Some(Self::Unknown),
"unspecified" => Some(Self::Unspecified),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ReservationTypeEnum {
#[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 RightTypeEnum {
OneTimeUseParking,
PermitParking,
LoadingUnloading,
SetdownPickup,
Waiting,
AccessPermission,
DoingReservation,
ElectricCharging,
Extended(String),
}
impl RightTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::OneTimeUseParking => "oneTimeUseParking",
Self::PermitParking => "permitParking",
Self::LoadingUnloading => "loadingUnloading",
Self::SetdownPickup => "setdownPickup",
Self::Waiting => "waiting",
Self::AccessPermission => "accessPermission",
Self::DoingReservation => "doingReservation",
Self::ElectricCharging => "electricCharging",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RightTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"oneTimeUseParking" => Some(Self::OneTimeUseParking),
"permitParking" => Some(Self::PermitParking),
"loadingUnloading" => Some(Self::LoadingUnloading),
"setdownPickup" => Some(Self::SetdownPickup),
"waiting" => Some(Self::Waiting),
"accessPermission" => Some(Self::AccessPermission),
"doingReservation" => Some(Self::DoingReservation),
"electricCharging" => Some(Self::ElectricCharging),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RightTypeEnum {
#[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 ServiceFacilityTypeEnum {
BikeGarage,
BikeSharing,
Cafe,
CarWash,
Docstop,
FoodShopping,
Hotel,
Kiosk,
Laundry,
LeisureActivities,
MedicalFacility,
Motel,
MotorcycleGarage,
MotorwayRestaurant,
MotorwayRestaurantSmall,
OvernightAccommodation,
PetrolStation,
Pharmacy,
PayDesk,
Police,
Restaurant,
RestaurantSelfService,
Shop,
SnackBar,
SparePartsShopping,
TouristInformation,
TruckRepair,
TruckWash,
TyreRepair,
VehicleMaintenance,
Unknown,
Other,
Extended(String),
}
impl ServiceFacilityTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::BikeGarage => "bikeGarage",
Self::BikeSharing => "bikeSharing",
Self::Cafe => "cafe",
Self::CarWash => "carWash",
Self::Docstop => "docstop",
Self::FoodShopping => "foodShopping",
Self::Hotel => "hotel",
Self::Kiosk => "kiosk",
Self::Laundry => "laundry",
Self::LeisureActivities => "leisureActivities",
Self::MedicalFacility => "medicalFacility",
Self::Motel => "motel",
Self::MotorcycleGarage => "motorcycleGarage",
Self::MotorwayRestaurant => "motorwayRestaurant",
Self::MotorwayRestaurantSmall => "motorwayRestaurantSmall",
Self::OvernightAccommodation => "overnightAccommodation",
Self::PetrolStation => "petrolStation",
Self::Pharmacy => "pharmacy",
Self::PayDesk => "payDesk",
Self::Police => "police",
Self::Restaurant => "restaurant",
Self::RestaurantSelfService => "restaurantSelfService",
Self::Shop => "shop",
Self::SnackBar => "snackBar",
Self::SparePartsShopping => "sparePartsShopping",
Self::TouristInformation => "touristInformation",
Self::TruckRepair => "truckRepair",
Self::TruckWash => "truckWash",
Self::TyreRepair => "tyreRepair",
Self::VehicleMaintenance => "vehicleMaintenance",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ServiceFacilityTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"bikeGarage" => Some(Self::BikeGarage),
"bikeSharing" => Some(Self::BikeSharing),
"cafe" => Some(Self::Cafe),
"carWash" => Some(Self::CarWash),
"docstop" => Some(Self::Docstop),
"foodShopping" => Some(Self::FoodShopping),
"hotel" => Some(Self::Hotel),
"kiosk" => Some(Self::Kiosk),
"laundry" => Some(Self::Laundry),
"leisureActivities" => Some(Self::LeisureActivities),
"medicalFacility" => Some(Self::MedicalFacility),
"motel" => Some(Self::Motel),
"motorcycleGarage" => Some(Self::MotorcycleGarage),
"motorwayRestaurant" => Some(Self::MotorwayRestaurant),
"motorwayRestaurantSmall" => Some(Self::MotorwayRestaurantSmall),
"overnightAccommodation" => Some(Self::OvernightAccommodation),
"petrolStation" => Some(Self::PetrolStation),
"pharmacy" => Some(Self::Pharmacy),
"payDesk" => Some(Self::PayDesk),
"police" => Some(Self::Police),
"restaurant" => Some(Self::Restaurant),
"restaurantSelfService" => Some(Self::RestaurantSelfService),
"shop" => Some(Self::Shop),
"snackBar" => Some(Self::SnackBar),
"sparePartsShopping" => Some(Self::SparePartsShopping),
"touristInformation" => Some(Self::TouristInformation),
"truckRepair" => Some(Self::TruckRepair),
"truckWash" => Some(Self::TruckWash),
"tyreRepair" => Some(Self::TyreRepair),
"vehicleMaintenance" => Some(Self::VehicleMaintenance),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ServiceFacilityTypeEnum {
#[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 SquareMetres = com::NonNegativeInteger;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SurchargeTypeEnum {
Reservation,
MobilePayment,
Deposit,
MembershipFee,
Extended(String),
}
impl SurchargeTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Reservation => "reservation",
Self::MobilePayment => "mobilePayment",
Self::Deposit => "deposit",
Self::MembershipFee => "membershipFee",
Self::Extended(v) => v,
}
}
}
impl Enumeration for SurchargeTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"reservation" => Some(Self::Reservation),
"mobilePayment" => Some(Self::MobilePayment),
"deposit" => Some(Self::Deposit),
"membershipFee" => Some(Self::MembershipFee),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl SurchargeTypeEnum {
#[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 TimeZone = String;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum UserTypeEnum {
AllUsers,
Commuters,
Customers,
ElderlyUsers,
Employees,
Families,
PersonsWithDisabilities,
HearingImpaired,
HotelGuests,
LongTermParkers,
Members,
Men,
OvernightParkers,
ParkAndCycleUser,
ParkAndRideUsers,
ParkAndWalkUser,
Pensioners,
PregnantWomen,
RegisteredDisabledUsers,
ReservationHolders,
Residents,
SeasonTicketHolders,
Shoppers,
ShortTermParkers,
SportEventAwaySupporters,
SportEventHomeSupporters,
Students,
Staff,
Subscribers,
Visitors,
VisuallyImpaired,
WheelchairUsers,
Women,
Unknown,
Other,
Extended(String),
}
impl UserTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AllUsers => "allUsers",
Self::Commuters => "commuters",
Self::Customers => "customers",
Self::ElderlyUsers => "elderlyUsers",
Self::Employees => "employees",
Self::Families => "families",
Self::PersonsWithDisabilities => "personsWithDisabilities",
Self::HearingImpaired => "hearingImpaired",
Self::HotelGuests => "hotelGuests",
Self::LongTermParkers => "longTermParkers",
Self::Members => "members",
Self::Men => "men",
Self::OvernightParkers => "overnightParkers",
Self::ParkAndCycleUser => "parkAndCycleUser",
Self::ParkAndRideUsers => "parkAndRideUsers",
Self::ParkAndWalkUser => "parkAndWalkUser",
Self::Pensioners => "pensioners",
Self::PregnantWomen => "pregnantWomen",
Self::RegisteredDisabledUsers => "registeredDisabledUsers",
Self::ReservationHolders => "reservationHolders",
Self::Residents => "residents",
Self::SeasonTicketHolders => "seasonTicketHolders",
Self::Shoppers => "shoppers",
Self::ShortTermParkers => "shortTermParkers",
Self::SportEventAwaySupporters => "sportEventAwaySupporters",
Self::SportEventHomeSupporters => "sportEventHomeSupporters",
Self::Students => "students",
Self::Staff => "staff",
Self::Subscribers => "subscribers",
Self::Visitors => "visitors",
Self::VisuallyImpaired => "visuallyImpaired",
Self::WheelchairUsers => "wheelchairUsers",
Self::Women => "women",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for UserTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"allUsers" => Some(Self::AllUsers),
"commuters" => Some(Self::Commuters),
"customers" => Some(Self::Customers),
"elderlyUsers" => Some(Self::ElderlyUsers),
"employees" => Some(Self::Employees),
"families" => Some(Self::Families),
"personsWithDisabilities" => Some(Self::PersonsWithDisabilities),
"hearingImpaired" => Some(Self::HearingImpaired),
"hotelGuests" => Some(Self::HotelGuests),
"longTermParkers" => Some(Self::LongTermParkers),
"members" => Some(Self::Members),
"men" => Some(Self::Men),
"overnightParkers" => Some(Self::OvernightParkers),
"parkAndCycleUser" => Some(Self::ParkAndCycleUser),
"parkAndRideUsers" => Some(Self::ParkAndRideUsers),
"parkAndWalkUser" => Some(Self::ParkAndWalkUser),
"pensioners" => Some(Self::Pensioners),
"pregnantWomen" => Some(Self::PregnantWomen),
"registeredDisabledUsers" => Some(Self::RegisteredDisabledUsers),
"reservationHolders" => Some(Self::ReservationHolders),
"residents" => Some(Self::Residents),
"seasonTicketHolders" => Some(Self::SeasonTicketHolders),
"shoppers" => Some(Self::Shoppers),
"shortTermParkers" => Some(Self::ShortTermParkers),
"sportEventAwaySupporters" => Some(Self::SportEventAwaySupporters),
"sportEventHomeSupporters" => Some(Self::SportEventHomeSupporters),
"students" => Some(Self::Students),
"staff" => Some(Self::Staff),
"subscribers" => Some(Self::Subscribers),
"visitors" => Some(Self::Visitors),
"visuallyImpaired" => Some(Self::VisuallyImpaired),
"wheelchairUsers" => Some(Self::WheelchairUsers),
"women" => Some(Self::Women),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl UserTypeEnum {
#[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, Default, PartialEq)]
pub struct AmountInCurrency {
pub currency_value: Option<AmountOfMoney>,
pub currency_type: Option<CurrencyCode>,
pub amount_in_currency_extension: Option<Box<Extension>>,
}
impl AmountInCurrency {
const FIELDS: &'static [u32] = &[0x80751, 0x80750, 0x8041d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80030);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80751 => { let v = r.value::<Decimal>()?; r.set(&mut e0, v, 1873); }
0x80750 => { let v = r.string()?; r.set(&mut e1, v, 1872); }
0x8041d => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1053); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1873);
r.required(&e1, 1872);
let v = Self {
currency_value: e0,
currency_type: e1,
amount_in_currency_extension: e2,
};
r.close();
Ok(v)
}
}
impl AmountInCurrency {
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.currency_value {
Some(v) => { w.digits("currencyValue", v, 8, 2)?; w.leaf("fac:currencyValue", v)?; }
None => return Err(w.missing("fac:currencyValue")),
}
match &self.currency_type {
Some(v) => { w.max_len("currencyType", v, 1024)?; w.pattern("currencyType", v, Pattern::CurrencyCode)?; w.leaf("fac:currencyType", v)?; }
None => return Err(w.missing("fac:currencyType")),
}
if let Some(v) = &self.amount_in_currency_extension { w.extension("fac:_amountInCurrencyExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AssociatedFacility {
pub r#type: Option<FacilityTypeEnum>,
pub facility_reference: Option<Box<com::VersionedReference>>,
pub description: Option<MultilingualString>,
pub associated_facility_extension: Option<Box<Extension>>,
}
impl AssociatedFacility {
const FIELDS: &'static [u32] = &[0x80bfe, 0x8080c, 0x80777, 0x80425];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80038);
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 {
0x80bfe => { let v = r.enumeration::<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); }
_ => 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,
};
r.close();
Ok(v)
}
}
impl AssociatedFacility {
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)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct BrandsAcceptedCodeList {
pub brands_accepted_list: Option<PaymentBrandsEnum>,
pub brands_accepted_code_list_extension: Option<Box<Extension>>,
}
impl BrandsAcceptedCodeList {
const FIELDS: &'static [u32] = &[0x80700, 0x8042f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80042);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80700 => { let v = r.enumeration::<PaymentBrandsEnum>()?; r.set(&mut e0, v, 1792); }
0x8042f => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1071); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1792);
let v = Self {
brands_accepted_list: e0,
brands_accepted_code_list_extension: e1,
};
r.close();
Ok(v)
}
}
impl BrandsAcceptedCodeList {
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.brands_accepted_list {
Some(v) => { w.enumeration("fac:brandsAcceptedList", v.literal())?; }
None => return Err(w.missing("fac:brandsAcceptedList")),
}
if let Some(v) = &self.brands_accepted_code_list_extension { w.extension("fac:_brandsAcceptedCodeListExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct BrandsAcceptedText {
pub brands_accepted: Option<String>,
pub brands_accepted_text_extension: Option<Box<Extension>>,
}
impl BrandsAcceptedText {
const FIELDS: &'static [u32] = &[0x806fe, 0x80430];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80043);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x806fe => { let v = r.string()?; r.set(&mut e0, v, 1790); }
0x80430 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1072); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1790);
let v = Self {
brands_accepted: e0,
brands_accepted_text_extension: e1,
};
r.close();
Ok(v)
}
}
impl BrandsAcceptedText {
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.brands_accepted {
Some(v) => { w.max_len("brandsAccepted", v, 1024)?; w.leaf("fac:brandsAccepted", v)?; }
None => return Err(w.missing("fac:brandsAccepted")),
}
if let Some(v) = &self.brands_accepted_text_extension { w.extension("fac:_brandsAcceptedTextExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ClosureInformation {
pub permananently_closed: Option<com::Boolean>,
pub temporarily_closed: Option<com::Boolean>,
pub closed_from: Option<DateTime>,
pub temporarily_closed_until: Option<DateTime>,
pub closure_information_extension: Option<Box<Extension>>,
}
impl ClosureInformation {
const FIELDS: &'static [u32] = &[0x80a20, 0x80ba7, 0x8071e, 0x80ba8, 0x8043b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8004f);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80a20 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2592); }
0x80ba7 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2983); }
0x8071e => { let v = r.date_time()?; r.set(&mut e2, v, 1822); }
0x80ba8 => { let v = r.date_time()?; r.set(&mut e3, v, 2984); }
0x8043b => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1083); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
permananently_closed: e0,
temporarily_closed: e1,
closed_from: e2,
temporarily_closed_until: e3,
closure_information_extension: e4,
};
r.close();
Ok(v)
}
}
impl ClosureInformation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.permananently_closed { w.leaf("fac:permananentlyClosed", v)?; }
if let Some(v) = &self.temporarily_closed { w.leaf("fac:temporarilyClosed", v)?; }
if let Some(v) = &self.closed_from { w.leaf("fac:closedFrom", v)?; }
if let Some(v) = &self.temporarily_closed_until { w.leaf("fac:temporarilyClosedUntil", v)?; }
if let Some(v) = &self.closure_information_extension { w.extension("fac:_closureInformationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ContactInformation {
pub language: Vec<com::Language>,
pub telephone_number: Option<String>,
pub fax_number: Option<String>,
pub e_mail: Option<String>,
pub contact_information_extension: Option<Box<Extension>>,
}
impl ContactInformation {
const FIELDS: &'static [u32] = &[0x808b0, 0x80ba4, 0x8081c, 0x807b2, 0x80448];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8005c);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x808b0 => { let v = r.string()?; e0.extend(v); }
0x80ba4 => { let v = r.string()?; r.set(&mut e1, v, 2980); }
0x8081c => { let v = r.string()?; r.set(&mut e2, v, 2076); }
0x807b2 => { let v = r.string()?; r.set(&mut e3, v, 1970); }
0x80448 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1096); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
language: e0,
telephone_number: e1,
fax_number: e2,
e_mail: e3,
contact_information_extension: e4,
};
r.close();
Ok(v)
}
}
impl ContactInformation {
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.language { w.pattern("language", v, Pattern::Language)?; w.leaf("fac:language", v)?; }
if let Some(v) = &self.telephone_number { w.max_len("telephoneNumber", v, 1024)?; w.leaf("fac:telephoneNumber", v)?; }
if let Some(v) = &self.fax_number { w.max_len("faxNumber", v, 1024)?; w.leaf("fac:faxNumber", v)?; }
if let Some(v) = &self.e_mail { w.max_len("eMail", v, 1024)?; w.leaf("fac:eMail", v)?; }
if let Some(v) = &self.contact_information_extension { w.extension("fac:_contactInformationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ContactPerson {
pub language: Vec<com::Language>,
pub telephone_number: Option<String>,
pub fax_number: Option<String>,
pub e_mail: Option<String>,
pub contact_information_extension: Option<Box<Extension>>,
pub name: Option<String>,
pub first_name: Option<String>,
pub title: Option<MultilingualString>,
pub position: Option<MultilingualString>,
pub contact_person_extension: Option<Box<Extension>>,
}
impl ContactPerson {
const FIELDS: &'static [u32] = &[0x808b0, 0x80ba4, 0x8081c, 0x807b2, 0x80448, 0x80949, 0x80822, 0x80bbf, 0x80a4e, 0x80449];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8005d);
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;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x808b0 => { let v = r.string()?; e0.extend(v); }
0x80ba4 => { let v = r.string()?; r.set(&mut e1, v, 2980); }
0x8081c => { let v = r.string()?; r.set(&mut e2, v, 2076); }
0x807b2 => { let v = r.string()?; r.set(&mut e3, v, 1970); }
0x80448 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1096); }
0x80949 => { let v = r.string()?; r.set(&mut e5, v, 2377); }
0x80822 => { let v = r.string()?; r.set(&mut e6, v, 2082); }
0x80bbf => { let v = r.multilingual()?; r.set(&mut e7, v, 3007); }
0x80a4e => { let v = r.multilingual()?; r.set(&mut e8, v, 2638); }
0x80449 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1097); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e5, 2377);
let v = Self {
language: e0,
telephone_number: e1,
fax_number: e2,
e_mail: e3,
contact_information_extension: e4,
name: e5,
first_name: e6,
title: e7,
position: e8,
contact_person_extension: e9,
};
r.close();
Ok(v)
}
}
impl ContactPerson {
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.language { w.pattern("language", v, Pattern::Language)?; w.leaf("fac:language", v)?; }
if let Some(v) = &self.telephone_number { w.max_len("telephoneNumber", v, 1024)?; w.leaf("fac:telephoneNumber", v)?; }
if let Some(v) = &self.fax_number { w.max_len("faxNumber", v, 1024)?; w.leaf("fac:faxNumber", v)?; }
if let Some(v) = &self.e_mail { w.max_len("eMail", v, 1024)?; w.leaf("fac:eMail", v)?; }
if let Some(v) = &self.contact_information_extension { w.extension("fac:_contactInformationExtension", v)?; }
match &self.name {
Some(v) => { w.max_len("name", v, 1024)?; w.leaf("fac:name", v)?; }
None => return Err(w.missing("fac:name")),
}
if let Some(v) = &self.first_name { w.max_len("firstName", v, 1024)?; w.leaf("fac:firstName", v)?; }
if let Some(v) = &self.title { w.multilingual("fac:title", v)?; }
if let Some(v) = &self.position { w.multilingual("fac:position", v)?; }
if let Some(v) = &self.contact_person_extension { w.extension("fac:_contactPersonExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Credential {
pub r#type: Option<CredentialTypeEnum>,
pub other_type: Option<String>,
pub credential_extension: Option<Box<Extension>>,
}
impl Credential {
const FIELDS: &'static [u32] = &[0x80bfe, 0x809ed, 0x80451];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80064);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80bfe => { let v = r.enumeration::<CredentialTypeEnum>()?; r.set(&mut e0, v, 3070); }
0x809ed => { let v = r.string()?; r.set(&mut e1, v, 2541); }
0x80451 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1105); }
_ => 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,
other_type: e1,
credential_extension: e2,
};
r.close();
Ok(v)
}
}
impl Credential {
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.other_type { w.max_len("otherType", v, 1024)?; w.leaf("fac:otherType", v)?; }
if let Some(v) = &self.credential_extension { w.extension("fac:_credentialExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct CredentialAssigned {
pub r#type: Option<CredentialTypeEnum>,
pub other_type: Option<String>,
pub credential_extension: Option<Box<Extension>>,
pub local_identifier: Option<String>,
pub issuer: Option<Box<com::VersionedReference>>,
pub credential_assigned_extension: Option<Box<Extension>>,
}
impl CredentialAssigned {
const FIELDS: &'static [u32] = &[0x80bfe, 0x809ed, 0x80451, 0x808db, 0x8089e, 0x80450];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80065);
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;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80bfe => { let v = r.enumeration::<CredentialTypeEnum>()?; r.set(&mut e0, v, 3070); }
0x809ed => { let v = r.string()?; r.set(&mut e1, v, 2541); }
0x80451 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1105); }
0x808db => { let v = r.string()?; r.set(&mut e3, v, 2267); }
0x8089e => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e4, v.map(Box::new), 2206); }
0x80450 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1104); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3070);
r.required(&e4, 2206);
let v = Self {
r#type: e0,
other_type: e1,
credential_extension: e2,
local_identifier: e3,
issuer: e4,
credential_assigned_extension: e5,
};
r.close();
Ok(v)
}
}
impl CredentialAssigned {
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.other_type { w.max_len("otherType", v, 1024)?; w.leaf("fac:otherType", v)?; }
if let Some(v) = &self.credential_extension { w.extension("fac:_credentialExtension", v)?; }
if let Some(v) = &self.local_identifier { w.max_len("localIdentifier", v, 1024)?; w.leaf("fac:localIdentifier", v)?; }
match &self.issuer {
Some(v) => { v.write(w, "fac:issuer", "", " targetClass=\"fac:Organisation\"")?; }
None => return Err(w.missing("fac:issuer")),
}
if let Some(v) = &self.credential_assigned_extension { w.extension("fac:_credentialAssignedExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Dimension {
pub length: Option<com::MetresAsFloat>,
pub width: Option<com::MetresAsFloat>,
pub height: Option<com::MetresAsFloat>,
pub usable_area: Option<SquareMetres>,
pub dimension_extension: Option<Box<Extension>>,
}
impl Dimension {
const FIELDS: &'static [u32] = &[0x808c5, 0x80c75, 0x8085b, 0x80c15, 0x80468];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8007d);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x808c5 => { let v = r.value::<f32>()?; r.set(&mut e0, v, 2245); }
0x80c75 => { let v = r.value::<f32>()?; r.set(&mut e1, v, 3189); }
0x8085b => { let v = r.value::<f32>()?; r.set(&mut e2, v, 2139); }
0x80c15 => { let v = r.value::<u64>()?; r.set(&mut e3, v, 3093); }
0x80468 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1128); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
length: e0,
width: e1,
height: e2,
usable_area: e3,
dimension_extension: e4,
};
r.close();
Ok(v)
}
}
impl Dimension {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.length { w.leaf("fac:length", v)?; }
if let Some(v) = &self.width { w.leaf("fac:width", v)?; }
if let Some(v) = &self.height { w.leaf("fac:height", v)?; }
if let Some(v) = &self.usable_area { w.leaf("fac:usableArea", v)?; }
if let Some(v) = &self.dimension_extension { w.extension("fac:_dimensionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DurationValue {
pub accuracy: Option<com::Percentage>,
pub computational_method: Option<com::ComputationMethodEnum>,
pub number_of_incomplete_inputs: Option<com::NonNegativeInteger>,
pub number_of_input_values_used: Option<com::NonNegativeInteger>,
pub smoothing_factor: Option<com::Float>,
pub standard_deviation: Option<com::Float>,
pub supplier_calculated_data_quality: Option<com::Percentage>,
pub data_error: Option<com::Boolean>,
pub reason_for_data_error: Option<MultilingualString>,
pub data_value_extension: Option<Box<Extension>>,
pub duration: Option<com::Seconds>,
pub duration_value_extension: Option<Box<Extension>>,
}
impl DurationValue {
const FIELDS: &'static [u32] = &[0x30759, 0x30ab2, 0x30454, 0x807aa, 0x80475];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8008a);
let a0 = r.attr_value::<f32>(1648)?;
let a1 = r.attr_enum::<com::ComputationMethodEnum>(1840);
let a2 = r.attr_value::<u64>(2421)?;
let a3 = r.attr_value::<u64>(2422)?;
let a4 = r.attr_value::<f32>(2891)?;
let a5 = r.attr_value::<f32>(2922)?;
let a6 = r.attr_value::<f32>(2966)?;
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x30759 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 1881); }
0x30ab2 => { let v = r.multilingual()?; r.set(&mut e1, v, 2738); }
0x30454 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1108); }
0x807aa => { let v = r.value::<f32>()?; r.set(&mut e3, v, 1962); }
0x80475 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1141); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e3, 1962);
let v = Self {
accuracy: a0,
computational_method: a1,
number_of_incomplete_inputs: a2,
number_of_input_values_used: a3,
smoothing_factor: a4,
standard_deviation: a5,
supplier_calculated_data_quality: a6,
data_error: e0,
reason_for_data_error: e1,
data_value_extension: e2,
duration: e3,
duration_value_extension: e4,
};
r.close();
Ok(v)
}
}
impl DurationValue {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.accuracy { w.attr_value("accuracy", v)?; }
if let Some(v) = &self.computational_method { w.attr("computationalMethod", v.as_str())?; }
if let Some(v) = &self.number_of_incomplete_inputs { w.attr_value("numberOfIncompleteInputs", v)?; }
if let Some(v) = &self.number_of_input_values_used { w.attr_value("numberOfInputValuesUsed", v)?; }
if let Some(v) = &self.smoothing_factor { w.attr_value("smoothingFactor", v)?; }
if let Some(v) = &self.standard_deviation { w.attr_value("standardDeviation", v)?; }
if let Some(v) = &self.supplier_calculated_data_quality { w.attr_value("supplierCalculatedDataQuality", v)?; }
if let Some(v) = &self.data_error { w.leaf("com:dataError", v)?; }
if let Some(v) = &self.reason_for_data_error { w.multilingual("com:reasonForDataError", v)?; }
if let Some(v) = &self.data_value_extension { w.extension("com:_dataValueExtension", v)?; }
match &self.duration {
Some(v) => { w.leaf("fac:duration", v)?; }
None => return Err(w.missing("fac:duration")),
}
if let Some(v) = &self.duration_value_extension { w.extension("fac:_durationValueExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Eligibility {
pub eligibility_name: Option<MultilingualString>,
pub description: Option<MultilingualString>,
pub qualification: Vec<Qualification>,
pub eligibility_extension: Option<Box<Extension>>,
}
impl Eligibility {
const FIELDS: &'static [u32] = &[0x807be, 0x80777, 0x80a96, 0x80481];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80096);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x807be => { let v = r.multilingual()?; r.set(&mut e0, v, 1982); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e1, v, 1911); }
0x80a96 => { let v = Some(Qualification::read(r)?); e2.extend(v); }
0x80481 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1153); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
eligibility_name: e0,
description: e1,
qualification: e2,
eligibility_extension: e3,
};
r.close();
Ok(v)
}
}
impl Eligibility {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.eligibility_name { w.multilingual("fac:eligibilityName", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
for v in &self.qualification { v.write(w, "fac:qualification", "", "")?; }
if let Some(v) = &self.eligibility_extension { w.extension("fac:_eligibilityExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct FacilityObjectStatus {
pub reference: Option<Box<com::VersionedReference>>,
pub last_updated: Option<DateTime>,
pub opening_status: Option<OpeningStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<OperatingHours>,
pub new_rates: Option<Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
}
impl FacilityObjectStatus {
const FIELDS: &'static [u32] = &[0x80aba, 0x808ba, 0x809a8, 0x80aca, 0x80b77, 0x80958, 0x80959, 0x8080d, 0x80498];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x800ae);
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;
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::<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 = OperatingHours::read(r)?; r.set(&mut e5, v, 2392); }
0x80959 => { let v = 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); }
_ => 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,
};
r.close();
Ok(v)
}
}
impl FacilityObjectStatus {
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)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct FacilityStatus {
pub reference: Option<Box<com::VersionedReference>>,
pub last_updated: Option<DateTime>,
pub opening_status: Option<OpeningStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<OperatingHours>,
pub new_rates: Option<Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
pub supplemental_facility_status: Vec<SupplementalFacilityStatus>,
pub facility_status_extension: Option<Box<Extension>>,
}
impl FacilityStatus {
const FIELDS: &'static [u32] = &[0x80aba, 0x808ba, 0x809a8, 0x80aca, 0x80b77, 0x80958, 0x80959, 0x8080d, 0x80498, 0x80b91, 0x80499];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x800af);
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;
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::<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 = OperatingHours::read(r)?; r.set(&mut e5, v, 2392); }
0x80959 => { let v = 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(SupplementalFacilityStatus::read(r)?); e9.extend(v); }
0x80499 => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1177); }
_ => 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,
};
r.close();
Ok(v)
}
}
impl FacilityStatus {
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)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct FreeOfCharge {
pub applicable_currency: Vec<CurrencyCode>,
pub payment_method: Option<Box<PaymentMethod>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub energy_pricing_policy: Option<Box<egi::EnergyPricingPolicy>>,
pub rates_extension: Option<Box<Extension>>,
pub free_of_charge_extension: Option<Box<Extension>>,
}
impl FreeOfCharge {
const FIELDS: &'static [u32] = &[0x806bf, 0x80a13, 0x809f1, 0x807d4, 0x8058d, 0x8049e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x800b4);
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;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x806bf => { let v = r.string()?; e0.extend(v); }
0x80a13 => { let v = Some(PaymentMethod::read(r)?); r.set(&mut e1, v.map(Box::new), 2579); }
0x809f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x807d4 => { let v = Some(egi::EnergyPricingPolicy::read(r)?); r.set(&mut e3, v.map(Box::new), 2004); }
0x8058d => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1421); }
0x8049e => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1182); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
applicable_currency: e0,
payment_method: e1,
overall_period: e2,
energy_pricing_policy: e3,
rates_extension: e4,
free_of_charge_extension: e5,
};
r.close();
Ok(v)
}
}
impl FreeOfCharge {
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.applicable_currency { w.max_len("applicableCurrency", v, 1024)?; w.pattern("applicableCurrency", v, Pattern::CurrencyCode)?; w.leaf("fac:applicableCurrency", v)?; }
if let Some(v) = &self.payment_method { v.write(w, "fac:paymentMethod", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "fac:overallPeriod", "", "")?; }
if let Some(v) = &self.energy_pricing_policy { v.write(w, "fac:energyPricingPolicy", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("fac:_ratesExtension", v)?; }
if let Some(v) = &self.free_of_charge_extension { w.extension("fac:_freeOfChargeExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GeneralRateInformation {
pub applicable_currency: Vec<CurrencyCode>,
pub payment_method: Option<Box<PaymentMethod>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub energy_pricing_policy: Option<Box<egi::EnergyPricingPolicy>>,
pub rates_extension: Option<Box<Extension>>,
pub general_rate_information_extension: Option<Box<Extension>>,
}
impl GeneralRateInformation {
const FIELDS: &'static [u32] = &[0x806bf, 0x80a13, 0x809f1, 0x807d4, 0x8058d, 0x804ab];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x800c1);
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;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x806bf => { let v = r.string()?; e0.extend(v); }
0x80a13 => { let v = Some(PaymentMethod::read(r)?); r.set(&mut e1, v.map(Box::new), 2579); }
0x809f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x807d4 => { let v = Some(egi::EnergyPricingPolicy::read(r)?); r.set(&mut e3, v.map(Box::new), 2004); }
0x8058d => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1421); }
0x804ab => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1195); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
applicable_currency: e0,
payment_method: e1,
overall_period: e2,
energy_pricing_policy: e3,
rates_extension: e4,
general_rate_information_extension: e5,
};
r.close();
Ok(v)
}
}
impl GeneralRateInformation {
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.applicable_currency { w.max_len("applicableCurrency", v, 1024)?; w.pattern("applicableCurrency", v, Pattern::CurrencyCode)?; w.leaf("fac:applicableCurrency", v)?; }
if let Some(v) = &self.payment_method { v.write(w, "fac:paymentMethod", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "fac:overallPeriod", "", "")?; }
if let Some(v) = &self.energy_pricing_policy { v.write(w, "fac:energyPricingPolicy", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("fac:_ratesExtension", v)?; }
if let Some(v) = &self.general_rate_information_extension { w.extension("fac:_generalRateInformationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Image {
pub image_data: Option<com::Base64Binary>,
pub image_format: Option<ImageFormatEnum>,
pub image_extension: Option<Box<Extension>>,
}
impl Image {
const FIELDS: &'static [u32] = &[0x80876, 0x80877, 0x804c5];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x800da);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80876 => { let v = r.base64()?; r.set(&mut e0, v, 2166); }
0x80877 => { let v = r.enumeration::<ImageFormatEnum>()?; r.set(&mut e1, v, 2167); }
0x804c5 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1221); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2166);
r.required(&e1, 2167);
let v = Self {
image_data: e0,
image_format: e1,
image_extension: e2,
};
r.close();
Ok(v)
}
}
impl Image {
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.image_data {
Some(v) => { w.leaf("fac:imageData", v)?; }
None => return Err(w.missing("fac:imageData")),
}
match &self.image_format {
Some(v) => { w.enumeration("fac:imageFormat", v.literal())?; }
None => return Err(w.missing("fac:imageFormat")),
}
if let Some(v) = &self.image_extension { w.extension("fac:_imageExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenAllHours {
pub closure_information: Option<Box<ClosureInformation>>,
pub operating_hours_extension: Option<Box<Extension>>,
pub open_all_hours_extension: Option<Box<Extension>>,
}
impl OpenAllHours {
const FIELDS: &'static [u32] = &[0x8071f, 0x8052a, 0x80513];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8012e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x8071f => { let v = Some(ClosureInformation::read(r)?); r.set(&mut e0, v.map(Box::new), 1823); }
0x8052a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1322); }
0x80513 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1299); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
closure_information: e0,
operating_hours_extension: e1,
open_all_hours_extension: e2,
};
r.close();
Ok(v)
}
}
impl OpenAllHours {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.closure_information { v.write(w, "fac:closureInformation", "", "")?; }
if let Some(v) = &self.operating_hours_extension { w.extension("fac:_operatingHoursExtension", v)?; }
if let Some(v) = &self.open_all_hours_extension { w.extension("fac:_openAllHoursExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OperatingHoursByReference {
pub closure_information: Option<Box<ClosureInformation>>,
pub operating_hours_extension: Option<Box<Extension>>,
pub operating_hours_reference: Option<Box<com::VersionedReference>>,
pub operating_hours_table_reference: Option<Box<com::VersionedReference>>,
pub operating_hours_by_reference_extension: Option<Box<Extension>>,
}
impl OperatingHoursByReference {
const FIELDS: &'static [u32] = &[0x8071f, 0x8052a, 0x809c6, 0x809c9, 0x80529];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80145);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x8071f => { let v = Some(ClosureInformation::read(r)?); r.set(&mut e0, v.map(Box::new), 1823); }
0x8052a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1322); }
0x809c6 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e2, v.map(Box::new), 2502); }
0x809c9 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e3, v.map(Box::new), 2505); }
0x80529 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1321); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2502);
let v = Self {
closure_information: e0,
operating_hours_extension: e1,
operating_hours_reference: e2,
operating_hours_table_reference: e3,
operating_hours_by_reference_extension: e4,
};
r.close();
Ok(v)
}
}
impl OperatingHoursByReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.closure_information { v.write(w, "fac:closureInformation", "", "")?; }
if let Some(v) = &self.operating_hours_extension { w.extension("fac:_operatingHoursExtension", v)?; }
match &self.operating_hours_reference {
Some(v) => { v.write(w, "fac:operatingHoursReference", "", " targetClass=\"fac:OperatingHoursSpecification\"")?; }
None => return Err(w.missing("fac:operatingHoursReference")),
}
if let Some(v) = &self.operating_hours_table_reference { v.write(w, "fac:operatingHoursTableReference", "", " targetClass=\"fac:OperatingHoursTable\"")?; }
if let Some(v) = &self.operating_hours_by_reference_extension { w.extension("fac:_operatingHoursByReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OperatingHoursPublication {
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 operating_hours_table: Vec<OperatingHoursTable>,
pub operating_hours_publication_extension: Option<Box<Extension>>,
}
impl OperatingHoursPublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x80857, 0x809c8, 0x8052b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80146);
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); }
0x80857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x809c8 => { let v = Some(OperatingHoursTable::read(r)?); e6.extend(v); }
0x8052b => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1323); }
_ => 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,
operating_hours_table: e6,
operating_hours_publication_extension: e7,
};
r.close();
Ok(v)
}
}
impl OperatingHoursPublication {
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, "fac:headerInformation", "", "")?; }
w.count("fac:operatingHoursTable", self.operating_hours_table.len(), 1, usize::MAX)?;
for v in &self.operating_hours_table { v.write(w, "fac:operatingHoursTable", "", "")?; }
if let Some(v) = &self.operating_hours_publication_extension { w.extension("fac:_operatingHoursPublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OperatingHoursSpecification {
pub id: Option<String>,
pub version: Option<String>,
pub closure_information: Option<Box<ClosureInformation>>,
pub operating_hours_extension: Option<Box<Extension>>,
pub last_updated: Option<DateTime>,
pub label: Option<String>,
pub operating_all_year: Option<com::Boolean>,
pub url_link_address: Option<com::Url>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub operating_hours_specification_extension: Option<Box<Extension>>,
}
impl OperatingHoursSpecification {
const FIELDS: &'static [u32] = &[0x8071f, 0x8052a, 0x808ba, 0x808a9, 0x809c4, 0x80c11, 0x809f1, 0x8052c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80147);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
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 {
0x8071f => { let v = Some(ClosureInformation::read(r)?); r.set(&mut e0, v.map(Box::new), 1823); }
0x8052a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1322); }
0x808ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x808a9 => { let v = r.string()?; r.set(&mut e3, v, 2217); }
0x809c4 => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2500); }
0x80c11 => { let v = r.string()?; r.set(&mut e5, v, 3089); }
0x809f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e6, v.map(Box::new), 2545); }
0x8052c => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1324); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e6, 2545);
let v = Self {
id: a0,
version: a1,
closure_information: e0,
operating_hours_extension: e1,
last_updated: e2,
label: e3,
operating_all_year: e4,
url_link_address: e5,
overall_period: e6,
operating_hours_specification_extension: e7,
};
r.close();
Ok(v)
}
}
impl OperatingHoursSpecification {
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.closure_information { v.write(w, "fac:closureInformation", "", "")?; }
if let Some(v) = &self.operating_hours_extension { w.extension("fac:_operatingHoursExtension", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.label { w.max_len("label", v, 1024)?; w.leaf("fac:label", v)?; }
if let Some(v) = &self.operating_all_year { w.leaf("fac:operatingAllYear", v)?; }
if let Some(v) = &self.url_link_address { w.leaf("fac:urlLinkAddress", v)?; }
match &self.overall_period {
Some(v) => { v.write(w, "fac:overallPeriod", "", "")?; }
None => return Err(w.missing("fac:overallPeriod")),
}
if let Some(v) = &self.operating_hours_specification_extension { w.extension("fac:_operatingHoursSpecificationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OperatingHoursTable {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub version_time: Option<DateTime>,
pub information_manager: Option<Box<com::InternationalIdentifier>>,
pub operating_hours_specification: Vec<OperatingHoursSpecification>,
pub operating_hours_table_extension: Option<Box<Extension>>,
}
impl OperatingHoursTable {
const FIELDS: &'static [u32] = &[0x80949, 0x80c4e, 0x80884, 0x809c7, 0x8052d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80148);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x80c4e => { let v = r.date_time()?; r.set(&mut e1, v, 3150); }
0x80884 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e2, v.map(Box::new), 2180); }
0x809c7 => { let v = Some(OperatingHoursSpecification::read(r)?); e3.extend(v); }
0x8052d => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1325); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 3150);
let v = Self {
id: a0,
version: a1,
name: e0,
version_time: e1,
information_manager: e2,
operating_hours_specification: e3,
operating_hours_table_extension: e4,
};
r.close();
Ok(v)
}
}
impl OperatingHoursTable {
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)?; }
match &self.version_time {
Some(v) => { w.leaf("fac:versionTime", v)?; }
None => return Err(w.missing("fac:versionTime")),
}
if let Some(v) = &self.information_manager { v.write(w, "fac:informationManager", "", "")?; }
w.count("fac:operatingHoursSpecification", self.operating_hours_specification.len(), 1, usize::MAX)?;
for v in &self.operating_hours_specification { v.write(w, "fac:operatingHoursSpecification", "", "")?; }
if let Some(v) = &self.operating_hours_table_extension { w.extension("fac:_operatingHoursTableExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OrganisationByReference {
pub general_time_validity: Option<Box<com::OverallPeriod>>,
pub organisation_extension: Option<Box<Extension>>,
pub organisation_reference: Option<Box<com::VersionedReference>>,
pub organisation_table_reference: Option<Box<com::VersionedReference>>,
pub organisation_by_reference_extension: Option<Box<Extension>>,
}
impl OrganisationByReference {
const FIELDS: &'static [u32] = &[0x8083f, 0x80537, 0x809dc, 0x809df, 0x80536];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80153);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x8083f => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e0, v.map(Box::new), 2111); }
0x80537 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1335); }
0x809dc => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e2, v.map(Box::new), 2524); }
0x809df => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e3, v.map(Box::new), 2527); }
0x80536 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1334); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2524);
let v = Self {
general_time_validity: e0,
organisation_extension: e1,
organisation_reference: e2,
organisation_table_reference: e3,
organisation_by_reference_extension: e4,
};
r.close();
Ok(v)
}
}
impl OrganisationByReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.general_time_validity { v.write(w, "fac:generalTimeValidity", "", "")?; }
if let Some(v) = &self.organisation_extension { w.extension("fac:_organisationExtension", v)?; }
match &self.organisation_reference {
Some(v) => { v.write(w, "fac:organisationReference", "", " targetClass=\"fac:OrganisationSpecification\"")?; }
None => return Err(w.missing("fac:organisationReference")),
}
if let Some(v) = &self.organisation_table_reference { v.write(w, "fac:organisationTableReference", "", " targetClass=\"fac:OrganisationTable\"")?; }
if let Some(v) = &self.organisation_by_reference_extension { w.extension("fac:_organisationByReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OrganisationPublication {
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 organisation_table: Vec<OrganisationTable>,
pub organisation_publication_extension: Option<Box<Extension>>,
}
impl OrganisationPublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x80857, 0x809de, 0x80538];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80154);
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); }
0x80857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x809de => { let v = Some(OrganisationTable::read(r)?); e6.extend(v); }
0x80538 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1336); }
_ => 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,
organisation_table: e6,
organisation_publication_extension: e7,
};
r.close();
Ok(v)
}
}
impl OrganisationPublication {
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, "fac:headerInformation", "", "")?; }
w.count("fac:organisationTable", self.organisation_table.len(), 1, usize::MAX)?;
for v in &self.organisation_table { v.write(w, "fac:organisationTable", "", "")?; }
if let Some(v) = &self.organisation_publication_extension { w.extension("fac:_organisationPublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OrganisationSpecification {
pub id: Option<String>,
pub version: Option<String>,
pub general_time_validity: Option<Box<com::OverallPeriod>>,
pub organisation_extension: Option<Box<Extension>>,
pub last_updated: Option<DateTime>,
pub name: Option<MultilingualString>,
pub external_code: Option<String>,
pub legal_name: Option<MultilingualString>,
pub description: Option<MultilingualString>,
pub link_to_general_information: Option<com::Url>,
pub link_to_logo: Option<com::Url>,
pub link_to_webform: Option<com::Url>,
pub available24hours: Option<com::Boolean>,
pub responsibility: Vec<MultilingualString>,
pub publishing_agreement: Option<com::Boolean>,
pub r#type: Option<OrganisationTypeEnum>,
pub national_organisation_number: Option<String>,
pub national_register: Option<String>,
pub vat_identification_number: Option<String>,
pub organisation_unit: Vec<OrganisationUnit>,
pub sub_organisation: Vec<Organisation>,
pub organisation_specification_extension: Option<Box<Extension>>,
}
impl OrganisationSpecification {
const FIELDS: &'static [u32] = &[0x8083f, 0x80537, 0x808ba, 0x80949, 0x80801, 0x808c3, 0x80777, 0x808d6, 0x808d7, 0x808d8, 0x806dd, 0x80aed, 0x80a95, 0x80bfe, 0x80950, 0x80951, 0x80c2e, 0x809e0, 0x80b89, 0x80539];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80155);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = Vec::new();
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = None;
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = Vec::new();
let mut e19 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x8083f => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e0, v.map(Box::new), 2111); }
0x80537 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1335); }
0x808ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x80949 => { let v = r.multilingual()?; r.set(&mut e3, v, 2377); }
0x80801 => { let v = r.string()?; r.set(&mut e4, v, 2049); }
0x808c3 => { let v = r.multilingual()?; r.set(&mut e5, v, 2243); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e6, v, 1911); }
0x808d6 => { let v = r.string()?; r.set(&mut e7, v, 2262); }
0x808d7 => { let v = r.string()?; r.set(&mut e8, v, 2263); }
0x808d8 => { let v = r.string()?; r.set(&mut e9, v, 2264); }
0x806dd => { let v = r.value::<bool>()?; r.set(&mut e10, v, 1757); }
0x80aed => { let v = r.multilingual()?; e11.extend(v); }
0x80a95 => { let v = r.value::<bool>()?; r.set(&mut e12, v, 2709); }
0x80bfe => { let v = r.enumeration::<OrganisationTypeEnum>()?; r.set(&mut e13, v, 3070); }
0x80950 => { let v = r.string()?; r.set(&mut e14, v, 2384); }
0x80951 => { let v = r.string()?; r.set(&mut e15, v, 2385); }
0x80c2e => { let v = r.string()?; r.set(&mut e16, v, 3118); }
0x809e0 => { let v = Some(OrganisationUnit::read(r)?); e17.extend(v); }
0x80b89 => { let v = Organisation::read(r)?; e18.extend(v); }
0x80539 => { let v = r.raw()?; r.set(&mut e19, v.map(Box::new), 1337); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e3, 2377);
let v = Self {
id: a0,
version: a1,
general_time_validity: e0,
organisation_extension: e1,
last_updated: e2,
name: e3,
external_code: e4,
legal_name: e5,
description: e6,
link_to_general_information: e7,
link_to_logo: e8,
link_to_webform: e9,
available24hours: e10,
responsibility: e11,
publishing_agreement: e12,
r#type: e13,
national_organisation_number: e14,
national_register: e15,
vat_identification_number: e16,
organisation_unit: e17,
sub_organisation: e18,
organisation_specification_extension: e19,
};
r.close();
Ok(v)
}
}
impl OrganisationSpecification {
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.general_time_validity { v.write(w, "fac:generalTimeValidity", "", "")?; }
if let Some(v) = &self.organisation_extension { w.extension("fac:_organisationExtension", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
match &self.name {
Some(v) => { w.multilingual("fac:name", v)?; }
None => return Err(w.missing("fac:name")),
}
if let Some(v) = &self.external_code { w.max_len("externalCode", v, 1024)?; w.leaf("fac:externalCode", v)?; }
if let Some(v) = &self.legal_name { w.multilingual("fac:legalName", v)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
if let Some(v) = &self.link_to_general_information { w.leaf("fac:linkToGeneralInformation", v)?; }
if let Some(v) = &self.link_to_logo { w.leaf("fac:linkToLogo", v)?; }
if let Some(v) = &self.link_to_webform { w.leaf("fac:linkToWebform", v)?; }
if let Some(v) = &self.available24hours { w.leaf("fac:available24hours", v)?; }
for v in &self.responsibility { w.multilingual("fac:responsibility", v)?; }
if let Some(v) = &self.publishing_agreement { w.leaf("fac:publishingAgreement", v)?; }
if let Some(v) = &self.r#type { w.enumeration("fac:type", v.literal())?; }
if let Some(v) = &self.national_organisation_number { w.max_len("nationalOrganisationNumber", v, 1024)?; w.leaf("fac:nationalOrganisationNumber", v)?; }
if let Some(v) = &self.national_register { w.max_len("nationalRegister", v, 1024)?; w.leaf("fac:nationalRegister", v)?; }
if let Some(v) = &self.vat_identification_number { w.max_len("vatIdentificationNumber", v, 1024)?; w.leaf("fac:vatIdentificationNumber", v)?; }
w.count("fac:organisationUnit", self.organisation_unit.len(), 1, usize::MAX)?;
for v in &self.organisation_unit { v.write(w, "fac:organisationUnit", "", "")?; }
for v in &self.sub_organisation { v.write(w, "fac:subOrganisation")?; }
if let Some(v) = &self.organisation_specification_extension { w.extension("fac:_organisationSpecificationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OrganisationTable {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub version_time: Option<DateTime>,
pub information_manager: Option<Box<com::InternationalIdentifier>>,
pub organisation_specification: Vec<OrganisationSpecification>,
pub organisation_table_extension: Option<Box<Extension>>,
}
impl OrganisationTable {
const FIELDS: &'static [u32] = &[0x80949, 0x80c4e, 0x80884, 0x809dd, 0x8053a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80156);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x80c4e => { let v = r.date_time()?; r.set(&mut e1, v, 3150); }
0x80884 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e2, v.map(Box::new), 2180); }
0x809dd => { let v = Some(OrganisationSpecification::read(r)?); e3.extend(v); }
0x8053a => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1338); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 3150);
let v = Self {
id: a0,
version: a1,
name: e0,
version_time: e1,
information_manager: e2,
organisation_specification: e3,
organisation_table_extension: e4,
};
r.close();
Ok(v)
}
}
impl OrganisationTable {
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)?; }
match &self.version_time {
Some(v) => { w.leaf("fac:versionTime", v)?; }
None => return Err(w.missing("fac:versionTime")),
}
if let Some(v) = &self.information_manager { v.write(w, "fac:informationManager", "", "")?; }
w.count("fac:organisationSpecification", self.organisation_specification.len(), 1, usize::MAX)?;
for v in &self.organisation_specification { v.write(w, "fac:organisationSpecification", "", "")?; }
if let Some(v) = &self.organisation_table_extension { w.extension("fac:_organisationTableExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OrganisationUnit {
pub name: Option<MultilingualString>,
pub function: Vec<MultilingualString>,
pub location_reference: Option<loc::LocationReference>,
pub contact_information: Vec<AnyContactInformation>,
pub operating_hours: Option<OperatingHours>,
pub organisation_unit_extension: Option<Box<Extension>>,
}
impl OrganisationUnit {
const FIELDS: &'static [u32] = &[0x80949, 0x80836, 0x808e8, 0x80739, 0x809c5, 0x8053b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80157);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x80836 => { let v = r.multilingual()?; e1.extend(v); }
0x808e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e2, v, 2280); }
0x80739 => { let v = AnyContactInformation::read(r)?; e3.extend(v); }
0x809c5 => { let v = OperatingHours::read(r)?; r.set(&mut e4, v, 2501); }
0x8053b => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1339); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
name: e0,
function: e1,
location_reference: e2,
contact_information: e3,
operating_hours: e4,
organisation_unit_extension: e5,
};
r.close();
Ok(v)
}
}
impl OrganisationUnit {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.name { w.multilingual("fac:name", v)?; }
for v in &self.function { w.multilingual("fac:function", v)?; }
if let Some(v) = &self.location_reference { v.write(w, "fac:locationReference")?; }
for v in &self.contact_information { v.write(w, "fac:contactInformation")?; }
if let Some(v) = &self.operating_hours { v.write(w, "fac:operatingHours")?; }
if let Some(v) = &self.organisation_unit_extension { w.extension("fac:_organisationUnitExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PaymentMethod {
pub payment_means: Vec<MeansOfPaymentEnum>,
pub payment_mode: Vec<PaymentTimingEnum>,
pub brands_accepted_text: Vec<BrandsAcceptedText>,
pub brands_accepted_code_list: Vec<BrandsAcceptedCodeList>,
pub payment_method_extension: Option<Box<Extension>>,
}
impl PaymentMethod {
const FIELDS: &'static [u32] = &[0x80a12, 0x80a14, 0x80701, 0x806ff, 0x80549];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80165);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = Vec::new();
let mut e2 = Vec::new();
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80a12 => { let v = r.enumeration::<MeansOfPaymentEnum>()?; e0.extend(v); }
0x80a14 => { let v = r.enumeration::<PaymentTimingEnum>()?; e1.extend(v); }
0x80701 => { let v = Some(BrandsAcceptedText::read(r)?); e2.extend(v); }
0x806ff => { let v = Some(BrandsAcceptedCodeList::read(r)?); e3.extend(v); }
0x80549 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1353); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
payment_means: e0,
payment_mode: e1,
brands_accepted_text: e2,
brands_accepted_code_list: e3,
payment_method_extension: e4,
};
r.close();
Ok(v)
}
}
impl PaymentMethod {
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.payment_means { w.enumeration("fac:paymentMeans", v.literal())?; }
for v in &self.payment_mode { w.enumeration("fac:paymentMode", v.literal())?; }
for v in &self.brands_accepted_text { v.write(w, "fac:brandsAcceptedText", "", "")?; }
for v in &self.brands_accepted_code_list { v.write(w, "fac:brandsAcceptedCodeList", "", "")?; }
if let Some(v) = &self.payment_method_extension { w.extension("fac:_paymentMethodExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Qualification {
pub with_reservation: Option<com::Boolean>,
pub propulsion_energy_type: Vec<EnergySourceEnum>,
pub no_fee_to_use: Option<com::Boolean>,
pub with_membership: Option<com::Boolean>,
pub membership_name: Vec<MultilingualString>,
pub member_of_other_rate_table: Option<com::Boolean>,
pub rate_table_member: Vec<com::VersionedReference>,
pub active_assigned_right: Option<String>,
pub payment_method: Vec<PaymentMethod>,
pub vehicle_characteristics: Vec<com::VehicleCharacteristics>,
pub user_qualification: Vec<UserQualification>,
pub qualification_extension: Option<Box<Extension>>,
}
impl Qualification {
const FIELDS: &'static [u32] = &[0x80c7e, 0x80a85, 0x8095c, 0x80c7d, 0x80929, 0x80928, 0x80aac, 0x80684, 0x80a13, 0x80c30, 0x80c1d, 0x80582];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8019f);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = None;
let mut e6 = Vec::new();
let mut e7 = None;
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = Vec::new();
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80c7e => { let v = r.value::<bool>()?; r.set(&mut e0, v, 3198); }
0x80a85 => { let v = r.enumeration::<EnergySourceEnum>()?; e1.extend(v); }
0x8095c => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2396); }
0x80c7d => { let v = r.value::<bool>()?; r.set(&mut e3, v, 3197); }
0x80929 => { let v = r.multilingual()?; e4.extend(v); }
0x80928 => { let v = r.value::<bool>()?; r.set(&mut e5, v, 2344); }
0x80aac => { let v = Some(com::VersionedReference::read(r)?); e6.extend(v); }
0x80684 => { let v = r.string()?; r.set(&mut e7, v, 1668); }
0x80a13 => { let v = Some(PaymentMethod::read(r)?); e8.extend(v); }
0x80c30 => { let v = Some(com::VehicleCharacteristics::read(r)?); e9.extend(v); }
0x80c1d => { let v = Some(UserQualification::read(r)?); e10.extend(v); }
0x80582 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1410); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
with_reservation: e0,
propulsion_energy_type: e1,
no_fee_to_use: e2,
with_membership: e3,
membership_name: e4,
member_of_other_rate_table: e5,
rate_table_member: e6,
active_assigned_right: e7,
payment_method: e8,
vehicle_characteristics: e9,
user_qualification: e10,
qualification_extension: e11,
};
r.close();
Ok(v)
}
}
impl Qualification {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.with_reservation { w.leaf("fac:withReservation", v)?; }
for v in &self.propulsion_energy_type { w.enumeration("fac:propulsionEnergyType", v.literal())?; }
if let Some(v) = &self.no_fee_to_use { w.leaf("fac:noFeeToUse", v)?; }
if let Some(v) = &self.with_membership { w.leaf("fac:withMembership", v)?; }
for v in &self.membership_name { w.multilingual("fac:membershipName", v)?; }
if let Some(v) = &self.member_of_other_rate_table { w.leaf("fac:memberOfOtherRateTable", v)?; }
for v in &self.rate_table_member { v.write(w, "fac:rateTableMember", "", " targetClass=\"fac:RateTable\"")?; }
if let Some(v) = &self.active_assigned_right { w.max_len("activeAssignedRight", v, 1024)?; w.leaf("fac:activeAssignedRight", v)?; }
for v in &self.payment_method { v.write(w, "fac:paymentMethod", "", "")?; }
for v in &self.vehicle_characteristics { v.write(w, "fac:vehicleCharacteristics", "", "")?; }
for v in &self.user_qualification { v.write(w, "fac:userQualification", "", "")?; }
if let Some(v) = &self.qualification_extension { w.extension("fac:_qualificationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RateDiscount {
pub discount_rate: Option<com::Percentage>,
pub fixed_value: Option<Box<AmountInCurrency>>,
pub rate_discount_extension: Option<Box<Extension>>,
}
impl RateDiscount {
const FIELDS: &'static [u32] = &[0x80793, 0x80823, 0x80583];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801a0);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80793 => { let v = r.value::<f32>()?; r.set(&mut e0, v, 1939); }
0x80823 => { let v = Some(AmountInCurrency::read(r)?); r.set(&mut e1, v.map(Box::new), 2083); }
0x80583 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1411); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
discount_rate: e0,
fixed_value: e1,
rate_discount_extension: e2,
};
r.close();
Ok(v)
}
}
impl RateDiscount {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.discount_rate { w.leaf("fac:discountRate", v)?; }
if let Some(v) = &self.fixed_value { v.write(w, "fac:fixedValue", "", "")?; }
if let Some(v) = &self.rate_discount_extension { w.extension("fac:_rateDiscountExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RateEligibility {
pub priority: Option<com::Integer>,
pub combinable: Option<com::Boolean>,
pub rate_discount: Option<Box<RateDiscount>>,
pub eligibility: Option<Box<Eligibility>>,
pub right_specification: Vec<RightSpecification>,
pub rate_eligibility_extension: Option<Box<Extension>>,
}
impl RateEligibility {
const FIELDS: &'static [u32] = &[0x80a78, 0x80724, 0x80a9e, 0x807bd, 0x80af2, 0x80584];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801a1);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80a78 => { let v = r.value::<i64>()?; r.set(&mut e0, v, 2680); }
0x80724 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1828); }
0x80a9e => { let v = Some(RateDiscount::read(r)?); r.set(&mut e2, v.map(Box::new), 2718); }
0x807bd => { let v = Some(Eligibility::read(r)?); r.set(&mut e3, v.map(Box::new), 1981); }
0x80af2 => { let v = Some(RightSpecification::read(r)?); e4.extend(v); }
0x80584 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1412); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e3, 1981);
let v = Self {
priority: e0,
combinable: e1,
rate_discount: e2,
eligibility: e3,
right_specification: e4,
rate_eligibility_extension: e5,
};
r.close();
Ok(v)
}
}
impl RateEligibility {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.priority { w.leaf("fac:priority", v)?; }
if let Some(v) = &self.combinable { w.leaf("fac:combinable", v)?; }
if let Some(v) = &self.rate_discount { v.write(w, "fac:rateDiscount", "", "")?; }
match &self.eligibility {
Some(v) => { v.write(w, "fac:eligibility", "", "")?; }
None => return Err(w.missing("fac:eligibility")),
}
for v in &self.right_specification { v.write(w, "fac:rightSpecification", "", "")?; }
if let Some(v) = &self.rate_eligibility_extension { w.extension("fac:_rateEligibilityExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RateLine {
pub sequence: Option<com::Integer>,
pub rate_line_type: Option<RateLineTypeEnum>,
pub description: Option<MultilingualString>,
pub duration_start: Option<Time>,
pub duration_end: Option<Time>,
pub increment_period: Option<Duration>,
pub value: Option<AmountOfMoney>,
pub min_value: Option<AmountOfMoney>,
pub max_value: Option<AmountOfMoney>,
pub usage_condition: Option<RateUsageConditionsTypeEnum>,
pub surcharge: Vec<Surcharge>,
pub rate_line_tax: Vec<RateLineTax>,
pub rate_line_extension: Option<Box<Extension>>,
}
impl RateLine {
const FIELDS: &'static [u32] = &[0x80aa3, 0x80777, 0x807ac, 0x807ab, 0x80880, 0x80c2c, 0x80933, 0x80903, 0x80c17, 0x80b98, 0x80aa2, 0x80586];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801a2);
let a0 = r.req_attr_value::<i64>(2858)?;
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 = Vec::new();
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80aa3 => { let v = r.enumeration::<RateLineTypeEnum>()?; r.set(&mut e0, v, 2723); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e1, v, 1911); }
0x807ac => { let v = r.value::<Time>()?; r.set(&mut e2, v, 1964); }
0x807ab => { let v = r.value::<Time>()?; r.set(&mut e3, v, 1963); }
0x80880 => { let v = r.string()?; r.set(&mut e4, v, 2176); }
0x80c2c => { let v = r.value::<Decimal>()?; r.set(&mut e5, v, 3116); }
0x80933 => { let v = r.value::<Decimal>()?; r.set(&mut e6, v, 2355); }
0x80903 => { let v = r.value::<Decimal>()?; r.set(&mut e7, v, 2307); }
0x80c17 => { let v = r.enumeration::<RateUsageConditionsTypeEnum>()?; r.set(&mut e8, v, 3095); }
0x80b98 => { let v = Some(Surcharge::read(r)?); e9.extend(v); }
0x80aa2 => { let v = Some(RateLineTax::read(r)?); e10.extend(v); }
0x80586 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1414); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2723);
r.required(&e5, 3116);
let v = Self {
sequence: a0,
rate_line_type: e0,
description: e1,
duration_start: e2,
duration_end: e3,
increment_period: e4,
value: e5,
min_value: e6,
max_value: e7,
usage_condition: e8,
surcharge: e9,
rate_line_tax: e10,
rate_line_extension: e11,
};
r.close();
Ok(v)
}
}
impl RateLine {
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.sequence {
Some(v) => { w.attr_value("sequence", v)?; }
None => return Err(w.missing_attr("sequence")),
}
match &self.rate_line_type {
Some(v) => { w.enumeration("fac:rateLineType", v.literal())?; }
None => return Err(w.missing("fac:rateLineType")),
}
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
if let Some(v) = &self.duration_start { w.leaf("fac:durationStart", v)?; }
if let Some(v) = &self.duration_end { w.leaf("fac:durationEnd", v)?; }
if let Some(v) = &self.increment_period { w.pattern("incrementPeriod", v, Pattern::Duration)?; w.leaf("fac:incrementPeriod", v)?; }
match &self.value {
Some(v) => { w.digits("value", v, 8, 2)?; w.leaf("fac:value", v)?; }
None => return Err(w.missing("fac:value")),
}
if let Some(v) = &self.min_value { w.digits("minValue", v, 8, 2)?; w.leaf("fac:minValue", v)?; }
if let Some(v) = &self.max_value { w.digits("maxValue", v, 8, 2)?; w.leaf("fac:maxValue", v)?; }
if let Some(v) = &self.usage_condition { w.enumeration("fac:usageCondition", v.literal())?; }
for v in &self.surcharge { v.write(w, "fac:surcharge", "", "")?; }
for v in &self.rate_line_tax { v.write(w, "fac:rateLineTax", "", "")?; }
if let Some(v) = &self.rate_line_extension { w.extension("fac:_rateLineExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RateLineCollection {
pub collection_sequence: Option<com::Integer>,
pub applicable_currency: Option<CurrencyCode>,
pub min_value_collection: Option<AmountOfMoney>,
pub max_value_collection: Option<AmountOfMoney>,
pub valid_start: Option<DateTime>,
pub valid_end: Option<DateTime>,
pub min_time: Option<Duration>,
pub max_time: Option<Duration>,
pub reset_time: Option<Time>,
pub tax_included: Option<com::Boolean>,
pub tax_rate: Option<com::Percentage>,
pub tax_value: Option<AmountOfMoney>,
pub relative_times: Option<com::Boolean>,
pub rate_line: Vec<RateLine>,
pub rate_line_collection_extension: Option<Box<Extension>>,
}
impl RateLineCollection {
const FIELDS: &'static [u32] = &[0x806bf, 0x80934, 0x80904, 0x80c24, 0x80c22, 0x80932, 0x80902, 0x80ae5, 0x80ba1, 0x80ba2, 0x80ba3, 0x80ad6, 0x80aa0, 0x80585];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801a3);
let a0 = r.req_attr_value::<i64>(1825)?;
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = Vec::new();
let mut e13 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x806bf => { let v = r.string()?; r.set(&mut e0, v, 1727); }
0x80934 => { let v = r.value::<Decimal>()?; r.set(&mut e1, v, 2356); }
0x80904 => { let v = r.value::<Decimal>()?; r.set(&mut e2, v, 2308); }
0x80c24 => { let v = r.date_time()?; r.set(&mut e3, v, 3108); }
0x80c22 => { let v = r.date_time()?; r.set(&mut e4, v, 3106); }
0x80932 => { let v = r.string()?; r.set(&mut e5, v, 2354); }
0x80902 => { let v = r.string()?; r.set(&mut e6, v, 2306); }
0x80ae5 => { let v = r.value::<Time>()?; r.set(&mut e7, v, 2789); }
0x80ba1 => { let v = r.value::<bool>()?; r.set(&mut e8, v, 2977); }
0x80ba2 => { let v = r.value::<f32>()?; r.set(&mut e9, v, 2978); }
0x80ba3 => { let v = r.value::<Decimal>()?; r.set(&mut e10, v, 2979); }
0x80ad6 => { let v = r.value::<bool>()?; r.set(&mut e11, v, 2774); }
0x80aa0 => { let v = Some(RateLine::read(r)?); e12.extend(v); }
0x80585 => { let v = r.raw()?; r.set(&mut e13, v.map(Box::new), 1413); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
collection_sequence: a0,
applicable_currency: e0,
min_value_collection: e1,
max_value_collection: e2,
valid_start: e3,
valid_end: e4,
min_time: e5,
max_time: e6,
reset_time: e7,
tax_included: e8,
tax_rate: e9,
tax_value: e10,
relative_times: e11,
rate_line: e12,
rate_line_collection_extension: e13,
};
r.close();
Ok(v)
}
}
impl RateLineCollection {
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.collection_sequence {
Some(v) => { w.attr_value("collectionSequence", v)?; }
None => return Err(w.missing_attr("collectionSequence")),
}
if let Some(v) = &self.applicable_currency { w.max_len("applicableCurrency", v, 1024)?; w.pattern("applicableCurrency", v, Pattern::CurrencyCode)?; w.leaf("fac:applicableCurrency", v)?; }
if let Some(v) = &self.min_value_collection { w.digits("minValueCollection", v, 8, 2)?; w.leaf("fac:minValueCollection", v)?; }
if let Some(v) = &self.max_value_collection { w.digits("maxValueCollection", v, 8, 2)?; w.leaf("fac:maxValueCollection", v)?; }
if let Some(v) = &self.valid_start { w.leaf("fac:validStart", v)?; }
if let Some(v) = &self.valid_end { w.leaf("fac:validEnd", v)?; }
if let Some(v) = &self.min_time { w.pattern("minTime", v, Pattern::Duration)?; w.leaf("fac:minTime", v)?; }
if let Some(v) = &self.max_time { w.pattern("maxTime", v, Pattern::Duration)?; w.leaf("fac:maxTime", v)?; }
if let Some(v) = &self.reset_time { w.leaf("fac:resetTime", v)?; }
if let Some(v) = &self.tax_included { w.leaf("fac:taxIncluded", v)?; }
if let Some(v) = &self.tax_rate { w.leaf("fac:taxRate", v)?; }
if let Some(v) = &self.tax_value { w.digits("taxValue", v, 8, 2)?; w.leaf("fac:taxValue", v)?; }
if let Some(v) = &self.relative_times { w.leaf("fac:relativeTimes", v)?; }
w.count("fac:rateLine", self.rate_line.len(), 1, usize::MAX)?;
for v in &self.rate_line { v.write(w, "fac:rateLine", "", "")?; }
if let Some(v) = &self.rate_line_collection_extension { w.extension("fac:_rateLineCollectionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RateLineTax {
pub tax_value: Option<AmountOfMoney>,
pub tax_rate: Option<com::Percentage>,
pub tax_included: Option<com::Boolean>,
pub trigger: Option<MultilingualString>,
pub label_for_display: Option<MultilingualString>,
pub rate_line_tax_extension: Option<Box<Extension>>,
}
impl RateLineTax {
const FIELDS: &'static [u32] = &[0x80ba3, 0x80ba2, 0x80ba1, 0x80bf8, 0x808aa, 0x80587];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801a4);
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;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80ba3 => { let v = r.value::<Decimal>()?; r.set(&mut e0, v, 2979); }
0x80ba2 => { let v = r.value::<f32>()?; r.set(&mut e1, v, 2978); }
0x80ba1 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2977); }
0x80bf8 => { let v = r.multilingual()?; r.set(&mut e3, v, 3064); }
0x808aa => { let v = r.multilingual()?; r.set(&mut e4, v, 2218); }
0x80587 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1415); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2977);
let v = Self {
tax_value: e0,
tax_rate: e1,
tax_included: e2,
trigger: e3,
label_for_display: e4,
rate_line_tax_extension: e5,
};
r.close();
Ok(v)
}
}
impl RateLineTax {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.tax_value { w.digits("taxValue", v, 8, 2)?; w.leaf("fac:taxValue", v)?; }
if let Some(v) = &self.tax_rate { w.leaf("fac:taxRate", v)?; }
match &self.tax_included {
Some(v) => { w.leaf("fac:taxIncluded", v)?; }
None => return Err(w.missing("fac:taxIncluded")),
}
if let Some(v) = &self.trigger { w.multilingual("fac:trigger", v)?; }
if let Some(v) = &self.label_for_display { w.multilingual("fac:labelForDisplay", v)?; }
if let Some(v) = &self.rate_line_tax_extension { w.extension("fac:_rateLineTaxExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RateMatrix {
pub id: Option<String>,
pub version: Option<String>,
pub name: Option<MultilingualString>,
pub description: Option<MultilingualString>,
pub version_time: Option<DateTime>,
pub information_manager: Option<Box<com::InternationalIdentifier>>,
pub rate_table: Vec<RateTable>,
pub rate_matrix_extension: Option<Box<Extension>>,
}
impl RateMatrix {
const FIELDS: &'static [u32] = &[0x80949, 0x80777, 0x80c4e, 0x80884, 0x80aab, 0x80589];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801a5);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x80777 => { let v = r.multilingual()?; r.set(&mut e1, v, 1911); }
0x80c4e => { let v = r.date_time()?; r.set(&mut e2, v, 3150); }
0x80884 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2180); }
0x80aab => { let v = Some(RateTable::read(r)?); e4.extend(v); }
0x80589 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1417); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 3150);
let v = Self {
id: a0,
version: a1,
name: e0,
description: e1,
version_time: e2,
information_manager: e3,
rate_table: e4,
rate_matrix_extension: e5,
};
r.close();
Ok(v)
}
}
impl RateMatrix {
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)?; }
if let Some(v) = &self.description { w.multilingual("fac:description", v)?; }
match &self.version_time {
Some(v) => { w.leaf("fac:versionTime", v)?; }
None => return Err(w.missing("fac:versionTime")),
}
if let Some(v) = &self.information_manager { v.write(w, "fac:informationManager", "", "")?; }
w.count("fac:rateTable", self.rate_table.len(), 1, usize::MAX)?;
for v in &self.rate_table { v.write(w, "fac:rateTable", "", "")?; }
if let Some(v) = &self.rate_matrix_extension { w.extension("fac:_rateMatrixExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RateTable {
pub id: Option<String>,
pub version: Option<String>,
pub applicable_currency: Vec<CurrencyCode>,
pub payment_method: Option<Box<PaymentMethod>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub energy_pricing_policy: Option<Box<egi::EnergyPricingPolicy>>,
pub rates_extension: Option<Box<Extension>>,
pub last_updated: Option<DateTime>,
pub rate_table_name: Option<MultilingualString>,
pub active_times: Vec<Duration>,
pub availability: Option<RateAvailabilityTypeEnum>,
pub rate_responsible_party: Option<Box<com::VersionedReference>>,
pub rate_supersede_link: Option<Box<com::VersionedReference>>,
pub validation: Option<com::Boolean>,
pub rate_type: Option<RateTypeEnum>,
pub validity_start: Option<DateTime>,
pub validity_end: Option<DateTime>,
pub additional_information: Option<com::Url>,
pub rate_line_collection: Vec<AnyRateLineCollection>,
pub rate_eligibility: Option<Box<RateEligibility>>,
pub rate_table_extension: Option<Box<Extension>>,
}
impl RateTable {
const FIELDS: &'static [u32] = &[0x806bf, 0x80a13, 0x809f1, 0x807d4, 0x8058d, 0x808ba, 0x80aad, 0x80685, 0x806dc, 0x80aa9, 0x80aaa, 0x80c25, 0x80aaf, 0x80c29, 0x80c28, 0x80690, 0x80aa1, 0x80a9f, 0x8058b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801a7);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
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;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
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 = Vec::new();
let mut e17 = None;
let mut e18 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x806bf => { let v = r.string()?; e0.extend(v); }
0x80a13 => { let v = Some(PaymentMethod::read(r)?); r.set(&mut e1, v.map(Box::new), 2579); }
0x809f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x807d4 => { let v = Some(egi::EnergyPricingPolicy::read(r)?); r.set(&mut e3, v.map(Box::new), 2004); }
0x8058d => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1421); }
0x808ba => { let v = r.date_time()?; r.set(&mut e5, v, 2234); }
0x80aad => { let v = r.multilingual()?; r.set(&mut e6, v, 2733); }
0x80685 => { let v = r.string()?; e7.extend(v); }
0x806dc => { let v = r.enumeration::<RateAvailabilityTypeEnum>()?; r.set(&mut e8, v, 1756); }
0x80aa9 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e9, v.map(Box::new), 2729); }
0x80aaa => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e10, v.map(Box::new), 2730); }
0x80c25 => { let v = r.value::<bool>()?; r.set(&mut e11, v, 3109); }
0x80aaf => { let v = r.enumeration::<RateTypeEnum>()?; r.set(&mut e12, v, 2735); }
0x80c29 => { let v = r.date_time()?; r.set(&mut e13, v, 3113); }
0x80c28 => { let v = r.date_time()?; r.set(&mut e14, v, 3112); }
0x80690 => { let v = r.string()?; r.set(&mut e15, v, 1680); }
0x80aa1 => { let v = AnyRateLineCollection::read(r)?; e16.extend(v); }
0x80a9f => { let v = Some(RateEligibility::read(r)?); r.set(&mut e17, v.map(Box::new), 2719); }
0x8058b => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1419); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
id: a0,
version: a1,
applicable_currency: e0,
payment_method: e1,
overall_period: e2,
energy_pricing_policy: e3,
rates_extension: e4,
last_updated: e5,
rate_table_name: e6,
active_times: e7,
availability: e8,
rate_responsible_party: e9,
rate_supersede_link: e10,
validation: e11,
rate_type: e12,
validity_start: e13,
validity_end: e14,
additional_information: e15,
rate_line_collection: e16,
rate_eligibility: e17,
rate_table_extension: e18,
};
r.close();
Ok(v)
}
}
impl RateTable {
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")),
}
for v in &self.applicable_currency { w.max_len("applicableCurrency", v, 1024)?; w.pattern("applicableCurrency", v, Pattern::CurrencyCode)?; w.leaf("fac:applicableCurrency", v)?; }
if let Some(v) = &self.payment_method { v.write(w, "fac:paymentMethod", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "fac:overallPeriod", "", "")?; }
if let Some(v) = &self.energy_pricing_policy { v.write(w, "fac:energyPricingPolicy", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("fac:_ratesExtension", v)?; }
if let Some(v) = &self.last_updated { w.leaf("fac:lastUpdated", v)?; }
if let Some(v) = &self.rate_table_name { w.multilingual("fac:rateTableName", v)?; }
for v in &self.active_times { w.pattern("activeTimes", v, Pattern::Duration)?; w.leaf("fac:activeTimes", v)?; }
if let Some(v) = &self.availability { w.enumeration("fac:availability", v.literal())?; }
if let Some(v) = &self.rate_responsible_party { v.write(w, "fac:rateResponsibleParty", "", " targetClass=\"fac:Organisation\"")?; }
if let Some(v) = &self.rate_supersede_link { v.write(w, "fac:rateSupersedeLink", "", " targetClass=\"fac:RateTable\"")?; }
if let Some(v) = &self.validation { w.leaf("fac:validation", v)?; }
if let Some(v) = &self.rate_type { w.enumeration("fac:rateType", v.literal())?; }
if let Some(v) = &self.validity_start { w.leaf("fac:validityStart", v)?; }
if let Some(v) = &self.validity_end { w.leaf("fac:validityEnd", v)?; }
if let Some(v) = &self.additional_information { w.leaf("fac:additionalInformation", v)?; }
for v in &self.rate_line_collection { v.write(w, "fac:rateLineCollection")?; }
if let Some(v) = &self.rate_eligibility { v.write(w, "fac:rateEligibility", "", "")?; }
if let Some(v) = &self.rate_table_extension { w.extension("fac:_rateTableExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RatesByReference {
pub applicable_currency: Vec<CurrencyCode>,
pub payment_method: Option<Box<PaymentMethod>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub energy_pricing_policy: Option<Box<egi::EnergyPricingPolicy>>,
pub rates_extension: Option<Box<Extension>>,
pub rate_table_reference: Option<Box<com::VersionedReference>>,
pub rate_matrix_reference: Option<Box<com::VersionedReference>>,
pub rates_by_reference_extension: Option<Box<Extension>>,
}
impl RatesByReference {
const FIELDS: &'static [u32] = &[0x806bf, 0x80a13, 0x809f1, 0x807d4, 0x8058d, 0x80aae, 0x80aa5, 0x8058c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801aa);
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;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x806bf => { let v = r.string()?; e0.extend(v); }
0x80a13 => { let v = Some(PaymentMethod::read(r)?); r.set(&mut e1, v.map(Box::new), 2579); }
0x809f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x807d4 => { let v = Some(egi::EnergyPricingPolicy::read(r)?); r.set(&mut e3, v.map(Box::new), 2004); }
0x8058d => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1421); }
0x80aae => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e5, v.map(Box::new), 2734); }
0x80aa5 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e6, v.map(Box::new), 2725); }
0x8058c => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1420); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e5, 2734);
let v = Self {
applicable_currency: e0,
payment_method: e1,
overall_period: e2,
energy_pricing_policy: e3,
rates_extension: e4,
rate_table_reference: e5,
rate_matrix_reference: e6,
rates_by_reference_extension: e7,
};
r.close();
Ok(v)
}
}
impl RatesByReference {
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.applicable_currency { w.max_len("applicableCurrency", v, 1024)?; w.pattern("applicableCurrency", v, Pattern::CurrencyCode)?; w.leaf("fac:applicableCurrency", v)?; }
if let Some(v) = &self.payment_method { v.write(w, "fac:paymentMethod", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "fac:overallPeriod", "", "")?; }
if let Some(v) = &self.energy_pricing_policy { v.write(w, "fac:energyPricingPolicy", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("fac:_ratesExtension", v)?; }
match &self.rate_table_reference {
Some(v) => { v.write(w, "fac:rateTableReference", "", " targetClass=\"fac:RateTable\"")?; }
None => return Err(w.missing("fac:rateTableReference")),
}
if let Some(v) = &self.rate_matrix_reference { v.write(w, "fac:rateMatrixReference", "", " targetClass=\"fac:RateMatrix\"")?; }
if let Some(v) = &self.rates_by_reference_extension { w.extension("fac:_ratesByReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RatesPublication {
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 rate_matrix: Vec<RateMatrix>,
pub rates_publication_extension: Option<Box<Extension>>,
}
impl RatesPublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x80857, 0x80aa4, 0x8058e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801ab);
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); }
0x80857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x80aa4 => { let v = Some(RateMatrix::read(r)?); e6.extend(v); }
0x8058e => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1422); }
_ => 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,
rate_matrix: e6,
rates_publication_extension: e7,
};
r.close();
Ok(v)
}
}
impl RatesPublication {
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, "fac:headerInformation", "", "")?; }
w.count("fac:rateMatrix", self.rate_matrix.len(), 1, usize::MAX)?;
for v in &self.rate_matrix { v.write(w, "fac:rateMatrix", "", "")?; }
if let Some(v) = &self.rates_publication_extension { w.extension("fac:_ratesPublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RelativeTimeRates {
pub collection_sequence: Option<com::Integer>,
pub applicable_currency: Option<CurrencyCode>,
pub min_value_collection: Option<AmountOfMoney>,
pub max_value_collection: Option<AmountOfMoney>,
pub valid_start: Option<DateTime>,
pub valid_end: Option<DateTime>,
pub min_time: Option<Duration>,
pub max_time: Option<Duration>,
pub reset_time: Option<Time>,
pub tax_included: Option<com::Boolean>,
pub tax_rate: Option<com::Percentage>,
pub tax_value: Option<AmountOfMoney>,
pub relative_times: Option<com::Boolean>,
pub rate_line: Vec<RateLine>,
pub rate_line_collection_extension: Option<Box<Extension>>,
pub reference_time_start: Option<DateTime>,
pub reference_time_end: Option<DateTime>,
pub relative_time_rates_extension: Option<Box<Extension>>,
}
impl RelativeTimeRates {
const FIELDS: &'static [u32] = &[0x806bf, 0x80934, 0x80904, 0x80c24, 0x80c22, 0x80932, 0x80902, 0x80ae5, 0x80ba1, 0x80ba2, 0x80ba3, 0x80ad6, 0x80aa0, 0x80585, 0x80abd, 0x80abc, 0x80598];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801b6);
let a0 = r.req_attr_value::<i64>(1825)?;
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = Vec::new();
let mut e13 = None;
let mut e14 = None;
let mut e15 = None;
let mut e16 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x806bf => { let v = r.string()?; r.set(&mut e0, v, 1727); }
0x80934 => { let v = r.value::<Decimal>()?; r.set(&mut e1, v, 2356); }
0x80904 => { let v = r.value::<Decimal>()?; r.set(&mut e2, v, 2308); }
0x80c24 => { let v = r.date_time()?; r.set(&mut e3, v, 3108); }
0x80c22 => { let v = r.date_time()?; r.set(&mut e4, v, 3106); }
0x80932 => { let v = r.string()?; r.set(&mut e5, v, 2354); }
0x80902 => { let v = r.string()?; r.set(&mut e6, v, 2306); }
0x80ae5 => { let v = r.value::<Time>()?; r.set(&mut e7, v, 2789); }
0x80ba1 => { let v = r.value::<bool>()?; r.set(&mut e8, v, 2977); }
0x80ba2 => { let v = r.value::<f32>()?; r.set(&mut e9, v, 2978); }
0x80ba3 => { let v = r.value::<Decimal>()?; r.set(&mut e10, v, 2979); }
0x80ad6 => { let v = r.value::<bool>()?; r.set(&mut e11, v, 2774); }
0x80aa0 => { let v = Some(RateLine::read(r)?); e12.extend(v); }
0x80585 => { let v = r.raw()?; r.set(&mut e13, v.map(Box::new), 1413); }
0x80abd => { let v = r.date_time()?; r.set(&mut e14, v, 2749); }
0x80abc => { let v = r.date_time()?; r.set(&mut e15, v, 2748); }
0x80598 => { let v = r.raw()?; r.set(&mut e16, v.map(Box::new), 1432); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
collection_sequence: a0,
applicable_currency: e0,
min_value_collection: e1,
max_value_collection: e2,
valid_start: e3,
valid_end: e4,
min_time: e5,
max_time: e6,
reset_time: e7,
tax_included: e8,
tax_rate: e9,
tax_value: e10,
relative_times: e11,
rate_line: e12,
rate_line_collection_extension: e13,
reference_time_start: e14,
reference_time_end: e15,
relative_time_rates_extension: e16,
};
r.close();
Ok(v)
}
}
impl RelativeTimeRates {
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.collection_sequence {
Some(v) => { w.attr_value("collectionSequence", v)?; }
None => return Err(w.missing_attr("collectionSequence")),
}
if let Some(v) = &self.applicable_currency { w.max_len("applicableCurrency", v, 1024)?; w.pattern("applicableCurrency", v, Pattern::CurrencyCode)?; w.leaf("fac:applicableCurrency", v)?; }
if let Some(v) = &self.min_value_collection { w.digits("minValueCollection", v, 8, 2)?; w.leaf("fac:minValueCollection", v)?; }
if let Some(v) = &self.max_value_collection { w.digits("maxValueCollection", v, 8, 2)?; w.leaf("fac:maxValueCollection", v)?; }
if let Some(v) = &self.valid_start { w.leaf("fac:validStart", v)?; }
if let Some(v) = &self.valid_end { w.leaf("fac:validEnd", v)?; }
if let Some(v) = &self.min_time { w.pattern("minTime", v, Pattern::Duration)?; w.leaf("fac:minTime", v)?; }
if let Some(v) = &self.max_time { w.pattern("maxTime", v, Pattern::Duration)?; w.leaf("fac:maxTime", v)?; }
if let Some(v) = &self.reset_time { w.leaf("fac:resetTime", v)?; }
if let Some(v) = &self.tax_included { w.leaf("fac:taxIncluded", v)?; }
if let Some(v) = &self.tax_rate { w.leaf("fac:taxRate", v)?; }
if let Some(v) = &self.tax_value { w.digits("taxValue", v, 8, 2)?; w.leaf("fac:taxValue", v)?; }
if let Some(v) = &self.relative_times { w.leaf("fac:relativeTimes", v)?; }
w.count("fac:rateLine", self.rate_line.len(), 1, usize::MAX)?;
for v in &self.rate_line { v.write(w, "fac:rateLine", "", "")?; }
if let Some(v) = &self.rate_line_collection_extension { w.extension("fac:_rateLineCollectionExtension", v)?; }
if let Some(v) = &self.reference_time_start { w.leaf("fac:referenceTimeStart", v)?; }
if let Some(v) = &self.reference_time_end { w.leaf("fac:referenceTimeEnd", v)?; }
if let Some(v) = &self.relative_time_rates_extension { w.extension("fac:_relativeTimeRatesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RightSpecification {
pub r#type: Option<RightTypeEnum>,
pub description: Vec<MultilingualString>,
pub expiry: Option<DateTime>,
pub financial_reference: Option<String>,
pub issuer: Option<Box<com::VersionedReference>>,
pub no_fee_to_use: Option<com::Boolean>,
pub credential: Vec<AnyCredential>,
pub validity: Option<Box<com::Validity>>,
pub right_specification_extension: Option<Box<Extension>>,
}
impl RightSpecification {
const FIELDS: &'static [u32] = &[0x80bfe, 0x80777, 0x807fc, 0x80820, 0x8089e, 0x8095c, 0x8074e, 0x80c26, 0x805a1];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801c0);
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 = None;
let mut e6 = Vec::new();
let mut e7 = None;
let mut e8 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80bfe => { let v = r.enumeration::<RightTypeEnum>()?; r.set(&mut e0, v, 3070); }
0x80777 => { let v = r.multilingual()?; e1.extend(v); }
0x807fc => { let v = r.date_time()?; r.set(&mut e2, v, 2044); }
0x80820 => { let v = r.string()?; r.set(&mut e3, v, 2080); }
0x8089e => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e4, v.map(Box::new), 2206); }
0x8095c => { let v = r.value::<bool>()?; r.set(&mut e5, v, 2396); }
0x8074e => { let v = AnyCredential::read(r)?; e6.extend(v); }
0x80c26 => { let v = Some(com::Validity::read(r)?); r.set(&mut e7, v.map(Box::new), 3110); }
0x805a1 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1441); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
r#type: e0,
description: e1,
expiry: e2,
financial_reference: e3,
issuer: e4,
no_fee_to_use: e5,
credential: e6,
validity: e7,
right_specification_extension: e8,
};
r.close();
Ok(v)
}
}
impl RightSpecification {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.r#type { w.enumeration("fac:type", v.literal())?; }
for v in &self.description { w.multilingual("fac:description", v)?; }
if let Some(v) = &self.expiry { w.leaf("fac:expiry", v)?; }
if let Some(v) = &self.financial_reference { w.max_len("financialReference", v, 1024)?; w.leaf("fac:financialReference", v)?; }
if let Some(v) = &self.issuer { v.write(w, "fac:issuer", "", " targetClass=\"fac:Organisation\"")?; }
if let Some(v) = &self.no_fee_to_use { w.leaf("fac:noFeeToUse", v)?; }
for v in &self.credential { v.write(w, "fac:credential")?; }
if let Some(v) = &self.validity { v.write(w, "fac:validity", "", "")?; }
if let Some(v) = &self.right_specification_extension { w.extension("fac:_rightSpecificationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementalEquipment {
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<AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<Image>,
pub operating_hours: Option<OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<Organisation>,
pub operator: Option<Organisation>,
pub associated_facility: Vec<AnyAssociatedFacility>,
pub rates: Option<Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub availability: Option<AvailabilityEnum>,
pub quantity: Option<com::NonNegativeInteger>,
pub regularly_cleaned: Option<com::Boolean>,
pub applicable_for_user: Vec<UserTypeEnum>,
pub supplemental_facility_extension: Option<Box<Extension>>,
pub equipment_type: Option<EquipmentTypeEnum>,
pub supplemental_equipment_extension: Option<Box<Extension>>,
}
impl SupplementalEquipment {
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, 0x807ea, 0x805db];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801fc);
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::<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(Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = 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 = Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(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::<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::<UserTypeEnum>()?; e22.extend(v); }
0x805dc => { let v = r.raw()?; r.set(&mut e23, v.map(Box::new), 1500); }
0x807ea => { let v = r.enumeration::<EquipmentTypeEnum>()?; r.set(&mut e24, v, 2026); }
0x805db => { let v = r.raw()?; r.set(&mut e25, v.map(Box::new), 1499); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e24, 2026);
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,
equipment_type: e24,
supplemental_equipment_extension: e25,
};
r.close();
Ok(v)
}
}
impl SupplementalEquipment {
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.equipment_type {
Some(v) => { w.enumeration("fac:equipmentType", v.literal())?; }
None => return Err(w.missing("fac:equipmentType")),
}
if let Some(v) = &self.supplemental_equipment_extension { w.extension("fac:_supplementalEquipmentExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementalFacilityStatus {
pub reference: Option<Box<com::VersionedReference>>,
pub last_updated: Option<DateTime>,
pub opening_status: Option<OpeningStatusEnum>,
pub regular_operating_hours_in_force: Option<com::Boolean>,
pub status_description: Option<MultilingualString>,
pub new_operating_hours: Option<OperatingHours>,
pub new_rates: Option<Rates>,
pub fault: Option<com::AnyFault>,
pub facility_object_status_extension: Option<Box<Extension>>,
pub quantity_override: Option<com::NonNegativeInteger>,
pub number_of_subitems_override: Option<com::NonNegativeInteger>,
pub vacant_subitems: Option<com::NonNegativeInteger>,
pub equipment_operation_status: Option<OperationStatusEnum>,
pub supplemental_facility_status_extension: Option<Box<Extension>>,
}
impl SupplementalFacilityStatus {
const FIELDS: &'static [u32] = &[0x80aba, 0x808ba, 0x809a8, 0x80aca, 0x80b77, 0x80958, 0x80959, 0x8080d, 0x80498, 0x80a99, 0x80985, 0x80c21, 0x807e8, 0x805dd];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801fe);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
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::<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 = OperatingHours::read(r)?; r.set(&mut e5, v, 2392); }
0x80959 => { let v = 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); }
0x80a99 => { let v = r.value::<u64>()?; r.set(&mut e9, v, 2713); }
0x80985 => { let v = r.value::<u64>()?; r.set(&mut e10, v, 2437); }
0x80c21 => { let v = r.value::<u64>()?; r.set(&mut e11, v, 3105); }
0x807e8 => { let v = r.enumeration::<OperationStatusEnum>()?; r.set(&mut e12, v, 2024); }
0x805dd => { let v = r.raw()?; r.set(&mut e13, v.map(Box::new), 1501); }
_ => 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,
quantity_override: e9,
number_of_subitems_override: e10,
vacant_subitems: e11,
equipment_operation_status: e12,
supplemental_facility_status_extension: e13,
};
r.close();
Ok(v)
}
}
impl SupplementalFacilityStatus {
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)?; }
if let Some(v) = &self.quantity_override { w.leaf("fac:quantityOverride", v)?; }
if let Some(v) = &self.number_of_subitems_override { w.leaf("fac:numberOfSubitemsOverride", v)?; }
if let Some(v) = &self.vacant_subitems { w.leaf("fac:vacantSubitems", v)?; }
if let Some(v) = &self.equipment_operation_status { w.enumeration("fac:equipmentOperationStatus", v.literal())?; }
if let Some(v) = &self.supplemental_facility_status_extension { w.extension("fac:_supplementalFacilityStatusExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementalServiceFacility {
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<AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub information_website: Vec<com::UrlLink>,
pub photo_url: Vec<com::UrlLink>,
pub photo: Vec<Image>,
pub operating_hours: Option<OperatingHours>,
pub location_reference: Option<loc::LocationReference>,
pub owner: Option<Organisation>,
pub operator: Option<Organisation>,
pub associated_facility: Vec<AnyAssociatedFacility>,
pub rates: Option<Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<Dimension>>,
pub facility_object_extension: Option<Box<Extension>>,
pub availability: Option<AvailabilityEnum>,
pub quantity: Option<com::NonNegativeInteger>,
pub regularly_cleaned: Option<com::Boolean>,
pub applicable_for_user: Vec<UserTypeEnum>,
pub supplemental_facility_extension: Option<Box<Extension>>,
pub service_facility_type: Option<ServiceFacilityTypeEnum>,
pub number_of_subitems: Option<com::NonNegativeInteger>,
pub distance_from_origin_facility: Option<com::MetresAsNonNegativeInteger>,
pub supplemental_service_facility_extension: Option<Box<Extension>>,
}
impl SupplementalServiceFacility {
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, 0x80b33, 0x80984, 0x807a1, 0x805de];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x801ff);
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;
let mut e26 = None;
let mut e27 = 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::<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(Image::read(r)?); e9.extend(v); }
0x809c5 => { let v = 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 = Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x809d2 => { let v = Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x806d3 => { let v = AnyAssociatedFacility::read(r)?; e14.extend(v); }
0x80ab0 => { let v = Rates::read(r)?; r.set(&mut e15, v, 2736); }
0x806c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e16.extend(v); }
0x80786 => { let v = Some(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::<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::<UserTypeEnum>()?; e22.extend(v); }
0x805dc => { let v = r.raw()?; r.set(&mut e23, v.map(Box::new), 1500); }
0x80b33 => { let v = r.enumeration::<ServiceFacilityTypeEnum>()?; r.set(&mut e24, v, 2867); }
0x80984 => { let v = r.value::<u64>()?; r.set(&mut e25, v, 2436); }
0x807a1 => { let v = r.value::<u64>()?; r.set(&mut e26, v, 1953); }
0x805de => { let v = r.raw()?; r.set(&mut e27, v.map(Box::new), 1502); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e24, 2867);
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,
service_facility_type: e24,
number_of_subitems: e25,
distance_from_origin_facility: e26,
supplemental_service_facility_extension: e27,
};
r.close();
Ok(v)
}
}
impl SupplementalServiceFacility {
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.service_facility_type {
Some(v) => { w.enumeration("fac:serviceFacilityType", v.literal())?; }
None => return Err(w.missing("fac:serviceFacilityType")),
}
if let Some(v) = &self.number_of_subitems { w.leaf("fac:numberOfSubitems", v)?; }
if let Some(v) = &self.distance_from_origin_facility { w.leaf("fac:distanceFromOriginFacility", v)?; }
if let Some(v) = &self.supplemental_service_facility_extension { w.extension("fac:_supplementalServiceFacilityExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Surcharge {
pub surcharge_type: Option<SurchargeTypeEnum>,
pub value: Option<AmountOfMoney>,
pub rate: Option<com::Percentage>,
pub trigger: Option<MultilingualString>,
pub refund: Option<RefundTypeEnum>,
pub label_for_display: Option<MultilingualString>,
pub surcharge_extension: Option<Box<Extension>>,
}
impl Surcharge {
const FIELDS: &'static [u32] = &[0x80b99, 0x80c2c, 0x80a9d, 0x80bf8, 0x80ac8, 0x808aa, 0x805e6];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80208);
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;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80b99 => { let v = r.enumeration::<SurchargeTypeEnum>()?; r.set(&mut e0, v, 2969); }
0x80c2c => { let v = r.value::<Decimal>()?; r.set(&mut e1, v, 3116); }
0x80a9d => { let v = r.value::<f32>()?; r.set(&mut e2, v, 2717); }
0x80bf8 => { let v = r.multilingual()?; r.set(&mut e3, v, 3064); }
0x80ac8 => { let v = r.enumeration::<RefundTypeEnum>()?; r.set(&mut e4, v, 2760); }
0x808aa => { let v = r.multilingual()?; r.set(&mut e5, v, 2218); }
0x805e6 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1510); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2969);
let v = Self {
surcharge_type: e0,
value: e1,
rate: e2,
trigger: e3,
refund: e4,
label_for_display: e5,
surcharge_extension: e6,
};
r.close();
Ok(v)
}
}
impl Surcharge {
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.surcharge_type {
Some(v) => { w.enumeration("fac:surchargeType", v.literal())?; }
None => return Err(w.missing("fac:surchargeType")),
}
if let Some(v) = &self.value { w.digits("value", v, 8, 2)?; w.leaf("fac:value", v)?; }
if let Some(v) = &self.rate { w.leaf("fac:rate", v)?; }
if let Some(v) = &self.trigger { w.multilingual("fac:trigger", v)?; }
if let Some(v) = &self.refund { w.enumeration("fac:refund", v.literal())?; }
if let Some(v) = &self.label_for_display { w.multilingual("fac:labelForDisplay", v)?; }
if let Some(v) = &self.surcharge_extension { w.extension("fac:_surchargeExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct UndefinedOperatingHours {
pub closure_information: Option<Box<ClosureInformation>>,
pub operating_hours_extension: Option<Box<Extension>>,
pub undefined_operating_hours_extension: Option<Box<Extension>>,
}
impl UndefinedOperatingHours {
const FIELDS: &'static [u32] = &[0x8071f, 0x8052a, 0x8062a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8024c);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x8071f => { let v = Some(ClosureInformation::read(r)?); r.set(&mut e0, v.map(Box::new), 1823); }
0x8052a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1322); }
0x8062a => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1578); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
closure_information: e0,
operating_hours_extension: e1,
undefined_operating_hours_extension: e2,
};
r.close();
Ok(v)
}
}
impl UndefinedOperatingHours {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.closure_information { v.write(w, "fac:closureInformation", "", "")?; }
if let Some(v) = &self.operating_hours_extension { w.extension("fac:_operatingHoursExtension", v)?; }
if let Some(v) = &self.undefined_operating_hours_extension { w.extension("fac:_undefinedOperatingHoursExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct UndefinedOrganisation {
pub general_time_validity: Option<Box<com::OverallPeriod>>,
pub organisation_extension: Option<Box<Extension>>,
pub undefined_organisation_extension: Option<Box<Extension>>,
}
impl UndefinedOrganisation {
const FIELDS: &'static [u32] = &[0x8083f, 0x80537, 0x8062b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8024d);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x8083f => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e0, v.map(Box::new), 2111); }
0x80537 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1335); }
0x8062b => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1579); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
general_time_validity: e0,
organisation_extension: e1,
undefined_organisation_extension: e2,
};
r.close();
Ok(v)
}
}
impl UndefinedOrganisation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.general_time_validity { v.write(w, "fac:generalTimeValidity", "", "")?; }
if let Some(v) = &self.organisation_extension { w.extension("fac:_organisationExtension", v)?; }
if let Some(v) = &self.undefined_organisation_extension { w.extension("fac:_undefinedOrganisationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct UnknownOperatingHours {
pub closure_information: Option<Box<ClosureInformation>>,
pub operating_hours_extension: Option<Box<Extension>>,
pub unknown_operating_hours_extension: Option<Box<Extension>>,
}
impl UnknownOperatingHours {
const FIELDS: &'static [u32] = &[0x8071f, 0x8052a, 0x8062c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8024e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x8071f => { let v = Some(ClosureInformation::read(r)?); r.set(&mut e0, v.map(Box::new), 1823); }
0x8052a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1322); }
0x8062c => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1580); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
closure_information: e0,
operating_hours_extension: e1,
unknown_operating_hours_extension: e2,
};
r.close();
Ok(v)
}
}
impl UnknownOperatingHours {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.closure_information { v.write(w, "fac:closureInformation", "", "")?; }
if let Some(v) = &self.operating_hours_extension { w.extension("fac:_operatingHoursExtension", v)?; }
if let Some(v) = &self.unknown_operating_hours_extension { w.extension("fac:_unknownOperatingHoursExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct UnknownOrganisation {
pub general_time_validity: Option<Box<com::OverallPeriod>>,
pub organisation_extension: Option<Box<Extension>>,
pub unknown_organisation_extension: Option<Box<Extension>>,
}
impl UnknownOrganisation {
const FIELDS: &'static [u32] = &[0x8083f, 0x80537, 0x8062d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x8024f);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x8083f => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e0, v.map(Box::new), 2111); }
0x80537 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1335); }
0x8062d => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1581); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
general_time_validity: e0,
organisation_extension: e1,
unknown_organisation_extension: e2,
};
r.close();
Ok(v)
}
}
impl UnknownOrganisation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.general_time_validity { v.write(w, "fac:generalTimeValidity", "", "")?; }
if let Some(v) = &self.organisation_extension { w.extension("fac:_organisationExtension", v)?; }
if let Some(v) = &self.unknown_organisation_extension { w.extension("fac:_unknownOrganisationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct UnknownRates {
pub applicable_currency: Vec<CurrencyCode>,
pub payment_method: Option<Box<PaymentMethod>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub energy_pricing_policy: Option<Box<egi::EnergyPricingPolicy>>,
pub rates_extension: Option<Box<Extension>>,
pub unknown_rates_extension: Option<Box<Extension>>,
}
impl UnknownRates {
const FIELDS: &'static [u32] = &[0x806bf, 0x80a13, 0x809f1, 0x807d4, 0x8058d, 0x8062e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80250);
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;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x806bf => { let v = r.string()?; e0.extend(v); }
0x80a13 => { let v = Some(PaymentMethod::read(r)?); r.set(&mut e1, v.map(Box::new), 2579); }
0x809f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x807d4 => { let v = Some(egi::EnergyPricingPolicy::read(r)?); r.set(&mut e3, v.map(Box::new), 2004); }
0x8058d => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1421); }
0x8062e => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1582); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
applicable_currency: e0,
payment_method: e1,
overall_period: e2,
energy_pricing_policy: e3,
rates_extension: e4,
unknown_rates_extension: e5,
};
r.close();
Ok(v)
}
}
impl UnknownRates {
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.applicable_currency { w.max_len("applicableCurrency", v, 1024)?; w.pattern("applicableCurrency", v, Pattern::CurrencyCode)?; w.leaf("fac:applicableCurrency", v)?; }
if let Some(v) = &self.payment_method { v.write(w, "fac:paymentMethod", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "fac:overallPeriod", "", "")?; }
if let Some(v) = &self.energy_pricing_policy { v.write(w, "fac:energyPricingPolicy", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("fac:_ratesExtension", v)?; }
if let Some(v) = &self.unknown_rates_extension { w.extension("fac:_unknownRatesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct UnspecifiedRates {
pub applicable_currency: Vec<CurrencyCode>,
pub payment_method: Option<Box<PaymentMethod>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub energy_pricing_policy: Option<Box<egi::EnergyPricingPolicy>>,
pub rates_extension: Option<Box<Extension>>,
pub unspecified_rates_extension: Option<Box<Extension>>,
}
impl UnspecifiedRates {
const FIELDS: &'static [u32] = &[0x806bf, 0x80a13, 0x809f1, 0x807d4, 0x8058d, 0x8062f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80251);
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;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x806bf => { let v = r.string()?; e0.extend(v); }
0x80a13 => { let v = Some(PaymentMethod::read(r)?); r.set(&mut e1, v.map(Box::new), 2579); }
0x809f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x807d4 => { let v = Some(egi::EnergyPricingPolicy::read(r)?); r.set(&mut e3, v.map(Box::new), 2004); }
0x8058d => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1421); }
0x8062f => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1583); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
applicable_currency: e0,
payment_method: e1,
overall_period: e2,
energy_pricing_policy: e3,
rates_extension: e4,
unspecified_rates_extension: e5,
};
r.close();
Ok(v)
}
}
impl UnspecifiedRates {
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.applicable_currency { w.max_len("applicableCurrency", v, 1024)?; w.pattern("applicableCurrency", v, Pattern::CurrencyCode)?; w.leaf("fac:applicableCurrency", v)?; }
if let Some(v) = &self.payment_method { v.write(w, "fac:paymentMethod", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "fac:overallPeriod", "", "")?; }
if let Some(v) = &self.energy_pricing_policy { v.write(w, "fac:energyPricingPolicy", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("fac:_ratesExtension", v)?; }
if let Some(v) = &self.unspecified_rates_extension { w.extension("fac:_unspecifiedRatesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct UserQualification {
pub user_group: Option<UserTypeEnum>,
pub user_qualification_extension: Option<Box<Extension>>,
}
impl UserQualification {
const FIELDS: &'static [u32] = &[0x80c1b, 0x80633];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x80255);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x80c1b => { let v = r.enumeration::<UserTypeEnum>()?; r.set(&mut e0, v, 3099); }
0x80633 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1587); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3099);
let v = Self {
user_group: e0,
user_qualification_extension: e1,
};
r.close();
Ok(v)
}
}
impl UserQualification {
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.user_group {
Some(v) => { w.enumeration("fac:userGroup", v.literal())?; }
None => return Err(w.missing("fac:userGroup")),
}
if let Some(v) = &self.user_qualification_extension { w.extension("fac:_userQualificationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyAssociatedFacility {
AssociatedFacility(Box<AssociatedFacility>),
AssociatedParking(Box<egi::AssociatedParking>),
}
impl AnyAssociatedFacility {
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(0x80038) => Self::AssociatedFacility(Box::new(AssociatedFacility::read(r)?)),
Some(0x70039) => Self::AssociatedParking(Box::new(egi::AssociatedParking::read(r)?)),
None => Self::AssociatedFacility(Box::new(AssociatedFacility::read(r)?)),
_ => {
r.unknown_type_as("AssociatedFacility");
Self::AssociatedFacility(Box::new(AssociatedFacility::read(r)?))
}
}))
}
pub fn r#type(&self) -> Option<&FacilityTypeEnum> {
match self {
Self::AssociatedFacility(v) => v.r#type.as_ref(),
Self::AssociatedParking(v) => v.r#type.as_ref(),
}
}
pub fn facility_reference(&self) -> Option<&com::VersionedReference> {
match self {
Self::AssociatedFacility(v) => v.facility_reference.as_deref(),
Self::AssociatedParking(v) => v.facility_reference.as_deref(),
}
}
pub fn description(&self) -> Option<&MultilingualString> {
match self {
Self::AssociatedFacility(v) => v.description.as_ref(),
Self::AssociatedParking(v) => v.description.as_ref(),
}
}
pub fn associated_facility_extension(&self) -> Option<&Extension> {
match self {
Self::AssociatedFacility(v) => v.associated_facility_extension.as_deref(),
Self::AssociatedParking(v) => v.associated_facility_extension.as_deref(),
}
}
}
impl AnyAssociatedFacility {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::AssociatedFacility(v) => v.write(w, tag, "", ""),
Self::AssociatedParking(v) => v.write(w, tag, " xsi:type=\"egi:AssociatedParking\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyContactInformation {
ContactInformation(Box<ContactInformation>),
ContactPerson(Box<ContactPerson>),
}
impl AnyContactInformation {
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(0x8005c) => Self::ContactInformation(Box::new(ContactInformation::read(r)?)),
Some(0x8005d) => Self::ContactPerson(Box::new(ContactPerson::read(r)?)),
None => Self::ContactInformation(Box::new(ContactInformation::read(r)?)),
_ => {
r.unknown_type_as("ContactInformation");
Self::ContactInformation(Box::new(ContactInformation::read(r)?))
}
}))
}
pub fn language(&self) -> &[com::Language] {
match self {
Self::ContactInformation(v) => &v.language,
Self::ContactPerson(v) => &v.language,
}
}
pub fn telephone_number(&self) -> Option<&str> {
match self {
Self::ContactInformation(v) => v.telephone_number.as_deref(),
Self::ContactPerson(v) => v.telephone_number.as_deref(),
}
}
pub fn fax_number(&self) -> Option<&str> {
match self {
Self::ContactInformation(v) => v.fax_number.as_deref(),
Self::ContactPerson(v) => v.fax_number.as_deref(),
}
}
pub fn e_mail(&self) -> Option<&str> {
match self {
Self::ContactInformation(v) => v.e_mail.as_deref(),
Self::ContactPerson(v) => v.e_mail.as_deref(),
}
}
pub fn contact_information_extension(&self) -> Option<&Extension> {
match self {
Self::ContactInformation(v) => v.contact_information_extension.as_deref(),
Self::ContactPerson(v) => v.contact_information_extension.as_deref(),
}
}
}
impl AnyContactInformation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::ContactInformation(v) => v.write(w, tag, "", ""),
Self::ContactPerson(v) => v.write(w, tag, " xsi:type=\"fac:ContactPerson\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyCredential {
Credential(Box<Credential>),
CredentialAssigned(Box<CredentialAssigned>),
}
impl AnyCredential {
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(0x80064) => Self::Credential(Box::new(Credential::read(r)?)),
Some(0x80065) => Self::CredentialAssigned(Box::new(CredentialAssigned::read(r)?)),
None => Self::Credential(Box::new(Credential::read(r)?)),
_ => {
r.unknown_type_as("Credential");
Self::Credential(Box::new(Credential::read(r)?))
}
}))
}
pub fn r#type(&self) -> Option<&CredentialTypeEnum> {
match self {
Self::Credential(v) => v.r#type.as_ref(),
Self::CredentialAssigned(v) => v.r#type.as_ref(),
}
}
pub fn other_type(&self) -> Option<&str> {
match self {
Self::Credential(v) => v.other_type.as_deref(),
Self::CredentialAssigned(v) => v.other_type.as_deref(),
}
}
pub fn credential_extension(&self) -> Option<&Extension> {
match self {
Self::Credential(v) => v.credential_extension.as_deref(),
Self::CredentialAssigned(v) => v.credential_extension.as_deref(),
}
}
}
impl AnyCredential {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::Credential(v) => v.write(w, tag, "", ""),
Self::CredentialAssigned(v) => v.write(w, tag, " xsi:type=\"fac:CredentialAssigned\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum OperatingHours {
OpenAllHours(Box<OpenAllHours>),
OperatingHoursByReference(Box<OperatingHoursByReference>),
OperatingHoursSpecification(Box<OperatingHoursSpecification>),
UndefinedOperatingHours(Box<UndefinedOperatingHours>),
UnknownOperatingHours(Box<UnknownOperatingHours>),
}
impl OperatingHours {
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(0x8012e) => Self::OpenAllHours(Box::new(OpenAllHours::read(r)?)),
Some(0x80145) => Self::OperatingHoursByReference(Box::new(OperatingHoursByReference::read(r)?)),
Some(0x80147) => Self::OperatingHoursSpecification(Box::new(OperatingHoursSpecification::read(r)?)),
Some(0x8024c) => Self::UndefinedOperatingHours(Box::new(UndefinedOperatingHours::read(r)?)),
Some(0x8024e) => Self::UnknownOperatingHours(Box::new(UnknownOperatingHours::read(r)?)),
_ => {
r.unknown_type("OperatingHours")?;
return Ok(None);
}
}))
}
pub fn closure_information(&self) -> Option<&ClosureInformation> {
match self {
Self::OpenAllHours(v) => v.closure_information.as_deref(),
Self::OperatingHoursByReference(v) => v.closure_information.as_deref(),
Self::OperatingHoursSpecification(v) => v.closure_information.as_deref(),
Self::UndefinedOperatingHours(v) => v.closure_information.as_deref(),
Self::UnknownOperatingHours(v) => v.closure_information.as_deref(),
}
}
pub fn operating_hours_extension(&self) -> Option<&Extension> {
match self {
Self::OpenAllHours(v) => v.operating_hours_extension.as_deref(),
Self::OperatingHoursByReference(v) => v.operating_hours_extension.as_deref(),
Self::OperatingHoursSpecification(v) => v.operating_hours_extension.as_deref(),
Self::UndefinedOperatingHours(v) => v.operating_hours_extension.as_deref(),
Self::UnknownOperatingHours(v) => v.operating_hours_extension.as_deref(),
}
}
}
impl OperatingHours {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::OpenAllHours(v) => v.write(w, tag, " xsi:type=\"fac:OpenAllHours\"", ""),
Self::OperatingHoursByReference(v) => v.write(w, tag, " xsi:type=\"fac:OperatingHoursByReference\"", ""),
Self::OperatingHoursSpecification(v) => v.write(w, tag, " xsi:type=\"fac:OperatingHoursSpecification\"", ""),
Self::UndefinedOperatingHours(v) => v.write(w, tag, " xsi:type=\"fac:UndefinedOperatingHours\"", ""),
Self::UnknownOperatingHours(v) => v.write(w, tag, " xsi:type=\"fac:UnknownOperatingHours\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Organisation {
OrganisationByReference(Box<OrganisationByReference>),
OrganisationSpecification(Box<OrganisationSpecification>),
UndefinedOrganisation(Box<UndefinedOrganisation>),
UnknownOrganisation(Box<UnknownOrganisation>),
}
impl Organisation {
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(0x80153) => Self::OrganisationByReference(Box::new(OrganisationByReference::read(r)?)),
Some(0x80155) => Self::OrganisationSpecification(Box::new(OrganisationSpecification::read(r)?)),
Some(0x8024d) => Self::UndefinedOrganisation(Box::new(UndefinedOrganisation::read(r)?)),
Some(0x8024f) => Self::UnknownOrganisation(Box::new(UnknownOrganisation::read(r)?)),
_ => {
r.unknown_type("Organisation")?;
return Ok(None);
}
}))
}
pub fn general_time_validity(&self) -> Option<&com::OverallPeriod> {
match self {
Self::OrganisationByReference(v) => v.general_time_validity.as_deref(),
Self::OrganisationSpecification(v) => v.general_time_validity.as_deref(),
Self::UndefinedOrganisation(v) => v.general_time_validity.as_deref(),
Self::UnknownOrganisation(v) => v.general_time_validity.as_deref(),
}
}
pub fn organisation_extension(&self) -> Option<&Extension> {
match self {
Self::OrganisationByReference(v) => v.organisation_extension.as_deref(),
Self::OrganisationSpecification(v) => v.organisation_extension.as_deref(),
Self::UndefinedOrganisation(v) => v.organisation_extension.as_deref(),
Self::UnknownOrganisation(v) => v.organisation_extension.as_deref(),
}
}
}
impl Organisation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::OrganisationByReference(v) => v.write(w, tag, " xsi:type=\"fac:OrganisationByReference\"", ""),
Self::OrganisationSpecification(v) => v.write(w, tag, " xsi:type=\"fac:OrganisationSpecification\"", ""),
Self::UndefinedOrganisation(v) => v.write(w, tag, " xsi:type=\"fac:UndefinedOrganisation\"", ""),
Self::UnknownOrganisation(v) => v.write(w, tag, " xsi:type=\"fac:UnknownOrganisation\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyRateLineCollection {
RateLineCollection(Box<RateLineCollection>),
RelativeTimeRates(Box<RelativeTimeRates>),
}
impl AnyRateLineCollection {
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(0x801a3) => Self::RateLineCollection(Box::new(RateLineCollection::read(r)?)),
Some(0x801b6) => Self::RelativeTimeRates(Box::new(RelativeTimeRates::read(r)?)),
None => Self::RateLineCollection(Box::new(RateLineCollection::read(r)?)),
_ => {
r.unknown_type_as("RateLineCollection");
Self::RateLineCollection(Box::new(RateLineCollection::read(r)?))
}
}))
}
pub fn collection_sequence(&self) -> Option<&com::Integer> {
match self {
Self::RateLineCollection(v) => v.collection_sequence.as_ref(),
Self::RelativeTimeRates(v) => v.collection_sequence.as_ref(),
}
}
pub fn applicable_currency(&self) -> Option<&str> {
match self {
Self::RateLineCollection(v) => v.applicable_currency.as_deref(),
Self::RelativeTimeRates(v) => v.applicable_currency.as_deref(),
}
}
pub fn min_value_collection(&self) -> Option<&AmountOfMoney> {
match self {
Self::RateLineCollection(v) => v.min_value_collection.as_ref(),
Self::RelativeTimeRates(v) => v.min_value_collection.as_ref(),
}
}
pub fn max_value_collection(&self) -> Option<&AmountOfMoney> {
match self {
Self::RateLineCollection(v) => v.max_value_collection.as_ref(),
Self::RelativeTimeRates(v) => v.max_value_collection.as_ref(),
}
}
pub fn valid_start(&self) -> Option<&DateTime> {
match self {
Self::RateLineCollection(v) => v.valid_start.as_ref(),
Self::RelativeTimeRates(v) => v.valid_start.as_ref(),
}
}
pub fn valid_end(&self) -> Option<&DateTime> {
match self {
Self::RateLineCollection(v) => v.valid_end.as_ref(),
Self::RelativeTimeRates(v) => v.valid_end.as_ref(),
}
}
pub fn min_time(&self) -> Option<&str> {
match self {
Self::RateLineCollection(v) => v.min_time.as_deref(),
Self::RelativeTimeRates(v) => v.min_time.as_deref(),
}
}
pub fn max_time(&self) -> Option<&str> {
match self {
Self::RateLineCollection(v) => v.max_time.as_deref(),
Self::RelativeTimeRates(v) => v.max_time.as_deref(),
}
}
pub fn reset_time(&self) -> Option<&Time> {
match self {
Self::RateLineCollection(v) => v.reset_time.as_ref(),
Self::RelativeTimeRates(v) => v.reset_time.as_ref(),
}
}
pub fn tax_included(&self) -> Option<&com::Boolean> {
match self {
Self::RateLineCollection(v) => v.tax_included.as_ref(),
Self::RelativeTimeRates(v) => v.tax_included.as_ref(),
}
}
pub fn tax_rate(&self) -> Option<&com::Percentage> {
match self {
Self::RateLineCollection(v) => v.tax_rate.as_ref(),
Self::RelativeTimeRates(v) => v.tax_rate.as_ref(),
}
}
pub fn tax_value(&self) -> Option<&AmountOfMoney> {
match self {
Self::RateLineCollection(v) => v.tax_value.as_ref(),
Self::RelativeTimeRates(v) => v.tax_value.as_ref(),
}
}
pub fn relative_times(&self) -> Option<&com::Boolean> {
match self {
Self::RateLineCollection(v) => v.relative_times.as_ref(),
Self::RelativeTimeRates(v) => v.relative_times.as_ref(),
}
}
pub fn rate_line(&self) -> &[RateLine] {
match self {
Self::RateLineCollection(v) => &v.rate_line,
Self::RelativeTimeRates(v) => &v.rate_line,
}
}
pub fn rate_line_collection_extension(&self) -> Option<&Extension> {
match self {
Self::RateLineCollection(v) => v.rate_line_collection_extension.as_deref(),
Self::RelativeTimeRates(v) => v.rate_line_collection_extension.as_deref(),
}
}
}
impl AnyRateLineCollection {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::RateLineCollection(v) => v.write(w, tag, "", ""),
Self::RelativeTimeRates(v) => v.write(w, tag, " xsi:type=\"fac:RelativeTimeRates\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Rates {
FreeOfCharge(Box<FreeOfCharge>),
GeneralRateInformation(Box<GeneralRateInformation>),
RateTable(Box<RateTable>),
RatesByReference(Box<RatesByReference>),
UnknownRates(Box<UnknownRates>),
UnspecifiedRates(Box<UnspecifiedRates>),
}
impl Rates {
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(0x800b4) => Self::FreeOfCharge(Box::new(FreeOfCharge::read(r)?)),
Some(0x800c1) => Self::GeneralRateInformation(Box::new(GeneralRateInformation::read(r)?)),
Some(0x801a7) => Self::RateTable(Box::new(RateTable::read(r)?)),
Some(0x801aa) => Self::RatesByReference(Box::new(RatesByReference::read(r)?)),
Some(0x80250) => Self::UnknownRates(Box::new(UnknownRates::read(r)?)),
Some(0x80251) => Self::UnspecifiedRates(Box::new(UnspecifiedRates::read(r)?)),
_ => {
r.unknown_type("Rates")?;
return Ok(None);
}
}))
}
pub fn applicable_currency(&self) -> &[CurrencyCode] {
match self {
Self::FreeOfCharge(v) => &v.applicable_currency,
Self::GeneralRateInformation(v) => &v.applicable_currency,
Self::RateTable(v) => &v.applicable_currency,
Self::RatesByReference(v) => &v.applicable_currency,
Self::UnknownRates(v) => &v.applicable_currency,
Self::UnspecifiedRates(v) => &v.applicable_currency,
}
}
pub fn payment_method(&self) -> Option<&PaymentMethod> {
match self {
Self::FreeOfCharge(v) => v.payment_method.as_deref(),
Self::GeneralRateInformation(v) => v.payment_method.as_deref(),
Self::RateTable(v) => v.payment_method.as_deref(),
Self::RatesByReference(v) => v.payment_method.as_deref(),
Self::UnknownRates(v) => v.payment_method.as_deref(),
Self::UnspecifiedRates(v) => v.payment_method.as_deref(),
}
}
pub fn overall_period(&self) -> Option<&com::OverallPeriod> {
match self {
Self::FreeOfCharge(v) => v.overall_period.as_deref(),
Self::GeneralRateInformation(v) => v.overall_period.as_deref(),
Self::RateTable(v) => v.overall_period.as_deref(),
Self::RatesByReference(v) => v.overall_period.as_deref(),
Self::UnknownRates(v) => v.overall_period.as_deref(),
Self::UnspecifiedRates(v) => v.overall_period.as_deref(),
}
}
pub fn energy_pricing_policy(&self) -> Option<&egi::EnergyPricingPolicy> {
match self {
Self::FreeOfCharge(v) => v.energy_pricing_policy.as_deref(),
Self::GeneralRateInformation(v) => v.energy_pricing_policy.as_deref(),
Self::RateTable(v) => v.energy_pricing_policy.as_deref(),
Self::RatesByReference(v) => v.energy_pricing_policy.as_deref(),
Self::UnknownRates(v) => v.energy_pricing_policy.as_deref(),
Self::UnspecifiedRates(v) => v.energy_pricing_policy.as_deref(),
}
}
pub fn rates_extension(&self) -> Option<&Extension> {
match self {
Self::FreeOfCharge(v) => v.rates_extension.as_deref(),
Self::GeneralRateInformation(v) => v.rates_extension.as_deref(),
Self::RateTable(v) => v.rates_extension.as_deref(),
Self::RatesByReference(v) => v.rates_extension.as_deref(),
Self::UnknownRates(v) => v.rates_extension.as_deref(),
Self::UnspecifiedRates(v) => v.rates_extension.as_deref(),
}
}
}
impl Rates {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::FreeOfCharge(v) => v.write(w, tag, " xsi:type=\"fac:FreeOfCharge\"", ""),
Self::GeneralRateInformation(v) => v.write(w, tag, " xsi:type=\"fac:GeneralRateInformation\"", ""),
Self::RateTable(v) => v.write(w, tag, " xsi:type=\"fac:RateTable\"", ""),
Self::RatesByReference(v) => v.write(w, tag, " xsi:type=\"fac:RatesByReference\"", ""),
Self::UnknownRates(v) => v.write(w, tag, " xsi:type=\"fac:UnknownRates\"", ""),
Self::UnspecifiedRates(v) => v.write(w, tag, " xsi:type=\"fac:UnspecifiedRates\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum SupplementalFacility {
ElectricChargingEquipment(Box<egi::ElectricChargingEquipment>),
SupplementalEquipment(Box<SupplementalEquipment>),
SupplementalServiceFacility(Box<SupplementalServiceFacility>),
}
impl SupplementalFacility {
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(0x70090) => Self::ElectricChargingEquipment(Box::new(egi::ElectricChargingEquipment::read(r)?)),
Some(0x801fc) => Self::SupplementalEquipment(Box::new(SupplementalEquipment::read(r)?)),
Some(0x801ff) => Self::SupplementalServiceFacility(Box::new(SupplementalServiceFacility::read(r)?)),
_ => {
r.unknown_type("SupplementalFacility")?;
return Ok(None);
}
}))
}
pub fn id(&self) -> Option<&str> {
match self {
Self::ElectricChargingEquipment(v) => v.id.as_deref(),
Self::SupplementalEquipment(v) => v.id.as_deref(),
Self::SupplementalServiceFacility(v) => v.id.as_deref(),
}
}
pub fn version(&self) -> Option<&str> {
match self {
Self::ElectricChargingEquipment(v) => v.version.as_deref(),
Self::SupplementalEquipment(v) => v.version.as_deref(),
Self::SupplementalServiceFacility(v) => v.version.as_deref(),
}
}
pub fn name(&self) -> Option<&MultilingualString> {
match self {
Self::ElectricChargingEquipment(v) => v.name.as_ref(),
Self::SupplementalEquipment(v) => v.name.as_ref(),
Self::SupplementalServiceFacility(v) => v.name.as_ref(),
}
}
pub fn alias(&self) -> &[MultilingualString] {
match self {
Self::ElectricChargingEquipment(v) => &v.alias,
Self::SupplementalEquipment(v) => &v.alias,
Self::SupplementalServiceFacility(v) => &v.alias,
}
}
pub fn external_identifier(&self) -> Option<&str> {
match self {
Self::ElectricChargingEquipment(v) => v.external_identifier.as_deref(),
Self::SupplementalEquipment(v) => v.external_identifier.as_deref(),
Self::SupplementalServiceFacility(v) => v.external_identifier.as_deref(),
}
}
pub fn last_updated(&self) -> Option<&DateTime> {
match self {
Self::ElectricChargingEquipment(v) => v.last_updated.as_ref(),
Self::SupplementalEquipment(v) => v.last_updated.as_ref(),
Self::SupplementalServiceFacility(v) => v.last_updated.as_ref(),
}
}
pub fn description(&self) -> Option<&MultilingualString> {
match self {
Self::ElectricChargingEquipment(v) => v.description.as_ref(),
Self::SupplementalEquipment(v) => v.description.as_ref(),
Self::SupplementalServiceFacility(v) => v.description.as_ref(),
}
}
pub fn accessibility(&self) -> &[AccessibilityEnum] {
match self {
Self::ElectricChargingEquipment(v) => &v.accessibility,
Self::SupplementalEquipment(v) => &v.accessibility,
Self::SupplementalServiceFacility(v) => &v.accessibility,
}
}
pub fn additional_information(&self) -> &[MultilingualString] {
match self {
Self::ElectricChargingEquipment(v) => &v.additional_information,
Self::SupplementalEquipment(v) => &v.additional_information,
Self::SupplementalServiceFacility(v) => &v.additional_information,
}
}
pub fn information_website(&self) -> &[com::UrlLink] {
match self {
Self::ElectricChargingEquipment(v) => &v.information_website,
Self::SupplementalEquipment(v) => &v.information_website,
Self::SupplementalServiceFacility(v) => &v.information_website,
}
}
pub fn photo_url(&self) -> &[com::UrlLink] {
match self {
Self::ElectricChargingEquipment(v) => &v.photo_url,
Self::SupplementalEquipment(v) => &v.photo_url,
Self::SupplementalServiceFacility(v) => &v.photo_url,
}
}
pub fn photo(&self) -> &[Image] {
match self {
Self::ElectricChargingEquipment(v) => &v.photo,
Self::SupplementalEquipment(v) => &v.photo,
Self::SupplementalServiceFacility(v) => &v.photo,
}
}
pub fn operating_hours(&self) -> Option<&OperatingHours> {
match self {
Self::ElectricChargingEquipment(v) => v.operating_hours.as_ref(),
Self::SupplementalEquipment(v) => v.operating_hours.as_ref(),
Self::SupplementalServiceFacility(v) => v.operating_hours.as_ref(),
}
}
pub fn location_reference(&self) -> Option<&loc::LocationReference> {
match self {
Self::ElectricChargingEquipment(v) => v.location_reference.as_ref(),
Self::SupplementalEquipment(v) => v.location_reference.as_ref(),
Self::SupplementalServiceFacility(v) => v.location_reference.as_ref(),
}
}
pub fn owner(&self) -> Option<&Organisation> {
match self {
Self::ElectricChargingEquipment(v) => v.owner.as_ref(),
Self::SupplementalEquipment(v) => v.owner.as_ref(),
Self::SupplementalServiceFacility(v) => v.owner.as_ref(),
}
}
pub fn operator(&self) -> Option<&Organisation> {
match self {
Self::ElectricChargingEquipment(v) => v.operator.as_ref(),
Self::SupplementalEquipment(v) => v.operator.as_ref(),
Self::SupplementalServiceFacility(v) => v.operator.as_ref(),
}
}
pub fn associated_facility(&self) -> &[AnyAssociatedFacility] {
match self {
Self::ElectricChargingEquipment(v) => &v.associated_facility,
Self::SupplementalEquipment(v) => &v.associated_facility,
Self::SupplementalServiceFacility(v) => &v.associated_facility,
}
}
pub fn rates(&self) -> Option<&Rates> {
match self {
Self::ElectricChargingEquipment(v) => v.rates.as_ref(),
Self::SupplementalEquipment(v) => v.rates.as_ref(),
Self::SupplementalServiceFacility(v) => v.rates.as_ref(),
}
}
pub fn applicable_for_vehicles(&self) -> &[com::VehicleCharacteristics] {
match self {
Self::ElectricChargingEquipment(v) => &v.applicable_for_vehicles,
Self::SupplementalEquipment(v) => &v.applicable_for_vehicles,
Self::SupplementalServiceFacility(v) => &v.applicable_for_vehicles,
}
}
pub fn dimension(&self) -> Option<&Dimension> {
match self {
Self::ElectricChargingEquipment(v) => v.dimension.as_deref(),
Self::SupplementalEquipment(v) => v.dimension.as_deref(),
Self::SupplementalServiceFacility(v) => v.dimension.as_deref(),
}
}
pub fn facility_object_extension(&self) -> Option<&Extension> {
match self {
Self::ElectricChargingEquipment(v) => v.facility_object_extension.as_deref(),
Self::SupplementalEquipment(v) => v.facility_object_extension.as_deref(),
Self::SupplementalServiceFacility(v) => v.facility_object_extension.as_deref(),
}
}
pub fn availability(&self) -> Option<&AvailabilityEnum> {
match self {
Self::ElectricChargingEquipment(v) => v.availability.as_ref(),
Self::SupplementalEquipment(v) => v.availability.as_ref(),
Self::SupplementalServiceFacility(v) => v.availability.as_ref(),
}
}
pub fn quantity(&self) -> Option<&com::NonNegativeInteger> {
match self {
Self::ElectricChargingEquipment(v) => v.quantity.as_ref(),
Self::SupplementalEquipment(v) => v.quantity.as_ref(),
Self::SupplementalServiceFacility(v) => v.quantity.as_ref(),
}
}
pub fn regularly_cleaned(&self) -> Option<&com::Boolean> {
match self {
Self::ElectricChargingEquipment(v) => v.regularly_cleaned.as_ref(),
Self::SupplementalEquipment(v) => v.regularly_cleaned.as_ref(),
Self::SupplementalServiceFacility(v) => v.regularly_cleaned.as_ref(),
}
}
pub fn applicable_for_user(&self) -> &[UserTypeEnum] {
match self {
Self::ElectricChargingEquipment(v) => &v.applicable_for_user,
Self::SupplementalEquipment(v) => &v.applicable_for_user,
Self::SupplementalServiceFacility(v) => &v.applicable_for_user,
}
}
pub fn supplemental_facility_extension(&self) -> Option<&Extension> {
match self {
Self::ElectricChargingEquipment(v) => v.supplemental_facility_extension.as_deref(),
Self::SupplementalEquipment(v) => v.supplemental_facility_extension.as_deref(),
Self::SupplementalServiceFacility(v) => v.supplemental_facility_extension.as_deref(),
}
}
}
impl SupplementalFacility {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::ElectricChargingEquipment(v) => v.write(w, tag, " xsi:type=\"egi:ElectricChargingEquipment\"", ""),
Self::SupplementalEquipment(v) => v.write(w, tag, " xsi:type=\"fac:SupplementalEquipment\"", ""),
Self::SupplementalServiceFacility(v) => v.write(w, tag, " xsi:type=\"fac:SupplementalServiceFacility\"", ""),
}
}
}