#[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, facilities as fac, 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 {
BathRoom,
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,
RestingFacilities,
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::BathRoom => "bathRoom",
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::RestingFacilities => "restingFacilities",
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 {
"bathRoom" => Some(Self::BathRoom),
"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),
"restingFacilities" => Some(Self::RestingFacilities),
"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),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MeansOfPaymentEnum {
PaymentCreditCard,
CashBillsOnly,
CashCoinsOnly,
TollTag,
MobileAccount,
CashCoinsAndBills,
Prepay,
PaymentDebitCard,
PaymentValueCard,
Nfc,
Emv,
QrCode,
Website,
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::Nfc => "nfc",
Self::Emv => "emv",
Self::QrCode => "qrCode",
Self::Website => "website",
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),
"nfc" => Some(Self::Nfc),
"emv" => Some(Self::Emv),
"qrCode" => Some(Self::QrCode),
"website" => Some(Self::Website),
"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 PaymentModeEnum {
Prepay,
PayOnEntry,
PayPriorToExit,
PayAfterExit,
PayAndExit,
Other,
Extended(String),
}
impl PaymentModeEnum {
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 PaymentModeEnum {
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 PaymentModeEnum {
#[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 RateLineUsageConditionsTypeEnum {
FixedDuration,
FixedNumber,
Once,
Unlimited,
Extended(String),
}
impl RateLineUsageConditionsTypeEnum {
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 RateLineUsageConditionsTypeEnum {
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 RateLineUsageConditionsTypeEnum {
#[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 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,
CateringService,
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::CateringService => "cateringService",
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),
"cateringService" => Some(Self::CateringService),
"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 TypeOfIdentifierEnum {
Extended(String),
}
impl TypeOfIdentifierEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Extended(v) => v,
}
}
}
impl Enumeration for TypeOfIdentifierEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TypeOfIdentifierEnum {
#[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 UnitOfTimeEnum {
Second,
Minute,
Hour,
Day,
Extended(String),
}
impl UnitOfTimeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Second => "second",
Self::Minute => "minute",
Self::Hour => "hour",
Self::Day => "day",
Self::Extended(v) => v,
}
}
}
impl Enumeration for UnitOfTimeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"second" => Some(Self::Second),
"minute" => Some(Self::Minute),
"hour" => Some(Self::Hour),
"day" => Some(Self::Day),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl UnitOfTimeEnum {
#[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 UserTypeEnum {
AllUsers,
Commuters,
Customers,
ElderlyUsers,
Employees,
Families,
PersonsWithDisabilities,
HearingImpaired,
HotelGuests,
LongTermParkers,
Members,
Men,
OvernightParkers,
ParkAndCycleUser,
ParkAndRideUsers,
ParkAndWalkUser,
Pensioners,
PregnantPerson,
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::PregnantPerson => "pregnantPerson",
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),
"pregnantPerson" => Some(Self::PregnantPerson),
"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 AfirFacilityLocation {
pub time_zone: Option<TimeZone>,
pub address: Option<Box<locx::Address>>,
pub nuts_area: Vec<NutsArea>,
}
impl AfirFacilityLocation {
const FIELDS: &'static [u32] = &[0x20bbd, 0x20693, 0x20993];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20019);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20bbd => { let v = r.string()?; r.set(&mut e0, v, 3005); }
0x20693 => { let v = Some(locx::Address::read(r)?); r.set(&mut e1, v.map(Box::new), 1683); }
0x20993 => { let v = Some(NutsArea::read(r)?); e2.extend(v); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
time_zone: e0,
address: e1,
nuts_area: e2,
};
r.close();
Ok(v)
}
}
impl AfirFacilityLocation {
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.time_zone { w.max_len("timeZone", v, 1024)?; w.pattern("timeZone", v, Pattern::TimeZone)?; w.leaf("afac:timeZone", v)?; }
if let Some(v) = &self.address { v.write(w, "afac:address", "", "")?; }
for v in &self.nuts_area { v.write(w, "afac:nutsArea", "", "")?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Amenities {
pub illuminated: Option<com::Boolean>,
pub roofed: Option<com::Boolean>,
pub illuminated_recharging_parking_nearby: Option<com::Boolean>,
pub roofed_recharging_parking_nearby: Option<com::Boolean>,
pub amenities_extension: Option<Box<Extension>>,
}
impl Amenities {
const FIELDS: &'static [u32] = &[0x20872, 0x20b0b, 0x20873, 0x20b0c, 0x2041c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2002f);
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 {
0x20872 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2162); }
0x20b0b => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2827); }
0x20873 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2163); }
0x20b0c => { let v = r.value::<bool>()?; r.set(&mut e3, v, 2828); }
0x2041c => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1052); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
illuminated: e0,
roofed: e1,
illuminated_recharging_parking_nearby: e2,
roofed_recharging_parking_nearby: e3,
amenities_extension: e4,
};
r.close();
Ok(v)
}
}
impl Amenities {
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.illuminated { w.leaf("afac:illuminated", v)?; }
if let Some(v) = &self.roofed { w.leaf("afac:roofed", v)?; }
if let Some(v) = &self.illuminated_recharging_parking_nearby { w.leaf("afac:illuminatedRechargingParkingNearby", v)?; }
if let Some(v) = &self.roofed_recharging_parking_nearby { w.leaf("afac:roofedRechargingParkingNearby", v)?; }
if let Some(v) = &self.amenities_extension { w.extension("afac:_amenitiesExtension", v)?; }
w.end(tag)
}
}
#[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] = &[0x20751, 0x20750, 0x2041d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20030);
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 {
0x20751 => { let v = r.value::<Decimal>()?; r.set(&mut e0, v, 1873); }
0x20750 => { let v = r.string()?; r.set(&mut e1, v, 1872); }
0x2041d => { 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("afac:currencyValue", v)?; }
None => return Err(w.missing("afac:currencyValue")),
}
match &self.currency_type {
Some(v) => { w.max_len("currencyType", v, 1024)?; w.pattern("currencyType", v, Pattern::CurrencyCode)?; w.leaf("afac:currencyType", v)?; }
None => return Err(w.missing("afac:currencyType")),
}
if let Some(v) = &self.amount_in_currency_extension { w.extension("afac:_amountInCurrencyExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AnOrganisation {
pub general_time_validity: Option<Box<com::OverallPeriod>>,
pub organisation_extension: Option<Box<Extension>>,
pub last_updated: Option<DateTime>,
pub name: Option<MultilingualString>,
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 external_identifier: Vec<ExternalIdentifier>,
pub sub_organisation: Vec<Organisation>,
pub an_organisation_extension: Option<Box<Extension>>,
}
impl AnOrganisation {
const FIELDS: &'static [u32] = &[0x2083f, 0x20537, 0x208ba, 0x20949, 0x208c3, 0x20777, 0x208d6, 0x208d7, 0x208d8, 0x206dd, 0x20aed, 0x20a95, 0x20bfe, 0x20950, 0x20951, 0x20c2e, 0x209e0, 0x20805, 0x20b89, 0x2041e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20031);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = Vec::new();
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = None;
let mut e16 = Vec::new();
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 {
0x2083f => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e0, v.map(Box::new), 2111); }
0x20537 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1335); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20949 => { let v = r.multilingual()?; r.set(&mut e3, v, 2377); }
0x208c3 => { let v = r.multilingual()?; r.set(&mut e4, v, 2243); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e5, v, 1911); }
0x208d6 => { let v = r.string()?; r.set(&mut e6, v, 2262); }
0x208d7 => { let v = r.string()?; r.set(&mut e7, v, 2263); }
0x208d8 => { let v = r.string()?; r.set(&mut e8, v, 2264); }
0x206dd => { let v = r.value::<bool>()?; r.set(&mut e9, v, 1757); }
0x20aed => { let v = r.multilingual()?; e10.extend(v); }
0x20a95 => { let v = r.value::<bool>()?; r.set(&mut e11, v, 2709); }
0x20bfe => { let v = r.enumeration::<OrganisationTypeEnum>()?; r.set(&mut e12, v, 3070); }
0x20950 => { let v = r.string()?; r.set(&mut e13, v, 2384); }
0x20951 => { let v = r.string()?; r.set(&mut e14, v, 2385); }
0x20c2e => { let v = r.string()?; r.set(&mut e15, v, 3118); }
0x209e0 => { let v = Some(OrganisationUnit::read(r)?); e16.extend(v); }
0x20805 => { let v = Some(ExternalIdentifier::read(r)?); e17.extend(v); }
0x20b89 => { let v = Organisation::read(r)?; e18.extend(v); }
0x2041e => { let v = r.raw()?; r.set(&mut e19, v.map(Box::new), 1054); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e3, 2377);
let v = Self {
general_time_validity: e0,
organisation_extension: e1,
last_updated: e2,
name: e3,
legal_name: e4,
description: e5,
link_to_general_information: e6,
link_to_logo: e7,
link_to_webform: e8,
available24hours: e9,
responsibility: e10,
publishing_agreement: e11,
r#type: e12,
national_organisation_number: e13,
national_register: e14,
vat_identification_number: e15,
organisation_unit: e16,
external_identifier: e17,
sub_organisation: e18,
an_organisation_extension: e19,
};
r.close();
Ok(v)
}
}
impl AnOrganisation {
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, "afac:generalTimeValidity", "", "")?; }
if let Some(v) = &self.organisation_extension { w.extension("afac:_organisationExtension", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
match &self.name {
Some(v) => { w.multilingual("afac:name", v)?; }
None => return Err(w.missing("afac:name")),
}
if let Some(v) = &self.legal_name { w.multilingual("afac:legalName", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
if let Some(v) = &self.link_to_general_information { w.leaf("afac:linkToGeneralInformation", v)?; }
if let Some(v) = &self.link_to_logo { w.leaf("afac:linkToLogo", v)?; }
if let Some(v) = &self.link_to_webform { w.leaf("afac:linkToWebform", v)?; }
if let Some(v) = &self.available24hours { w.leaf("afac:available24hours", v)?; }
for v in &self.responsibility { w.multilingual("afac:responsibility", v)?; }
if let Some(v) = &self.publishing_agreement { w.leaf("afac:publishingAgreement", v)?; }
if let Some(v) = &self.r#type { w.enumeration("afac:type", v.literal())?; }
if let Some(v) = &self.national_organisation_number { w.max_len("nationalOrganisationNumber", v, 1024)?; w.leaf("afac:nationalOrganisationNumber", v)?; }
if let Some(v) = &self.national_register { w.max_len("nationalRegister", v, 1024)?; w.leaf("afac:nationalRegister", v)?; }
if let Some(v) = &self.vat_identification_number { w.max_len("vatIdentificationNumber", v, 1024)?; w.leaf("afac:vatIdentificationNumber", v)?; }
for v in &self.organisation_unit { v.write(w, "afac:organisationUnit", "", "")?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.sub_organisation { v.write(w, "afac:subOrganisation")?; }
if let Some(v) = &self.an_organisation_extension { w.extension("afac:_anOrganisationExtension", 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] = &[0x20bfe, 0x2080c, 0x20777, 0x20425];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20038);
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 {
0x20bfe => { let v = r.enumeration::<FacilityTypeEnum>()?; r.set(&mut e0, v, 3070); }
0x2080c => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e1, v.map(Box::new), 2060); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e2, v, 1911); }
0x20425 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1061); }
_ => 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("afac:type", v.literal())?; }
None => return Err(w.missing("afac:type")),
}
if let Some(v) = &self.facility_reference { v.write(w, "afac:facilityReference", "", " targetClass=\"afac:FacilityObject\"")?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
if let Some(v) = &self.associated_facility_extension { w.extension("afac:_associatedFacilityExtension", v)?; }
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] = &[0x20a20, 0x20ba7, 0x2071e, 0x20ba8, 0x2043b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2004f);
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 {
0x20a20 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2592); }
0x20ba7 => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2983); }
0x2071e => { let v = r.date_time()?; r.set(&mut e2, v, 1822); }
0x20ba8 => { let v = r.date_time()?; r.set(&mut e3, v, 2984); }
0x2043b => { 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("afac:permananentlyClosed", v)?; }
if let Some(v) = &self.temporarily_closed { w.leaf("afac:temporarilyClosed", v)?; }
if let Some(v) = &self.closed_from { w.leaf("afac:closedFrom", v)?; }
if let Some(v) = &self.temporarily_closed_until { w.leaf("afac:temporarilyClosedUntil", v)?; }
if let Some(v) = &self.closure_information_extension { w.extension("afac:_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] = &[0x208b0, 0x20ba4, 0x2081c, 0x207b2, 0x20448];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2005c);
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 {
0x208b0 => { let v = r.string()?; e0.extend(v); }
0x20ba4 => { let v = r.string()?; r.set(&mut e1, v, 2980); }
0x2081c => { let v = r.string()?; r.set(&mut e2, v, 2076); }
0x207b2 => { let v = r.string()?; r.set(&mut e3, v, 1970); }
0x20448 => { 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("afac:language", v)?; }
if let Some(v) = &self.telephone_number { w.max_len("telephoneNumber", v, 1024)?; w.leaf("afac:telephoneNumber", v)?; }
if let Some(v) = &self.fax_number { w.max_len("faxNumber", v, 1024)?; w.leaf("afac:faxNumber", v)?; }
if let Some(v) = &self.e_mail { w.max_len("eMail", v, 1024)?; w.leaf("afac:eMail", v)?; }
if let Some(v) = &self.contact_information_extension { w.extension("afac:_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] = &[0x208b0, 0x20ba4, 0x2081c, 0x207b2, 0x20448, 0x20949, 0x20822, 0x20bbf, 0x20a4e, 0x20449];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2005d);
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 {
0x208b0 => { let v = r.string()?; e0.extend(v); }
0x20ba4 => { let v = r.string()?; r.set(&mut e1, v, 2980); }
0x2081c => { let v = r.string()?; r.set(&mut e2, v, 2076); }
0x207b2 => { let v = r.string()?; r.set(&mut e3, v, 1970); }
0x20448 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1096); }
0x20949 => { let v = r.string()?; r.set(&mut e5, v, 2377); }
0x20822 => { let v = r.string()?; r.set(&mut e6, v, 2082); }
0x20bbf => { let v = r.multilingual()?; r.set(&mut e7, v, 3007); }
0x20a4e => { let v = r.multilingual()?; r.set(&mut e8, v, 2638); }
0x20449 => { 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("afac:language", v)?; }
if let Some(v) = &self.telephone_number { w.max_len("telephoneNumber", v, 1024)?; w.leaf("afac:telephoneNumber", v)?; }
if let Some(v) = &self.fax_number { w.max_len("faxNumber", v, 1024)?; w.leaf("afac:faxNumber", v)?; }
if let Some(v) = &self.e_mail { w.max_len("eMail", v, 1024)?; w.leaf("afac:eMail", v)?; }
if let Some(v) = &self.contact_information_extension { w.extension("afac:_contactInformationExtension", v)?; }
match &self.name {
Some(v) => { w.max_len("name", v, 1024)?; w.leaf("afac:name", v)?; }
None => return Err(w.missing("afac:name")),
}
if let Some(v) = &self.first_name { w.max_len("firstName", v, 1024)?; w.leaf("afac:firstName", v)?; }
if let Some(v) = &self.title { w.multilingual("afac:title", v)?; }
if let Some(v) = &self.position { w.multilingual("afac:position", v)?; }
if let Some(v) = &self.contact_person_extension { w.extension("afac:_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] = &[0x20bfe, 0x209ed, 0x20451];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20064);
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 {
0x20bfe => { let v = r.enumeration::<CredentialTypeEnum>()?; r.set(&mut e0, v, 3070); }
0x209ed => { let v = r.string()?; r.set(&mut e1, v, 2541); }
0x20451 => { 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("afac:type", v.literal())?; }
None => return Err(w.missing("afac:type")),
}
if let Some(v) = &self.other_type { w.max_len("otherType", v, 1024)?; w.leaf("afac:otherType", v)?; }
if let Some(v) = &self.credential_extension { w.extension("afac:_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] = &[0x20bfe, 0x209ed, 0x20451, 0x208db, 0x2089e, 0x20450];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20065);
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 {
0x20bfe => { let v = r.enumeration::<CredentialTypeEnum>()?; r.set(&mut e0, v, 3070); }
0x209ed => { let v = r.string()?; r.set(&mut e1, v, 2541); }
0x20451 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1105); }
0x208db => { let v = r.string()?; r.set(&mut e3, v, 2267); }
0x2089e => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e4, v.map(Box::new), 2206); }
0x20450 => { 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("afac:type", v.literal())?; }
None => return Err(w.missing("afac:type")),
}
if let Some(v) = &self.other_type { w.max_len("otherType", v, 1024)?; w.leaf("afac:otherType", v)?; }
if let Some(v) = &self.credential_extension { w.extension("afac:_credentialExtension", v)?; }
if let Some(v) = &self.local_identifier { w.max_len("localIdentifier", v, 1024)?; w.leaf("afac:localIdentifier", v)?; }
match &self.issuer {
Some(v) => { v.write(w, "afac:issuer", "", " targetClass=\"afac:Organisation\"")?; }
None => return Err(w.missing("afac:issuer")),
}
if let Some(v) = &self.credential_assigned_extension { w.extension("afac:_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] = &[0x208c5, 0x20c75, 0x2085b, 0x20c15, 0x20468];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2007d);
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 {
0x208c5 => { let v = r.value::<f32>()?; r.set(&mut e0, v, 2245); }
0x20c75 => { let v = r.value::<f32>()?; r.set(&mut e1, v, 3189); }
0x2085b => { let v = r.value::<f32>()?; r.set(&mut e2, v, 2139); }
0x20c15 => { let v = r.value::<u64>()?; r.set(&mut e3, v, 3093); }
0x20468 => { 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("afac:length", v)?; }
if let Some(v) = &self.width { w.leaf("afac:width", v)?; }
if let Some(v) = &self.height { w.leaf("afac:height", v)?; }
if let Some(v) = &self.usable_area { w.leaf("afac:usableArea", v)?; }
if let Some(v) = &self.dimension_extension { w.extension("afac:_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, 0x207aa, 0x20475];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2008a);
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); }
0x207aa => { let v = r.value::<f32>()?; r.set(&mut e3, v, 1962); }
0x20475 => { 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("afac:duration", v)?; }
None => return Err(w.missing("afac:duration")),
}
if let Some(v) = &self.duration_value_extension { w.extension("afac:_durationValueExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Eligibility {
pub name: Option<MultilingualString>,
pub no_fee_to_use: Option<com::Boolean>,
pub description: Option<MultilingualString>,
pub priority: Option<com::NonNegativeInteger>,
pub combinable: Option<com::Boolean>,
pub qualification: Vec<Qualification>,
pub rate_discount: Option<Box<RateDiscount>>,
pub right_specification: Vec<RightSpecification>,
pub eligibility_extension: Option<Box<Extension>>,
}
impl Eligibility {
const FIELDS: &'static [u32] = &[0x20949, 0x2095c, 0x20777, 0x20a78, 0x20724, 0x20a96, 0x20a9e, 0x20af2, 0x20481];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20096);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x2095c => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2396); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e2, v, 1911); }
0x20a78 => { let v = r.value::<u64>()?; r.set(&mut e3, v, 2680); }
0x20724 => { let v = r.value::<bool>()?; r.set(&mut e4, v, 1828); }
0x20a96 => { let v = Some(Qualification::read(r)?); e5.extend(v); }
0x20a9e => { let v = Some(RateDiscount::read(r)?); r.set(&mut e6, v.map(Box::new), 2718); }
0x20af2 => { let v = Some(RightSpecification::read(r)?); e7.extend(v); }
0x20481 => { let v = r.raw()?; r.set(&mut e8, 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 {
name: e0,
no_fee_to_use: e1,
description: e2,
priority: e3,
combinable: e4,
qualification: e5,
rate_discount: e6,
right_specification: e7,
eligibility_extension: e8,
};
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.name { w.multilingual("afac:name", v)?; }
if let Some(v) = &self.no_fee_to_use { w.leaf("afac:noFeeToUse", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
if let Some(v) = &self.priority { w.leaf("afac:priority", v)?; }
if let Some(v) = &self.combinable { w.leaf("afac:combinable", v)?; }
for v in &self.qualification { v.write(w, "afac:qualification", "", "")?; }
if let Some(v) = &self.rate_discount { v.write(w, "afac:rateDiscount", "", "")?; }
for v in &self.right_specification { v.write(w, "afac:rightSpecification", "", "")?; }
if let Some(v) = &self.eligibility_extension { w.extension("afac:_eligibilityExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ExternalIdentifier {
pub identifier: Option<String>,
pub type_of_identifier: Option<TypeOfIdentifierEnum>,
pub other_type_of_identifier: Option<String>,
pub external_identifier_extension: Option<Box<Extension>>,
}
impl ExternalIdentifier {
const FIELDS: &'static [u32] = &[0x20870, 0x20c01, 0x209ee, 0x20494];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x200a9);
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 {
0x20870 => { let v = r.string()?; r.set(&mut e0, v, 2160); }
0x20c01 => { let v = r.enumeration::<TypeOfIdentifierEnum>()?; r.set(&mut e1, v, 3073); }
0x209ee => { let v = r.string()?; r.set(&mut e2, v, 2542); }
0x20494 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1172); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2160);
let v = Self {
identifier: e0,
type_of_identifier: e1,
other_type_of_identifier: e2,
external_identifier_extension: e3,
};
r.close();
Ok(v)
}
}
impl ExternalIdentifier {
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.identifier {
Some(v) => { w.max_len("identifier", v, 1024)?; w.leaf("afac:identifier", v)?; }
None => return Err(w.missing("afac:identifier")),
}
if let Some(v) = &self.type_of_identifier { w.enumeration("afac:typeOfIdentifier", v.literal())?; }
if let Some(v) = &self.other_type_of_identifier { w.max_len("otherTypeOfIdentifier", v, 1024)?; w.leaf("afac:otherTypeOfIdentifier", v)?; }
if let Some(v) = &self.external_identifier_extension { w.extension("afac:_externalIdentifierExtension", 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 operation_status: Option<OperationStatusEnum>,
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] = &[0x20aba, 0x208ba, 0x209a8, 0x209ce, 0x20aca, 0x20b77, 0x20958, 0x20959, 0x2080d, 0x20498];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x200ae);
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;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x208ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x209a8 => { let v = r.enumeration::<OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x209ce => { let v = r.enumeration::<OperationStatusEnum>()?; r.set(&mut e3, v, 2510); }
0x20aca => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2762); }
0x20b77 => { let v = r.multilingual()?; r.set(&mut e5, v, 2935); }
0x20958 => { let v = OperatingHours::read(r)?; r.set(&mut e6, v, 2392); }
0x20959 => { let v = Rates::read(r)?; r.set(&mut e7, v, 2393); }
0x2080d => { let v = com::AnyFault::read(r)?; r.set(&mut e8, v, 2061); }
0x20498 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1176); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2746);
let v = Self {
reference: e0,
last_updated: e1,
opening_status: e2,
operation_status: e3,
regular_operating_hours_in_force: e4,
status_description: e5,
new_operating_hours: e6,
new_rates: e7,
fault: e8,
facility_object_status_extension: e9,
};
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, "afac:reference", "", " targetClass=\"afac:FacilityObject\"")?; }
None => return Err(w.missing("afac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("afac:openingStatus", v.literal())?; }
if let Some(v) = &self.operation_status { w.enumeration("afac:operationStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("afac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("afac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "afac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "afac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "afac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("afac:_facilityObjectStatusExtension", v)?; }
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 operation_status: Option<OperationStatusEnum>,
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] = &[0x20aba, 0x208ba, 0x209a8, 0x209ce, 0x20aca, 0x20b77, 0x20958, 0x20959, 0x2080d, 0x20498, 0x20b91, 0x20499];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x200af);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = Vec::new();
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x208ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x209a8 => { let v = r.enumeration::<OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x209ce => { let v = r.enumeration::<OperationStatusEnum>()?; r.set(&mut e3, v, 2510); }
0x20aca => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2762); }
0x20b77 => { let v = r.multilingual()?; r.set(&mut e5, v, 2935); }
0x20958 => { let v = OperatingHours::read(r)?; r.set(&mut e6, v, 2392); }
0x20959 => { let v = Rates::read(r)?; r.set(&mut e7, v, 2393); }
0x2080d => { let v = com::AnyFault::read(r)?; r.set(&mut e8, v, 2061); }
0x20498 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1176); }
0x20b91 => { let v = Some(SupplementalFacilityStatus::read(r)?); e10.extend(v); }
0x20499 => { let v = r.raw()?; r.set(&mut e11, 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,
operation_status: e3,
regular_operating_hours_in_force: e4,
status_description: e5,
new_operating_hours: e6,
new_rates: e7,
fault: e8,
facility_object_status_extension: e9,
supplemental_facility_status: e10,
facility_status_extension: e11,
};
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, "afac:reference", "", " targetClass=\"afac:FacilityObject\"")?; }
None => return Err(w.missing("afac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("afac:openingStatus", v.literal())?; }
if let Some(v) = &self.operation_status { w.enumeration("afac:operationStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("afac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("afac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "afac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "afac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "afac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("afac:_facilityObjectStatusExtension", v)?; }
for v in &self.supplemental_facility_status { v.write(w, "afac:supplementalFacilityStatus", "", "")?; }
if let Some(v) = &self.facility_status_extension { w.extension("afac:_facilityStatusExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct FreeOfCharge {
pub applicable_currency: Vec<CurrencyCode>,
pub payment: Option<Box<Payment>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub rates_extension: Option<Box<Extension>>,
pub free_of_charge_extension: Option<Box<Extension>>,
}
impl FreeOfCharge {
const FIELDS: &'static [u32] = &[0x206bf, 0x20a10, 0x209f1, 0x2058d, 0x2049e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x200b4);
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 {
0x206bf => { let v = r.string()?; e0.extend(v); }
0x20a10 => { let v = Some(Payment::read(r)?); r.set(&mut e1, v.map(Box::new), 2576); }
0x209f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x2058d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1421); }
0x2049e => { let v = r.raw()?; r.set(&mut e4, 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: e1,
overall_period: e2,
rates_extension: e3,
free_of_charge_extension: e4,
};
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("afac:applicableCurrency", v)?; }
if let Some(v) = &self.payment { v.write(w, "afac:payment", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "afac:overallPeriod", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("afac:_ratesExtension", v)?; }
if let Some(v) = &self.free_of_charge_extension { w.extension("afac:_freeOfChargeExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GeneralRateInformation {
pub applicable_currency: Vec<CurrencyCode>,
pub payment: Option<Box<Payment>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub rates_extension: Option<Box<Extension>>,
pub general_rate_information_extension: Option<Box<Extension>>,
}
impl GeneralRateInformation {
const FIELDS: &'static [u32] = &[0x206bf, 0x20a10, 0x209f1, 0x2058d, 0x204ab];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x200c1);
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 {
0x206bf => { let v = r.string()?; e0.extend(v); }
0x20a10 => { let v = Some(Payment::read(r)?); r.set(&mut e1, v.map(Box::new), 2576); }
0x209f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x2058d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1421); }
0x204ab => { let v = r.raw()?; r.set(&mut e4, 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: e1,
overall_period: e2,
rates_extension: e3,
general_rate_information_extension: e4,
};
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("afac:applicableCurrency", v)?; }
if let Some(v) = &self.payment { v.write(w, "afac:payment", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "afac:overallPeriod", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("afac:_ratesExtension", v)?; }
if let Some(v) = &self.general_rate_information_extension { w.extension("afac:_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] = &[0x20876, 0x20877, 0x204c5];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x200da);
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 {
0x20876 => { let v = r.base64()?; r.set(&mut e0, v, 2166); }
0x20877 => { let v = r.enumeration::<ImageFormatEnum>()?; r.set(&mut e1, v, 2167); }
0x204c5 => { 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("afac:imageData", v)?; }
None => return Err(w.missing("afac:imageData")),
}
match &self.image_format {
Some(v) => { w.enumeration("afac:imageFormat", v.literal())?; }
None => return Err(w.missing("afac:imageFormat")),
}
if let Some(v) = &self.image_extension { w.extension("afac:_imageExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LinkedRightSpecification {
pub qualifying_right_spec: Option<Box<com::VersionedReference>>,
pub assigned_right_time_relative: Option<AssignedRightTimeRelative>,
pub linked_right_specification_extension: Option<Box<Extension>>,
}
impl LinkedRightSpecification {
const FIELDS: &'static [u32] = &[0x20a97, 0x206d0, 0x204dc];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x200f3);
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 {
0x20a97 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2711); }
0x206d0 => { let v = AssignedRightTimeRelative::read(r)?; r.set(&mut e1, v, 1744); }
0x204dc => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1244); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
qualifying_right_spec: e0,
assigned_right_time_relative: e1,
linked_right_specification_extension: e2,
};
r.close();
Ok(v)
}
}
impl LinkedRightSpecification {
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.qualifying_right_spec { v.write(w, "afac:qualifyingRightSpec", "", " targetClass=\"afac:RightSpecification\"")?; }
if let Some(v) = &self.assigned_right_time_relative { v.write(w, "afac:assignedRightTimeRelative")?; }
if let Some(v) = &self.linked_right_specification_extension { w.extension("afac:_linkedRightSpecificationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct NutsArea {
pub nuts_code_type: Option<loc::NutsCodeTypeEnum>,
pub nuts_code: Option<loc::NutsCode>,
pub nuts_area_extension: Option<Box<Extension>>,
}
impl NutsArea {
const FIELDS: &'static [u32] = &[0x20995, 0x20994, 0x2050a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20125);
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 {
0x20995 => { let v = r.enumeration::<loc::NutsCodeTypeEnum>()?; r.set(&mut e0, v, 2453); }
0x20994 => { let v = r.string()?; r.set(&mut e1, v, 2452); }
0x2050a => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1290); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2453);
r.required(&e1, 2452);
let v = Self {
nuts_code_type: e0,
nuts_code: e1,
nuts_area_extension: e2,
};
r.close();
Ok(v)
}
}
impl NutsArea {
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.nuts_code_type {
Some(v) => { w.enumeration("afac:nutsCodeType", v.literal())?; }
None => return Err(w.missing("afac:nutsCodeType")),
}
match &self.nuts_code {
Some(v) => { w.max_len("nutsCode", v, 5)?; w.leaf("afac:nutsCode", v)?; }
None => return Err(w.missing("afac:nutsCode")),
}
if let Some(v) = &self.nuts_area_extension { w.extension("afac:_nutsAreaExtension", 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] = &[0x2071f, 0x2052a, 0x20513];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2012e);
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 {
0x2071f => { let v = Some(ClosureInformation::read(r)?); r.set(&mut e0, v.map(Box::new), 1823); }
0x2052a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1322); }
0x20513 => { 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, "afac:closureInformation", "", "")?; }
if let Some(v) = &self.operating_hours_extension { w.extension("afac:_operatingHoursExtension", v)?; }
if let Some(v) = &self.open_all_hours_extension { w.extension("afac:_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] = &[0x2071f, 0x2052a, 0x209c6, 0x209c9, 0x20529];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20145);
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 {
0x2071f => { let v = Some(ClosureInformation::read(r)?); r.set(&mut e0, v.map(Box::new), 1823); }
0x2052a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1322); }
0x209c6 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e2, v.map(Box::new), 2502); }
0x209c9 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e3, v.map(Box::new), 2505); }
0x20529 => { 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, "afac:closureInformation", "", "")?; }
if let Some(v) = &self.operating_hours_extension { w.extension("afac:_operatingHoursExtension", v)?; }
match &self.operating_hours_reference {
Some(v) => { v.write(w, "afac:operatingHoursReference", "", " targetClass=\"afac:OperatingHoursSpecification\"")?; }
None => return Err(w.missing("afac:operatingHoursReference")),
}
if let Some(v) = &self.operating_hours_table_reference { v.write(w, "afac:operatingHoursTableReference", "", " targetClass=\"afac:OperatingHoursTable\"")?; }
if let Some(v) = &self.operating_hours_by_reference_extension { w.extension("afac:_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, 0x20857, 0x209c8, 0x2052b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20146);
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); }
0x20857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x209c8 => { let v = Some(OperatingHoursTable::read(r)?); e6.extend(v); }
0x2052b => { 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, "afac:headerInformation", "", "")?; }
w.count("afac:operatingHoursTable", self.operating_hours_table.len(), 1, usize::MAX)?;
for v in &self.operating_hours_table { v.write(w, "afac:operatingHoursTable", "", "")?; }
if let Some(v) = &self.operating_hours_publication_extension { w.extension("afac:_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] = &[0x2071f, 0x2052a, 0x208ba, 0x208a9, 0x209c4, 0x20c11, 0x209f1, 0x2052c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20147);
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 {
0x2071f => { let v = Some(ClosureInformation::read(r)?); r.set(&mut e0, v.map(Box::new), 1823); }
0x2052a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1322); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x208a9 => { let v = r.string()?; r.set(&mut e3, v, 2217); }
0x209c4 => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2500); }
0x20c11 => { let v = r.string()?; r.set(&mut e5, v, 3089); }
0x209f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e6, v.map(Box::new), 2545); }
0x2052c => { 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, "afac:closureInformation", "", "")?; }
if let Some(v) = &self.operating_hours_extension { w.extension("afac:_operatingHoursExtension", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.label { w.max_len("label", v, 1024)?; w.leaf("afac:label", v)?; }
if let Some(v) = &self.operating_all_year { w.leaf("afac:operatingAllYear", v)?; }
if let Some(v) = &self.url_link_address { w.leaf("afac:urlLinkAddress", v)?; }
match &self.overall_period {
Some(v) => { v.write(w, "afac:overallPeriod", "", "")?; }
None => return Err(w.missing("afac:overallPeriod")),
}
if let Some(v) = &self.operating_hours_specification_extension { w.extension("afac:_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] = &[0x20949, 0x20c4e, 0x20884, 0x209c7, 0x2052d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20148);
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 {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x20c4e => { let v = r.date_time()?; r.set(&mut e1, v, 3150); }
0x20884 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e2, v.map(Box::new), 2180); }
0x209c7 => { let v = Some(OperatingHoursSpecification::read(r)?); e3.extend(v); }
0x2052d => { 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("afac:name", v)?; }
match &self.version_time {
Some(v) => { w.leaf("afac:versionTime", v)?; }
None => return Err(w.missing("afac:versionTime")),
}
if let Some(v) = &self.information_manager { v.write(w, "afac:informationManager", "", "")?; }
w.count("afac:operatingHoursSpecification", self.operating_hours_specification.len(), 1, usize::MAX)?;
for v in &self.operating_hours_specification { v.write(w, "afac:operatingHoursSpecification", "", "")?; }
if let Some(v) = &self.operating_hours_table_extension { w.extension("afac:_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] = &[0x2083f, 0x20537, 0x209dc, 0x209df, 0x20536];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20153);
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 {
0x2083f => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e0, v.map(Box::new), 2111); }
0x20537 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1335); }
0x209dc => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e2, v.map(Box::new), 2524); }
0x209df => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e3, v.map(Box::new), 2527); }
0x20536 => { 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, "afac:generalTimeValidity", "", "")?; }
if let Some(v) = &self.organisation_extension { w.extension("afac:_organisationExtension", v)?; }
match &self.organisation_reference {
Some(v) => { v.write(w, "afac:organisationReference", "", " targetClass=\"afac:ReferenceableOrganisation\"")?; }
None => return Err(w.missing("afac:organisationReference")),
}
if let Some(v) = &self.organisation_table_reference { v.write(w, "afac:organisationTableReference", "", " targetClass=\"afac:OrganisationTable\"")?; }
if let Some(v) = &self.organisation_by_reference_extension { w.extension("afac:_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, 0x20857, 0x209de, 0x20538];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20154);
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); }
0x20857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x209de => { let v = Some(OrganisationTable::read(r)?); e6.extend(v); }
0x20538 => { 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, "afac:headerInformation", "", "")?; }
w.count("afac:organisationTable", self.organisation_table.len(), 1, usize::MAX)?;
for v in &self.organisation_table { v.write(w, "afac:organisationTable", "", "")?; }
if let Some(v) = &self.organisation_publication_extension { w.extension("afac:_organisationPublicationExtension", 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 an_organisation: Vec<AnyAnOrganisation>,
pub organisation_table_extension: Option<Box<Extension>>,
}
impl OrganisationTable {
const FIELDS: &'static [u32] = &[0x20949, 0x20c4e, 0x20884, 0x206ba, 0x2053a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20156);
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 {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x20c4e => { let v = r.date_time()?; r.set(&mut e1, v, 3150); }
0x20884 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e2, v.map(Box::new), 2180); }
0x206ba => { let v = AnyAnOrganisation::read(r)?; e3.extend(v); }
0x2053a => { 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,
an_organisation: 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("afac:name", v)?; }
match &self.version_time {
Some(v) => { w.leaf("afac:versionTime", v)?; }
None => return Err(w.missing("afac:versionTime")),
}
if let Some(v) = &self.information_manager { v.write(w, "afac:informationManager", "", "")?; }
w.count("afac:anOrganisation", self.an_organisation.len(), 1, usize::MAX)?;
for v in &self.an_organisation { v.write(w, "afac:anOrganisation")?; }
if let Some(v) = &self.organisation_table_extension { w.extension("afac:_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] = &[0x20949, 0x20836, 0x208e8, 0x20739, 0x209c5, 0x2053b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20157);
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 {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x20836 => { let v = r.multilingual()?; e1.extend(v); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e2, v, 2280); }
0x20739 => { let v = AnyContactInformation::read(r)?; e3.extend(v); }
0x209c5 => { let v = OperatingHours::read(r)?; r.set(&mut e4, v, 2501); }
0x2053b => { 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("afac:name", v)?; }
for v in &self.function { w.multilingual("afac:function", v)?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
for v in &self.contact_information { v.write(w, "afac:contactInformation")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.organisation_unit_extension { w.extension("afac:_organisationUnitExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Payment {
pub payment_mode: Vec<PaymentModeEnum>,
pub payment_means: Vec<MeansOfPaymentEnum>,
pub other_payment_means: Vec<MultilingualString>,
pub brands_accepted: Vec<PaymentBrandsEnum>,
pub other_brands_accepted: Vec<String>,
pub payment_extension: Option<Box<Extension>>,
}
impl Payment {
const FIELDS: &'static [u32] = &[0x20a14, 0x20a12, 0x209ea, 0x206fe, 0x209e5, 0x20548];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20164);
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 = Vec::new();
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20a14 => { let v = r.enumeration::<PaymentModeEnum>()?; e0.extend(v); }
0x20a12 => { let v = r.enumeration::<MeansOfPaymentEnum>()?; e1.extend(v); }
0x209ea => { let v = r.multilingual()?; e2.extend(v); }
0x206fe => { let v = r.enumeration::<PaymentBrandsEnum>()?; e3.extend(v); }
0x209e5 => { let v = r.string()?; e4.extend(v); }
0x20548 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1352); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
payment_mode: e0,
payment_means: e1,
other_payment_means: e2,
brands_accepted: e3,
other_brands_accepted: e4,
payment_extension: e5,
};
r.close();
Ok(v)
}
}
impl Payment {
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_mode { w.enumeration("afac:paymentMode", v.literal())?; }
for v in &self.payment_means { w.enumeration("afac:paymentMeans", v.literal())?; }
for v in &self.other_payment_means { w.multilingual("afac:otherPaymentMeans", v)?; }
for v in &self.brands_accepted { w.enumeration("afac:brandsAccepted", v.literal())?; }
for v in &self.other_brands_accepted { w.max_len("otherBrandsAccepted", v, 1024)?; w.leaf("afac:otherBrandsAccepted", v)?; }
if let Some(v) = &self.payment_extension { w.extension("afac:_paymentExtension", 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: Vec<Payment>,
pub vehicle_characteristics: Vec<com::VehicleCharacteristics>,
pub linked_right_specification: Option<Box<LinkedRightSpecification>>,
pub user_qualification: Vec<UserQualification>,
pub qualification_extension: Option<Box<Extension>>,
}
impl Qualification {
const FIELDS: &'static [u32] = &[0x20c7e, 0x20a85, 0x2095c, 0x20c7d, 0x20929, 0x20928, 0x20aac, 0x20684, 0x20a10, 0x20c30, 0x208d9, 0x20c1d, 0x20582];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2019f);
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 = None;
let mut e11 = Vec::new();
let mut e12 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20c7e => { let v = r.value::<bool>()?; r.set(&mut e0, v, 3198); }
0x20a85 => { let v = r.enumeration::<EnergySourceEnum>()?; e1.extend(v); }
0x2095c => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2396); }
0x20c7d => { let v = r.value::<bool>()?; r.set(&mut e3, v, 3197); }
0x20929 => { let v = r.multilingual()?; e4.extend(v); }
0x20928 => { let v = r.value::<bool>()?; r.set(&mut e5, v, 2344); }
0x20aac => { let v = Some(com::VersionedReference::read(r)?); e6.extend(v); }
0x20684 => { let v = r.string()?; r.set(&mut e7, v, 1668); }
0x20a10 => { let v = Some(Payment::read(r)?); e8.extend(v); }
0x20c30 => { let v = Some(com::VehicleCharacteristics::read(r)?); e9.extend(v); }
0x208d9 => { let v = Some(LinkedRightSpecification::read(r)?); r.set(&mut e10, v.map(Box::new), 2265); }
0x20c1d => { let v = Some(UserQualification::read(r)?); e11.extend(v); }
0x20582 => { let v = r.raw()?; r.set(&mut e12, 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: e8,
vehicle_characteristics: e9,
linked_right_specification: e10,
user_qualification: e11,
qualification_extension: e12,
};
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("afac:withReservation", v)?; }
for v in &self.propulsion_energy_type { w.enumeration("afac:propulsionEnergyType", v.literal())?; }
if let Some(v) = &self.no_fee_to_use { w.leaf("afac:noFeeToUse", v)?; }
if let Some(v) = &self.with_membership { w.leaf("afac:withMembership", v)?; }
for v in &self.membership_name { w.multilingual("afac:membershipName", v)?; }
if let Some(v) = &self.member_of_other_rate_table { w.leaf("afac:memberOfOtherRateTable", v)?; }
for v in &self.rate_table_member { v.write(w, "afac:rateTableMember", "", " targetClass=\"afac:RateTable\"")?; }
if let Some(v) = &self.active_assigned_right { w.max_len("activeAssignedRight", v, 1024)?; w.leaf("afac:activeAssignedRight", v)?; }
for v in &self.payment { v.write(w, "afac:payment", "", "")?; }
for v in &self.vehicle_characteristics { v.write(w, "afac:vehicleCharacteristics", "", "")?; }
if let Some(v) = &self.linked_right_specification { v.write(w, "afac:linkedRightSpecification", "", "")?; }
for v in &self.user_qualification { v.write(w, "afac:userQualification", "", "")?; }
if let Some(v) = &self.qualification_extension { w.extension("afac:_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] = &[0x20793, 0x20823, 0x20583];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201a0);
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 {
0x20793 => { let v = r.value::<f32>()?; r.set(&mut e0, v, 1939); }
0x20823 => { let v = Some(AmountInCurrency::read(r)?); r.set(&mut e1, v.map(Box::new), 2083); }
0x20583 => { 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("afac:discountRate", v)?; }
if let Some(v) = &self.fixed_value { v.write(w, "afac:fixedValue", "", "")?; }
if let Some(v) = &self.rate_discount_extension { w.extension("afac:_rateDiscountExtension", 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<RateLineUsageConditionsTypeEnum>,
pub usage_duration_limitation: Option<Duration>,
pub usage_count_limitation: Option<com::NonNegativeInteger>,
pub surcharge: Vec<Surcharge>,
pub rate_line_tax: Vec<RateLineTax>,
pub rate_line_extension: Option<Box<Extension>>,
}
impl RateLine {
const FIELDS: &'static [u32] = &[0x20aa3, 0x20777, 0x207ac, 0x207ab, 0x20880, 0x20c2c, 0x20933, 0x20903, 0x20c17, 0x20c19, 0x20c18, 0x20b98, 0x20aa2, 0x20586];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201a2);
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 = None;
let mut e10 = None;
let mut e11 = Vec::new();
let mut e12 = Vec::new();
let mut e13 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20aa3 => { let v = r.enumeration::<RateLineTypeEnum>()?; r.set(&mut e0, v, 2723); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e1, v, 1911); }
0x207ac => { let v = r.value::<Time>()?; r.set(&mut e2, v, 1964); }
0x207ab => { let v = r.value::<Time>()?; r.set(&mut e3, v, 1963); }
0x20880 => { let v = r.string()?; r.set(&mut e4, v, 2176); }
0x20c2c => { let v = r.value::<Decimal>()?; r.set(&mut e5, v, 3116); }
0x20933 => { let v = r.value::<Decimal>()?; r.set(&mut e6, v, 2355); }
0x20903 => { let v = r.value::<Decimal>()?; r.set(&mut e7, v, 2307); }
0x20c17 => { let v = r.enumeration::<RateLineUsageConditionsTypeEnum>()?; r.set(&mut e8, v, 3095); }
0x20c19 => { let v = r.string()?; r.set(&mut e9, v, 3097); }
0x20c18 => { let v = r.value::<u64>()?; r.set(&mut e10, v, 3096); }
0x20b98 => { let v = Some(Surcharge::read(r)?); e11.extend(v); }
0x20aa2 => { let v = Some(RateLineTax::read(r)?); e12.extend(v); }
0x20586 => { let v = r.raw()?; r.set(&mut e13, 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,
usage_duration_limitation: e9,
usage_count_limitation: e10,
surcharge: e11,
rate_line_tax: e12,
rate_line_extension: e13,
};
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("afac:rateLineType", v.literal())?; }
None => return Err(w.missing("afac:rateLineType")),
}
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
if let Some(v) = &self.duration_start { w.leaf("afac:durationStart", v)?; }
if let Some(v) = &self.duration_end { w.leaf("afac:durationEnd", v)?; }
if let Some(v) = &self.increment_period { w.pattern("incrementPeriod", v, Pattern::Duration)?; w.leaf("afac:incrementPeriod", v)?; }
match &self.value {
Some(v) => { w.digits("value", v, 8, 2)?; w.leaf("afac:value", v)?; }
None => return Err(w.missing("afac:value")),
}
if let Some(v) = &self.min_value { w.digits("minValue", v, 8, 2)?; w.leaf("afac:minValue", v)?; }
if let Some(v) = &self.max_value { w.digits("maxValue", v, 8, 2)?; w.leaf("afac:maxValue", v)?; }
if let Some(v) = &self.usage_condition { w.enumeration("afac:usageCondition", v.literal())?; }
if let Some(v) = &self.usage_duration_limitation { w.pattern("usageDurationLimitation", v, Pattern::Duration)?; w.leaf("afac:usageDurationLimitation", v)?; }
if let Some(v) = &self.usage_count_limitation { w.leaf("afac:usageCountLimitation", v)?; }
for v in &self.surcharge { v.write(w, "afac:surcharge", "", "")?; }
for v in &self.rate_line_tax { v.write(w, "afac:rateLineTax", "", "")?; }
if let Some(v) = &self.rate_line_extension { w.extension("afac:_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] = &[0x206bf, 0x20934, 0x20904, 0x20c24, 0x20c22, 0x20932, 0x20902, 0x20ae5, 0x20ba1, 0x20ba2, 0x20ba3, 0x20ad6, 0x20aa0, 0x20585];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201a3);
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 {
0x206bf => { let v = r.string()?; r.set(&mut e0, v, 1727); }
0x20934 => { let v = r.value::<Decimal>()?; r.set(&mut e1, v, 2356); }
0x20904 => { let v = r.value::<Decimal>()?; r.set(&mut e2, v, 2308); }
0x20c24 => { let v = r.date_time()?; r.set(&mut e3, v, 3108); }
0x20c22 => { let v = r.date_time()?; r.set(&mut e4, v, 3106); }
0x20932 => { let v = r.string()?; r.set(&mut e5, v, 2354); }
0x20902 => { let v = r.string()?; r.set(&mut e6, v, 2306); }
0x20ae5 => { let v = r.value::<Time>()?; r.set(&mut e7, v, 2789); }
0x20ba1 => { let v = r.value::<bool>()?; r.set(&mut e8, v, 2977); }
0x20ba2 => { let v = r.value::<f32>()?; r.set(&mut e9, v, 2978); }
0x20ba3 => { let v = r.value::<Decimal>()?; r.set(&mut e10, v, 2979); }
0x20ad6 => { let v = r.value::<bool>()?; r.set(&mut e11, v, 2774); }
0x20aa0 => { let v = Some(RateLine::read(r)?); e12.extend(v); }
0x20585 => { 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("afac:applicableCurrency", v)?; }
if let Some(v) = &self.min_value_collection { w.digits("minValueCollection", v, 8, 2)?; w.leaf("afac:minValueCollection", v)?; }
if let Some(v) = &self.max_value_collection { w.digits("maxValueCollection", v, 8, 2)?; w.leaf("afac:maxValueCollection", v)?; }
if let Some(v) = &self.valid_start { w.leaf("afac:validStart", v)?; }
if let Some(v) = &self.valid_end { w.leaf("afac:validEnd", v)?; }
if let Some(v) = &self.min_time { w.pattern("minTime", v, Pattern::Duration)?; w.leaf("afac:minTime", v)?; }
if let Some(v) = &self.max_time { w.pattern("maxTime", v, Pattern::Duration)?; w.leaf("afac:maxTime", v)?; }
if let Some(v) = &self.reset_time { w.leaf("afac:resetTime", v)?; }
if let Some(v) = &self.tax_included { w.leaf("afac:taxIncluded", v)?; }
if let Some(v) = &self.tax_rate { w.leaf("afac:taxRate", v)?; }
if let Some(v) = &self.tax_value { w.digits("taxValue", v, 8, 2)?; w.leaf("afac:taxValue", v)?; }
if let Some(v) = &self.relative_times { w.leaf("afac:relativeTimes", v)?; }
w.count("afac:rateLine", self.rate_line.len(), 1, usize::MAX)?;
for v in &self.rate_line { v.write(w, "afac:rateLine", "", "")?; }
if let Some(v) = &self.rate_line_collection_extension { w.extension("afac:_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] = &[0x20ba3, 0x20ba2, 0x20ba1, 0x20bf8, 0x208aa, 0x20587];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201a4);
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 {
0x20ba3 => { let v = r.value::<Decimal>()?; r.set(&mut e0, v, 2979); }
0x20ba2 => { let v = r.value::<f32>()?; r.set(&mut e1, v, 2978); }
0x20ba1 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 2977); }
0x20bf8 => { let v = r.multilingual()?; r.set(&mut e3, v, 3064); }
0x208aa => { let v = r.multilingual()?; r.set(&mut e4, v, 2218); }
0x20587 => { 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("afac:taxValue", v)?; }
if let Some(v) = &self.tax_rate { w.leaf("afac:taxRate", v)?; }
match &self.tax_included {
Some(v) => { w.leaf("afac:taxIncluded", v)?; }
None => return Err(w.missing("afac:taxIncluded")),
}
if let Some(v) = &self.trigger { w.multilingual("afac:trigger", v)?; }
if let Some(v) = &self.label_for_display { w.multilingual("afac:labelForDisplay", v)?; }
if let Some(v) = &self.rate_line_tax_extension { w.extension("afac:_rateLineTaxExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RateMatrix {
pub id: Option<String>,
pub version: Option<String>,
pub applicable_currency: Vec<CurrencyCode>,
pub payment: Option<Box<Payment>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub rates_extension: Option<Box<Extension>>,
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] = &[0x206bf, 0x20a10, 0x209f1, 0x2058d, 0x20949, 0x20777, 0x20c4e, 0x20884, 0x20aab, 0x20589];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201a5);
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 = None;
let mut e8 = Vec::new();
let mut e9 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x206bf => { let v = r.string()?; e0.extend(v); }
0x20a10 => { let v = Some(Payment::read(r)?); r.set(&mut e1, v.map(Box::new), 2576); }
0x209f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x2058d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1421); }
0x20949 => { let v = r.multilingual()?; r.set(&mut e4, v, 2377); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e5, v, 1911); }
0x20c4e => { let v = r.date_time()?; r.set(&mut e6, v, 3150); }
0x20884 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e7, v.map(Box::new), 2180); }
0x20aab => { let v = Some(RateTable::read(r)?); e8.extend(v); }
0x20589 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1417); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e6, 3150);
let v = Self {
id: a0,
version: a1,
applicable_currency: e0,
payment: e1,
overall_period: e2,
rates_extension: e3,
name: e4,
description: e5,
version_time: e6,
information_manager: e7,
rate_table: e8,
rate_matrix_extension: e9,
};
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")),
}
for v in &self.applicable_currency { w.max_len("applicableCurrency", v, 1024)?; w.pattern("applicableCurrency", v, Pattern::CurrencyCode)?; w.leaf("afac:applicableCurrency", v)?; }
if let Some(v) = &self.payment { v.write(w, "afac:payment", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "afac:overallPeriod", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("afac:_ratesExtension", v)?; }
if let Some(v) = &self.name { w.multilingual("afac:name", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
match &self.version_time {
Some(v) => { w.leaf("afac:versionTime", v)?; }
None => return Err(w.missing("afac:versionTime")),
}
if let Some(v) = &self.information_manager { v.write(w, "afac:informationManager", "", "")?; }
w.count("afac:rateTable", self.rate_table.len(), 1, usize::MAX)?;
for v in &self.rate_table { v.write(w, "afac:rateTable", "", "")?; }
if let Some(v) = &self.rate_matrix_extension { w.extension("afac:_rateMatrixExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RateMatrixByReference {
pub applicable_currency: Vec<CurrencyCode>,
pub payment: Option<Box<Payment>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub rates_extension: Option<Box<Extension>>,
pub rate_table_reference: Option<Box<com::VersionedReference>>,
pub rate_matrix_by_reference_extension: Option<Box<Extension>>,
}
impl RateMatrixByReference {
const FIELDS: &'static [u32] = &[0x206bf, 0x20a10, 0x209f1, 0x2058d, 0x20aae, 0x20588];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201a6);
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 {
0x206bf => { let v = r.string()?; e0.extend(v); }
0x20a10 => { let v = Some(Payment::read(r)?); r.set(&mut e1, v.map(Box::new), 2576); }
0x209f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x2058d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1421); }
0x20aae => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e4, v.map(Box::new), 2734); }
0x20588 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1416); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2734);
let v = Self {
applicable_currency: e0,
payment: e1,
overall_period: e2,
rates_extension: e3,
rate_table_reference: e4,
rate_matrix_by_reference_extension: e5,
};
r.close();
Ok(v)
}
}
impl RateMatrixByReference {
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("afac:applicableCurrency", v)?; }
if let Some(v) = &self.payment { v.write(w, "afac:payment", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "afac:overallPeriod", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("afac:_ratesExtension", v)?; }
match &self.rate_table_reference {
Some(v) => { v.write(w, "afac:rateTableReference", "", " targetClass=\"afac:RateMatrix\"")?; }
None => return Err(w.missing("afac:rateTableReference")),
}
if let Some(v) = &self.rate_matrix_by_reference_extension { w.extension("afac:_rateMatrixByReferenceExtension", 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: Option<Box<Payment>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
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 eligibility: Option<Box<Eligibility>>,
pub rate_table_extension: Option<Box<Extension>>,
}
impl RateTable {
const FIELDS: &'static [u32] = &[0x206bf, 0x20a10, 0x209f1, 0x2058d, 0x208ba, 0x20aad, 0x20685, 0x206dc, 0x20aa9, 0x20aaa, 0x20c25, 0x20aaf, 0x20c29, 0x20c28, 0x20690, 0x20aa1, 0x207bd, 0x2058b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201a7);
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 = Vec::new();
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;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x206bf => { let v = r.string()?; e0.extend(v); }
0x20a10 => { let v = Some(Payment::read(r)?); r.set(&mut e1, v.map(Box::new), 2576); }
0x209f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x2058d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1421); }
0x208ba => { let v = r.date_time()?; r.set(&mut e4, v, 2234); }
0x20aad => { let v = r.multilingual()?; r.set(&mut e5, v, 2733); }
0x20685 => { let v = r.string()?; e6.extend(v); }
0x206dc => { let v = r.enumeration::<RateAvailabilityTypeEnum>()?; r.set(&mut e7, v, 1756); }
0x20aa9 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e8, v.map(Box::new), 2729); }
0x20aaa => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e9, v.map(Box::new), 2730); }
0x20c25 => { let v = r.value::<bool>()?; r.set(&mut e10, v, 3109); }
0x20aaf => { let v = r.enumeration::<RateTypeEnum>()?; r.set(&mut e11, v, 2735); }
0x20c29 => { let v = r.date_time()?; r.set(&mut e12, v, 3113); }
0x20c28 => { let v = r.date_time()?; r.set(&mut e13, v, 3112); }
0x20690 => { let v = r.string()?; r.set(&mut e14, v, 1680); }
0x20aa1 => { let v = AnyRateLineCollection::read(r)?; e15.extend(v); }
0x207bd => { let v = Some(Eligibility::read(r)?); r.set(&mut e16, v.map(Box::new), 1981); }
0x2058b => { let v = r.raw()?; r.set(&mut e17, 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: e1,
overall_period: e2,
rates_extension: e3,
last_updated: e4,
rate_table_name: e5,
active_times: e6,
availability: e7,
rate_responsible_party: e8,
rate_supersede_link: e9,
validation: e10,
rate_type: e11,
validity_start: e12,
validity_end: e13,
additional_information: e14,
rate_line_collection: e15,
eligibility: e16,
rate_table_extension: e17,
};
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("afac:applicableCurrency", v)?; }
if let Some(v) = &self.payment { v.write(w, "afac:payment", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "afac:overallPeriod", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("afac:_ratesExtension", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.rate_table_name { w.multilingual("afac:rateTableName", v)?; }
for v in &self.active_times { w.pattern("activeTimes", v, Pattern::Duration)?; w.leaf("afac:activeTimes", v)?; }
if let Some(v) = &self.availability { w.enumeration("afac:availability", v.literal())?; }
if let Some(v) = &self.rate_responsible_party { v.write(w, "afac:rateResponsibleParty", "", " targetClass=\"afac:ReferenceableOrganisation\"")?; }
if let Some(v) = &self.rate_supersede_link { v.write(w, "afac:rateSupersedeLink", "", " targetClass=\"afac:RateTable\"")?; }
if let Some(v) = &self.validation { w.leaf("afac:validation", v)?; }
if let Some(v) = &self.rate_type { w.enumeration("afac:rateType", v.literal())?; }
if let Some(v) = &self.validity_start { w.leaf("afac:validityStart", v)?; }
if let Some(v) = &self.validity_end { w.leaf("afac:validityEnd", v)?; }
if let Some(v) = &self.additional_information { w.leaf("afac:additionalInformation", v)?; }
for v in &self.rate_line_collection { v.write(w, "afac:rateLineCollection")?; }
if let Some(v) = &self.eligibility { v.write(w, "afac:eligibility", "", "")?; }
if let Some(v) = &self.rate_table_extension { w.extension("afac:_rateTableExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RateTableByReference {
pub applicable_currency: Vec<CurrencyCode>,
pub payment: Option<Box<Payment>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub rates_extension: Option<Box<Extension>>,
pub rate_reference: Option<Box<com::VersionedReference>>,
pub rate_table_by_reference_extension: Option<Box<Extension>>,
}
impl RateTableByReference {
const FIELDS: &'static [u32] = &[0x206bf, 0x20a10, 0x209f1, 0x2058d, 0x20aa8, 0x2058a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201a8);
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 {
0x206bf => { let v = r.string()?; e0.extend(v); }
0x20a10 => { let v = Some(Payment::read(r)?); r.set(&mut e1, v.map(Box::new), 2576); }
0x209f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x2058d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1421); }
0x20aa8 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e4, v.map(Box::new), 2728); }
0x2058a => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1418); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2728);
let v = Self {
applicable_currency: e0,
payment: e1,
overall_period: e2,
rates_extension: e3,
rate_reference: e4,
rate_table_by_reference_extension: e5,
};
r.close();
Ok(v)
}
}
impl RateTableByReference {
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("afac:applicableCurrency", v)?; }
if let Some(v) = &self.payment { v.write(w, "afac:payment", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "afac:overallPeriod", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("afac:_ratesExtension", v)?; }
match &self.rate_reference {
Some(v) => { v.write(w, "afac:rateReference", "", " targetClass=\"afac:RateTable\"")?; }
None => return Err(w.missing("afac:rateReference")),
}
if let Some(v) = &self.rate_table_by_reference_extension { w.extension("afac:_rateTableByReferenceExtension", 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, 0x20857, 0x20aa4, 0x2058e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201ab);
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); }
0x20857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x20aa4 => { let v = Some(RateMatrix::read(r)?); e6.extend(v); }
0x2058e => { 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, "afac:headerInformation", "", "")?; }
w.count("afac:rateMatrix", self.rate_matrix.len(), 1, usize::MAX)?;
for v in &self.rate_matrix { v.write(w, "afac:rateMatrix", "", "")?; }
if let Some(v) = &self.rates_publication_extension { w.extension("afac:_ratesPublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ReferenceableOrganisation {
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 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 external_identifier: Vec<ExternalIdentifier>,
pub sub_organisation: Vec<Organisation>,
pub an_organisation_extension: Option<Box<Extension>>,
pub referenceable_organisation_extension: Option<Box<Extension>>,
}
impl ReferenceableOrganisation {
const FIELDS: &'static [u32] = &[0x2083f, 0x20537, 0x208ba, 0x20949, 0x208c3, 0x20777, 0x208d6, 0x208d7, 0x208d8, 0x206dd, 0x20aed, 0x20a95, 0x20bfe, 0x20950, 0x20951, 0x20c2e, 0x209e0, 0x20805, 0x20b89, 0x2041e, 0x20590];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201ae);
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 = Vec::new();
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 = Vec::new();
let mut e18 = Vec::new();
let mut e19 = None;
let mut e20 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x2083f => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e0, v.map(Box::new), 2111); }
0x20537 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1335); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20949 => { let v = r.multilingual()?; r.set(&mut e3, v, 2377); }
0x208c3 => { let v = r.multilingual()?; r.set(&mut e4, v, 2243); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e5, v, 1911); }
0x208d6 => { let v = r.string()?; r.set(&mut e6, v, 2262); }
0x208d7 => { let v = r.string()?; r.set(&mut e7, v, 2263); }
0x208d8 => { let v = r.string()?; r.set(&mut e8, v, 2264); }
0x206dd => { let v = r.value::<bool>()?; r.set(&mut e9, v, 1757); }
0x20aed => { let v = r.multilingual()?; e10.extend(v); }
0x20a95 => { let v = r.value::<bool>()?; r.set(&mut e11, v, 2709); }
0x20bfe => { let v = r.enumeration::<OrganisationTypeEnum>()?; r.set(&mut e12, v, 3070); }
0x20950 => { let v = r.string()?; r.set(&mut e13, v, 2384); }
0x20951 => { let v = r.string()?; r.set(&mut e14, v, 2385); }
0x20c2e => { let v = r.string()?; r.set(&mut e15, v, 3118); }
0x209e0 => { let v = Some(OrganisationUnit::read(r)?); e16.extend(v); }
0x20805 => { let v = Some(ExternalIdentifier::read(r)?); e17.extend(v); }
0x20b89 => { let v = Organisation::read(r)?; e18.extend(v); }
0x2041e => { let v = r.raw()?; r.set(&mut e19, v.map(Box::new), 1054); }
0x20590 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1424); }
_ => 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,
legal_name: e4,
description: e5,
link_to_general_information: e6,
link_to_logo: e7,
link_to_webform: e8,
available24hours: e9,
responsibility: e10,
publishing_agreement: e11,
r#type: e12,
national_organisation_number: e13,
national_register: e14,
vat_identification_number: e15,
organisation_unit: e16,
external_identifier: e17,
sub_organisation: e18,
an_organisation_extension: e19,
referenceable_organisation_extension: e20,
};
r.close();
Ok(v)
}
}
impl ReferenceableOrganisation {
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, "afac:generalTimeValidity", "", "")?; }
if let Some(v) = &self.organisation_extension { w.extension("afac:_organisationExtension", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
match &self.name {
Some(v) => { w.multilingual("afac:name", v)?; }
None => return Err(w.missing("afac:name")),
}
if let Some(v) = &self.legal_name { w.multilingual("afac:legalName", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
if let Some(v) = &self.link_to_general_information { w.leaf("afac:linkToGeneralInformation", v)?; }
if let Some(v) = &self.link_to_logo { w.leaf("afac:linkToLogo", v)?; }
if let Some(v) = &self.link_to_webform { w.leaf("afac:linkToWebform", v)?; }
if let Some(v) = &self.available24hours { w.leaf("afac:available24hours", v)?; }
for v in &self.responsibility { w.multilingual("afac:responsibility", v)?; }
if let Some(v) = &self.publishing_agreement { w.leaf("afac:publishingAgreement", v)?; }
if let Some(v) = &self.r#type { w.enumeration("afac:type", v.literal())?; }
if let Some(v) = &self.national_organisation_number { w.max_len("nationalOrganisationNumber", v, 1024)?; w.leaf("afac:nationalOrganisationNumber", v)?; }
if let Some(v) = &self.national_register { w.max_len("nationalRegister", v, 1024)?; w.leaf("afac:nationalRegister", v)?; }
if let Some(v) = &self.vat_identification_number { w.max_len("vatIdentificationNumber", v, 1024)?; w.leaf("afac:vatIdentificationNumber", v)?; }
for v in &self.organisation_unit { v.write(w, "afac:organisationUnit", "", "")?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.sub_organisation { v.write(w, "afac:subOrganisation")?; }
if let Some(v) = &self.an_organisation_extension { w.extension("afac:_anOrganisationExtension", v)?; }
if let Some(v) = &self.referenceable_organisation_extension { w.extension("afac:_referenceableOrganisationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RelativeOffsets {
pub assigned_right_time_relative_extension: Option<Box<Extension>>,
pub earliest_start_relative: Option<Duration>,
pub latest_start_relative: Option<Duration>,
pub earliest_end_relative: Option<Duration>,
pub latest_end_relative: Option<Duration>,
pub relative_offsets_extension: Option<Box<Extension>>,
}
impl RelativeOffsets {
const FIELDS: &'static [u32] = &[0x20423, 0x207b6, 0x208be, 0x207b4, 0x208bc, 0x20597];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201b5);
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 {
0x20423 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1059); }
0x207b6 => { let v = r.string()?; r.set(&mut e1, v, 1974); }
0x208be => { let v = r.string()?; r.set(&mut e2, v, 2238); }
0x207b4 => { let v = r.string()?; r.set(&mut e3, v, 1972); }
0x208bc => { let v = r.string()?; r.set(&mut e4, v, 2236); }
0x20597 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1431); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
assigned_right_time_relative_extension: e0,
earliest_start_relative: e1,
latest_start_relative: e2,
earliest_end_relative: e3,
latest_end_relative: e4,
relative_offsets_extension: e5,
};
r.close();
Ok(v)
}
}
impl RelativeOffsets {
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.assigned_right_time_relative_extension { w.extension("afac:_assignedRightTimeRelativeExtension", v)?; }
if let Some(v) = &self.earliest_start_relative { w.pattern("earliestStartRelative", v, Pattern::Duration)?; w.leaf("afac:earliestStartRelative", v)?; }
if let Some(v) = &self.latest_start_relative { w.pattern("latestStartRelative", v, Pattern::Duration)?; w.leaf("afac:latestStartRelative", v)?; }
if let Some(v) = &self.earliest_end_relative { w.pattern("earliestEndRelative", v, Pattern::Duration)?; w.leaf("afac:earliestEndRelative", v)?; }
if let Some(v) = &self.latest_end_relative { w.pattern("latestEndRelative", v, Pattern::Duration)?; w.leaf("afac:latestEndRelative", v)?; }
if let Some(v) = &self.relative_offsets_extension { w.extension("afac:_relativeOffsetsExtension", 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] = &[0x206bf, 0x20934, 0x20904, 0x20c24, 0x20c22, 0x20932, 0x20902, 0x20ae5, 0x20ba1, 0x20ba2, 0x20ba3, 0x20ad6, 0x20aa0, 0x20585, 0x20abd, 0x20abc, 0x20598];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201b6);
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 {
0x206bf => { let v = r.string()?; r.set(&mut e0, v, 1727); }
0x20934 => { let v = r.value::<Decimal>()?; r.set(&mut e1, v, 2356); }
0x20904 => { let v = r.value::<Decimal>()?; r.set(&mut e2, v, 2308); }
0x20c24 => { let v = r.date_time()?; r.set(&mut e3, v, 3108); }
0x20c22 => { let v = r.date_time()?; r.set(&mut e4, v, 3106); }
0x20932 => { let v = r.string()?; r.set(&mut e5, v, 2354); }
0x20902 => { let v = r.string()?; r.set(&mut e6, v, 2306); }
0x20ae5 => { let v = r.value::<Time>()?; r.set(&mut e7, v, 2789); }
0x20ba1 => { let v = r.value::<bool>()?; r.set(&mut e8, v, 2977); }
0x20ba2 => { let v = r.value::<f32>()?; r.set(&mut e9, v, 2978); }
0x20ba3 => { let v = r.value::<Decimal>()?; r.set(&mut e10, v, 2979); }
0x20ad6 => { let v = r.value::<bool>()?; r.set(&mut e11, v, 2774); }
0x20aa0 => { let v = Some(RateLine::read(r)?); e12.extend(v); }
0x20585 => { let v = r.raw()?; r.set(&mut e13, v.map(Box::new), 1413); }
0x20abd => { let v = r.date_time()?; r.set(&mut e14, v, 2749); }
0x20abc => { let v = r.date_time()?; r.set(&mut e15, v, 2748); }
0x20598 => { 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("afac:applicableCurrency", v)?; }
if let Some(v) = &self.min_value_collection { w.digits("minValueCollection", v, 8, 2)?; w.leaf("afac:minValueCollection", v)?; }
if let Some(v) = &self.max_value_collection { w.digits("maxValueCollection", v, 8, 2)?; w.leaf("afac:maxValueCollection", v)?; }
if let Some(v) = &self.valid_start { w.leaf("afac:validStart", v)?; }
if let Some(v) = &self.valid_end { w.leaf("afac:validEnd", v)?; }
if let Some(v) = &self.min_time { w.pattern("minTime", v, Pattern::Duration)?; w.leaf("afac:minTime", v)?; }
if let Some(v) = &self.max_time { w.pattern("maxTime", v, Pattern::Duration)?; w.leaf("afac:maxTime", v)?; }
if let Some(v) = &self.reset_time { w.leaf("afac:resetTime", v)?; }
if let Some(v) = &self.tax_included { w.leaf("afac:taxIncluded", v)?; }
if let Some(v) = &self.tax_rate { w.leaf("afac:taxRate", v)?; }
if let Some(v) = &self.tax_value { w.digits("taxValue", v, 8, 2)?; w.leaf("afac:taxValue", v)?; }
if let Some(v) = &self.relative_times { w.leaf("afac:relativeTimes", v)?; }
w.count("afac:rateLine", self.rate_line.len(), 1, usize::MAX)?;
for v in &self.rate_line { v.write(w, "afac:rateLine", "", "")?; }
if let Some(v) = &self.rate_line_collection_extension { w.extension("afac:_rateLineCollectionExtension", v)?; }
if let Some(v) = &self.reference_time_start { w.leaf("afac:referenceTimeStart", v)?; }
if let Some(v) = &self.reference_time_end { w.leaf("afac:referenceTimeEnd", v)?; }
if let Some(v) = &self.relative_time_rates_extension { w.extension("afac:_relativeTimeRatesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RightSpecification {
pub id: Option<String>,
pub version: Option<String>,
pub r#type: Option<RightTypeEnum>,
pub description: Vec<MultilingualString>,
pub financial_reference: Option<String>,
pub issuer: Option<Box<com::VersionedReference>>,
pub transferable: Option<com::Boolean>,
pub transferable_conditions: Option<MultilingualString>,
pub credential: Vec<AnyCredential>,
pub validity: Option<Box<com::Validity>>,
pub right_specification_extension: Option<Box<Extension>>,
}
impl RightSpecification {
const FIELDS: &'static [u32] = &[0x20bfe, 0x20777, 0x20820, 0x2089e, 0x20bed, 0x20bee, 0x2074e, 0x20c26, 0x205a1];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201c0);
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 = 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 {
0x20bfe => { let v = r.enumeration::<RightTypeEnum>()?; r.set(&mut e0, v, 3070); }
0x20777 => { let v = r.multilingual()?; e1.extend(v); }
0x20820 => { let v = r.string()?; r.set(&mut e2, v, 2080); }
0x2089e => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e3, v.map(Box::new), 2206); }
0x20bed => { let v = r.value::<bool>()?; r.set(&mut e4, v, 3053); }
0x20bee => { let v = r.multilingual()?; r.set(&mut e5, v, 3054); }
0x2074e => { let v = AnyCredential::read(r)?; e6.extend(v); }
0x20c26 => { let v = Some(com::Validity::read(r)?); r.set(&mut e7, v.map(Box::new), 3110); }
0x205a1 => { 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 {
id: a0,
version: a1,
r#type: e0,
description: e1,
financial_reference: e2,
issuer: e3,
transferable: e4,
transferable_conditions: 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)?;
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.r#type { w.enumeration("afac:type", v.literal())?; }
for v in &self.description { w.multilingual("afac:description", v)?; }
if let Some(v) = &self.financial_reference { w.max_len("financialReference", v, 1024)?; w.leaf("afac:financialReference", v)?; }
if let Some(v) = &self.issuer { v.write(w, "afac:issuer", "", " targetClass=\"afac:ReferenceableOrganisation\"")?; }
if let Some(v) = &self.transferable { w.leaf("afac:transferable", v)?; }
if let Some(v) = &self.transferable_conditions { w.multilingual("afac:transferableConditions", v)?; }
for v in &self.credential { v.write(w, "afac:credential")?; }
if let Some(v) = &self.validity { v.write(w, "afac:validity", "", "")?; }
if let Some(v) = &self.right_specification_extension { w.extension("afac:_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 last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub external_identifier: Vec<ExternalIdentifier>,
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 helpdesk: Option<Organisation>,
pub associated_facility: Vec<AnyAssociatedFacility>,
pub rates: Option<Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<Dimension>>,
pub amenities: Option<Box<Amenities>>,
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 nearby: Option<com::Boolean>,
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] = &[0x20949, 0x206ad, 0x208ba, 0x20777, 0x2066b, 0x20690, 0x20805, 0x20887, 0x20a2d, 0x20a2c, 0x209c5, 0x208e8, 0x209f8, 0x209d2, 0x20864, 0x206d3, 0x20ab0, 0x206c6, 0x20786, 0x206b8, 0x20497, 0x206dc, 0x20a98, 0x20acc, 0x206c5, 0x20954, 0x205dc, 0x207ea, 0x205db];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201fc);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = None;
let mut e22 = None;
let mut e23 = None;
let mut e24 = Vec::new();
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x206ad => { let v = r.multilingual()?; e1.extend(v); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x2066b => { let v = r.enumeration::<AccessibilityEnum>()?; e4.extend(v); }
0x20690 => { let v = r.multilingual()?; e5.extend(v); }
0x20805 => { let v = Some(ExternalIdentifier::read(r)?); e6.extend(v); }
0x20887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x20a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x20a2c => { let v = Some(Image::read(r)?); e9.extend(v); }
0x209c5 => { let v = OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x209f8 => { let v = Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x209d2 => { let v = Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x20864 => { let v = Organisation::read(r)?; r.set(&mut e14, v, 2148); }
0x206d3 => { let v = AnyAssociatedFacility::read(r)?; e15.extend(v); }
0x20ab0 => { let v = Rates::read(r)?; r.set(&mut e16, v, 2736); }
0x206c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e17.extend(v); }
0x20786 => { let v = Some(Dimension::read(r)?); r.set(&mut e18, v.map(Box::new), 1926); }
0x206b8 => { let v = Some(Amenities::read(r)?); r.set(&mut e19, v.map(Box::new), 1720); }
0x20497 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1175); }
0x206dc => { let v = r.enumeration::<AvailabilityEnum>()?; r.set(&mut e21, v, 1756); }
0x20a98 => { let v = r.value::<u64>()?; r.set(&mut e22, v, 2712); }
0x20acc => { let v = r.value::<bool>()?; r.set(&mut e23, v, 2764); }
0x206c5 => { let v = r.enumeration::<UserTypeEnum>()?; e24.extend(v); }
0x20954 => { let v = r.value::<bool>()?; r.set(&mut e25, v, 2388); }
0x205dc => { let v = r.raw()?; r.set(&mut e26, v.map(Box::new), 1500); }
0x207ea => { let v = r.enumeration::<EquipmentTypeEnum>()?; r.set(&mut e27, v, 2026); }
0x205db => { let v = r.raw()?; r.set(&mut e28, v.map(Box::new), 1499); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e27, 2026);
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
last_updated: e2,
description: e3,
accessibility: e4,
additional_information: e5,
external_identifier: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
helpdesk: e14,
associated_facility: e15,
rates: e16,
applicable_for_vehicles: e17,
dimension: e18,
amenities: e19,
facility_object_extension: e20,
availability: e21,
quantity: e22,
regularly_cleaned: e23,
applicable_for_user: e24,
nearby: e25,
supplemental_facility_extension: e26,
equipment_type: e27,
supplemental_equipment_extension: e28,
};
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("afac:name", v)?; }
for v in &self.alias { w.multilingual("afac:alias", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
for v in &self.accessibility { w.enumeration("afac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("afac:additionalInformation", v)?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.information_website { v.write(w, "afac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "afac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "afac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "afac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "afac:operator")?; }
if let Some(v) = &self.helpdesk { v.write(w, "afac:helpdesk")?; }
for v in &self.associated_facility { v.write(w, "afac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "afac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "afac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "afac:dimension", "", "")?; }
if let Some(v) = &self.amenities { v.write(w, "afac:amenities", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("afac:_facilityObjectExtension", v)?; }
if let Some(v) = &self.availability { w.enumeration("afac:availability", v.literal())?; }
if let Some(v) = &self.quantity { w.leaf("afac:quantity", v)?; }
if let Some(v) = &self.regularly_cleaned { w.leaf("afac:regularlyCleaned", v)?; }
for v in &self.applicable_for_user { w.enumeration("afac:applicableForUser", v.literal())?; }
if let Some(v) = &self.nearby { w.leaf("afac:nearby", v)?; }
if let Some(v) = &self.supplemental_facility_extension { w.extension("afac:_supplementalFacilityExtension", v)?; }
match &self.equipment_type {
Some(v) => { w.enumeration("afac:equipmentType", v.literal())?; }
None => return Err(w.missing("afac:equipmentType")),
}
if let Some(v) = &self.supplemental_equipment_extension { w.extension("afac:_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 operation_status: Option<OperationStatusEnum>,
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] = &[0x20aba, 0x208ba, 0x209a8, 0x209ce, 0x20aca, 0x20b77, 0x20958, 0x20959, 0x2080d, 0x20498, 0x20a99, 0x20985, 0x20c21, 0x207e8, 0x205dd];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201fe);
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;
let mut e14 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20aba => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2746); }
0x208ba => { let v = r.date_time()?; r.set(&mut e1, v, 2234); }
0x209a8 => { let v = r.enumeration::<OpeningStatusEnum>()?; r.set(&mut e2, v, 2472); }
0x209ce => { let v = r.enumeration::<OperationStatusEnum>()?; r.set(&mut e3, v, 2510); }
0x20aca => { let v = r.value::<bool>()?; r.set(&mut e4, v, 2762); }
0x20b77 => { let v = r.multilingual()?; r.set(&mut e5, v, 2935); }
0x20958 => { let v = OperatingHours::read(r)?; r.set(&mut e6, v, 2392); }
0x20959 => { let v = Rates::read(r)?; r.set(&mut e7, v, 2393); }
0x2080d => { let v = com::AnyFault::read(r)?; r.set(&mut e8, v, 2061); }
0x20498 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1176); }
0x20a99 => { let v = r.value::<u64>()?; r.set(&mut e10, v, 2713); }
0x20985 => { let v = r.value::<u64>()?; r.set(&mut e11, v, 2437); }
0x20c21 => { let v = r.value::<u64>()?; r.set(&mut e12, v, 3105); }
0x207e8 => { let v = r.enumeration::<OperationStatusEnum>()?; r.set(&mut e13, v, 2024); }
0x205dd => { let v = r.raw()?; r.set(&mut e14, 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,
operation_status: e3,
regular_operating_hours_in_force: e4,
status_description: e5,
new_operating_hours: e6,
new_rates: e7,
fault: e8,
facility_object_status_extension: e9,
quantity_override: e10,
number_of_subitems_override: e11,
vacant_subitems: e12,
equipment_operation_status: e13,
supplemental_facility_status_extension: e14,
};
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, "afac:reference", "", " targetClass=\"afac:FacilityObject\"")?; }
None => return Err(w.missing("afac:reference")),
}
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.opening_status { w.enumeration("afac:openingStatus", v.literal())?; }
if let Some(v) = &self.operation_status { w.enumeration("afac:operationStatus", v.literal())?; }
if let Some(v) = &self.regular_operating_hours_in_force { w.leaf("afac:regularOperatingHoursInForce", v)?; }
if let Some(v) = &self.status_description { w.multilingual("afac:statusDescription", v)?; }
if let Some(v) = &self.new_operating_hours { v.write(w, "afac:newOperatingHours")?; }
if let Some(v) = &self.new_rates { v.write(w, "afac:newRates")?; }
if let Some(v) = &self.fault { v.write(w, "afac:fault")?; }
if let Some(v) = &self.facility_object_status_extension { w.extension("afac:_facilityObjectStatusExtension", v)?; }
if let Some(v) = &self.quantity_override { w.leaf("afac:quantityOverride", v)?; }
if let Some(v) = &self.number_of_subitems_override { w.leaf("afac:numberOfSubitemsOverride", v)?; }
if let Some(v) = &self.vacant_subitems { w.leaf("afac:vacantSubitems", v)?; }
if let Some(v) = &self.equipment_operation_status { w.enumeration("afac:equipmentOperationStatus", v.literal())?; }
if let Some(v) = &self.supplemental_facility_status_extension { w.extension("afac:_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 last_updated: Option<DateTime>,
pub description: Option<MultilingualString>,
pub accessibility: Vec<AccessibilityEnum>,
pub additional_information: Vec<MultilingualString>,
pub external_identifier: Vec<ExternalIdentifier>,
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 helpdesk: Option<Organisation>,
pub associated_facility: Vec<AnyAssociatedFacility>,
pub rates: Option<Rates>,
pub applicable_for_vehicles: Vec<com::VehicleCharacteristics>,
pub dimension: Option<Box<Dimension>>,
pub amenities: Option<Box<Amenities>>,
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 nearby: Option<com::Boolean>,
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] = &[0x20949, 0x206ad, 0x208ba, 0x20777, 0x2066b, 0x20690, 0x20805, 0x20887, 0x20a2d, 0x20a2c, 0x209c5, 0x208e8, 0x209f8, 0x209d2, 0x20864, 0x206d3, 0x20ab0, 0x206c6, 0x20786, 0x206b8, 0x20497, 0x206dc, 0x20a98, 0x20acc, 0x206c5, 0x20954, 0x205dc, 0x20b33, 0x20984, 0x207a1, 0x205de];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x201ff);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = Vec::new();
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
let mut e14 = None;
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
let mut e19 = None;
let mut e20 = None;
let mut e21 = None;
let mut e22 = None;
let mut e23 = None;
let mut e24 = Vec::new();
let mut e25 = None;
let mut e26 = None;
let mut e27 = None;
let mut e28 = None;
let mut e29 = None;
let mut e30 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20949 => { let v = r.multilingual()?; r.set(&mut e0, v, 2377); }
0x206ad => { let v = r.multilingual()?; e1.extend(v); }
0x208ba => { let v = r.date_time()?; r.set(&mut e2, v, 2234); }
0x20777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x2066b => { let v = r.enumeration::<AccessibilityEnum>()?; e4.extend(v); }
0x20690 => { let v = r.multilingual()?; e5.extend(v); }
0x20805 => { let v = Some(ExternalIdentifier::read(r)?); e6.extend(v); }
0x20887 => { let v = Some(com::UrlLink::read(r)?); e7.extend(v); }
0x20a2d => { let v = Some(com::UrlLink::read(r)?); e8.extend(v); }
0x20a2c => { let v = Some(Image::read(r)?); e9.extend(v); }
0x209c5 => { let v = OperatingHours::read(r)?; r.set(&mut e10, v, 2501); }
0x208e8 => { let v = loc::LocationReference::read(r)?; r.set(&mut e11, v, 2280); }
0x209f8 => { let v = Organisation::read(r)?; r.set(&mut e12, v, 2552); }
0x209d2 => { let v = Organisation::read(r)?; r.set(&mut e13, v, 2514); }
0x20864 => { let v = Organisation::read(r)?; r.set(&mut e14, v, 2148); }
0x206d3 => { let v = AnyAssociatedFacility::read(r)?; e15.extend(v); }
0x20ab0 => { let v = Rates::read(r)?; r.set(&mut e16, v, 2736); }
0x206c6 => { let v = Some(com::VehicleCharacteristics::read(r)?); e17.extend(v); }
0x20786 => { let v = Some(Dimension::read(r)?); r.set(&mut e18, v.map(Box::new), 1926); }
0x206b8 => { let v = Some(Amenities::read(r)?); r.set(&mut e19, v.map(Box::new), 1720); }
0x20497 => { let v = r.raw()?; r.set(&mut e20, v.map(Box::new), 1175); }
0x206dc => { let v = r.enumeration::<AvailabilityEnum>()?; r.set(&mut e21, v, 1756); }
0x20a98 => { let v = r.value::<u64>()?; r.set(&mut e22, v, 2712); }
0x20acc => { let v = r.value::<bool>()?; r.set(&mut e23, v, 2764); }
0x206c5 => { let v = r.enumeration::<UserTypeEnum>()?; e24.extend(v); }
0x20954 => { let v = r.value::<bool>()?; r.set(&mut e25, v, 2388); }
0x205dc => { let v = r.raw()?; r.set(&mut e26, v.map(Box::new), 1500); }
0x20b33 => { let v = r.enumeration::<ServiceFacilityTypeEnum>()?; r.set(&mut e27, v, 2867); }
0x20984 => { let v = r.value::<u64>()?; r.set(&mut e28, v, 2436); }
0x207a1 => { let v = r.value::<u64>()?; r.set(&mut e29, v, 1953); }
0x205de => { let v = r.raw()?; r.set(&mut e30, v.map(Box::new), 1502); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e27, 2867);
let v = Self {
id: a0,
version: a1,
name: e0,
alias: e1,
last_updated: e2,
description: e3,
accessibility: e4,
additional_information: e5,
external_identifier: e6,
information_website: e7,
photo_url: e8,
photo: e9,
operating_hours: e10,
location_reference: e11,
owner: e12,
operator: e13,
helpdesk: e14,
associated_facility: e15,
rates: e16,
applicable_for_vehicles: e17,
dimension: e18,
amenities: e19,
facility_object_extension: e20,
availability: e21,
quantity: e22,
regularly_cleaned: e23,
applicable_for_user: e24,
nearby: e25,
supplemental_facility_extension: e26,
service_facility_type: e27,
number_of_subitems: e28,
distance_from_origin_facility: e29,
supplemental_service_facility_extension: e30,
};
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("afac:name", v)?; }
for v in &self.alias { w.multilingual("afac:alias", v)?; }
if let Some(v) = &self.last_updated { w.leaf("afac:lastUpdated", v)?; }
if let Some(v) = &self.description { w.multilingual("afac:description", v)?; }
for v in &self.accessibility { w.enumeration("afac:accessibility", v.literal())?; }
for v in &self.additional_information { w.multilingual("afac:additionalInformation", v)?; }
for v in &self.external_identifier { v.write(w, "afac:externalIdentifier", "", "")?; }
for v in &self.information_website { v.write(w, "afac:informationWebsite", "", "")?; }
for v in &self.photo_url { v.write(w, "afac:photoUrl", "", "")?; }
for v in &self.photo { v.write(w, "afac:photo", "", "")?; }
if let Some(v) = &self.operating_hours { v.write(w, "afac:operatingHours")?; }
if let Some(v) = &self.location_reference { v.write(w, "afac:locationReference")?; }
if let Some(v) = &self.owner { v.write(w, "afac:owner")?; }
if let Some(v) = &self.operator { v.write(w, "afac:operator")?; }
if let Some(v) = &self.helpdesk { v.write(w, "afac:helpdesk")?; }
for v in &self.associated_facility { v.write(w, "afac:associatedFacility")?; }
if let Some(v) = &self.rates { v.write(w, "afac:rates")?; }
for v in &self.applicable_for_vehicles { v.write(w, "afac:applicableForVehicles", "", "")?; }
if let Some(v) = &self.dimension { v.write(w, "afac:dimension", "", "")?; }
if let Some(v) = &self.amenities { v.write(w, "afac:amenities", "", "")?; }
if let Some(v) = &self.facility_object_extension { w.extension("afac:_facilityObjectExtension", v)?; }
if let Some(v) = &self.availability { w.enumeration("afac:availability", v.literal())?; }
if let Some(v) = &self.quantity { w.leaf("afac:quantity", v)?; }
if let Some(v) = &self.regularly_cleaned { w.leaf("afac:regularlyCleaned", v)?; }
for v in &self.applicable_for_user { w.enumeration("afac:applicableForUser", v.literal())?; }
if let Some(v) = &self.nearby { w.leaf("afac:nearby", v)?; }
if let Some(v) = &self.supplemental_facility_extension { w.extension("afac:_supplementalFacilityExtension", v)?; }
match &self.service_facility_type {
Some(v) => { w.enumeration("afac:serviceFacilityType", v.literal())?; }
None => return Err(w.missing("afac:serviceFacilityType")),
}
if let Some(v) = &self.number_of_subitems { w.leaf("afac:numberOfSubitems", v)?; }
if let Some(v) = &self.distance_from_origin_facility { w.leaf("afac:distanceFromOriginFacility", v)?; }
if let Some(v) = &self.supplemental_service_facility_extension { w.extension("afac:_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] = &[0x20b99, 0x20c2c, 0x20a9d, 0x20bf8, 0x20ac8, 0x208aa, 0x205e6];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20208);
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 {
0x20b99 => { let v = r.enumeration::<SurchargeTypeEnum>()?; r.set(&mut e0, v, 2969); }
0x20c2c => { let v = r.value::<Decimal>()?; r.set(&mut e1, v, 3116); }
0x20a9d => { let v = r.value::<f32>()?; r.set(&mut e2, v, 2717); }
0x20bf8 => { let v = r.multilingual()?; r.set(&mut e3, v, 3064); }
0x20ac8 => { let v = r.enumeration::<RefundTypeEnum>()?; r.set(&mut e4, v, 2760); }
0x208aa => { let v = r.multilingual()?; r.set(&mut e5, v, 2218); }
0x205e6 => { 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("afac:surchargeType", v.literal())?; }
None => return Err(w.missing("afac:surchargeType")),
}
if let Some(v) = &self.value { w.digits("value", v, 8, 2)?; w.leaf("afac:value", v)?; }
if let Some(v) = &self.rate { w.leaf("afac:rate", v)?; }
if let Some(v) = &self.trigger { w.multilingual("afac:trigger", v)?; }
if let Some(v) = &self.refund { w.enumeration("afac:refund", v.literal())?; }
if let Some(v) = &self.label_for_display { w.multilingual("afac:labelForDisplay", v)?; }
if let Some(v) = &self.surcharge_extension { w.extension("afac:_surchargeExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TimesOfDay {
pub assigned_right_time_relative_extension: Option<Box<Extension>>,
pub earliest_start: Option<Time>,
pub latest_start: Option<Time>,
pub earliest_end: Option<Time>,
pub latest_end: Option<Time>,
pub times_of_day_extension: Option<Box<Extension>>,
}
impl TimesOfDay {
const FIELDS: &'static [u32] = &[0x20423, 0x207b5, 0x208bd, 0x207b3, 0x208bb, 0x205f7];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20219);
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 {
0x20423 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1059); }
0x207b5 => { let v = r.value::<Time>()?; r.set(&mut e1, v, 1973); }
0x208bd => { let v = r.value::<Time>()?; r.set(&mut e2, v, 2237); }
0x207b3 => { let v = r.value::<Time>()?; r.set(&mut e3, v, 1971); }
0x208bb => { let v = r.value::<Time>()?; r.set(&mut e4, v, 2235); }
0x205f7 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1527); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
assigned_right_time_relative_extension: e0,
earliest_start: e1,
latest_start: e2,
earliest_end: e3,
latest_end: e4,
times_of_day_extension: e5,
};
r.close();
Ok(v)
}
}
impl TimesOfDay {
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.assigned_right_time_relative_extension { w.extension("afac:_assignedRightTimeRelativeExtension", v)?; }
if let Some(v) = &self.earliest_start { w.leaf("afac:earliestStart", v)?; }
if let Some(v) = &self.latest_start { w.leaf("afac:latestStart", v)?; }
if let Some(v) = &self.earliest_end { w.leaf("afac:earliestEnd", v)?; }
if let Some(v) = &self.latest_end { w.leaf("afac:latestEnd", v)?; }
if let Some(v) = &self.times_of_day_extension { w.extension("afac:_timesOfDayExtension", 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] = &[0x2071f, 0x2052a, 0x2062a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2024c);
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 {
0x2071f => { let v = Some(ClosureInformation::read(r)?); r.set(&mut e0, v.map(Box::new), 1823); }
0x2052a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1322); }
0x2062a => { 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, "afac:closureInformation", "", "")?; }
if let Some(v) = &self.operating_hours_extension { w.extension("afac:_operatingHoursExtension", v)?; }
if let Some(v) = &self.undefined_operating_hours_extension { w.extension("afac:_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] = &[0x2083f, 0x20537, 0x2062b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2024d);
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 {
0x2083f => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e0, v.map(Box::new), 2111); }
0x20537 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1335); }
0x2062b => { 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, "afac:generalTimeValidity", "", "")?; }
if let Some(v) = &self.organisation_extension { w.extension("afac:_organisationExtension", v)?; }
if let Some(v) = &self.undefined_organisation_extension { w.extension("afac:_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] = &[0x2071f, 0x2052a, 0x2062c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2024e);
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 {
0x2071f => { let v = Some(ClosureInformation::read(r)?); r.set(&mut e0, v.map(Box::new), 1823); }
0x2052a => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1322); }
0x2062c => { 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, "afac:closureInformation", "", "")?; }
if let Some(v) = &self.operating_hours_extension { w.extension("afac:_operatingHoursExtension", v)?; }
if let Some(v) = &self.unknown_operating_hours_extension { w.extension("afac:_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] = &[0x2083f, 0x20537, 0x2062d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x2024f);
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 {
0x2083f => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e0, v.map(Box::new), 2111); }
0x20537 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1335); }
0x2062d => { 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, "afac:generalTimeValidity", "", "")?; }
if let Some(v) = &self.organisation_extension { w.extension("afac:_organisationExtension", v)?; }
if let Some(v) = &self.unknown_organisation_extension { w.extension("afac:_unknownOrganisationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct UnknownRates {
pub applicable_currency: Vec<CurrencyCode>,
pub payment: Option<Box<Payment>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub rates_extension: Option<Box<Extension>>,
pub unknown_rates_extension: Option<Box<Extension>>,
}
impl UnknownRates {
const FIELDS: &'static [u32] = &[0x206bf, 0x20a10, 0x209f1, 0x2058d, 0x2062e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20250);
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 {
0x206bf => { let v = r.string()?; e0.extend(v); }
0x20a10 => { let v = Some(Payment::read(r)?); r.set(&mut e1, v.map(Box::new), 2576); }
0x209f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x2058d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1421); }
0x2062e => { let v = r.raw()?; r.set(&mut e4, 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: e1,
overall_period: e2,
rates_extension: e3,
unknown_rates_extension: e4,
};
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("afac:applicableCurrency", v)?; }
if let Some(v) = &self.payment { v.write(w, "afac:payment", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "afac:overallPeriod", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("afac:_ratesExtension", v)?; }
if let Some(v) = &self.unknown_rates_extension { w.extension("afac:_unknownRatesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct UnspecifiedRates {
pub applicable_currency: Vec<CurrencyCode>,
pub payment: Option<Box<Payment>>,
pub overall_period: Option<Box<com::OverallPeriod>>,
pub rates_extension: Option<Box<Extension>>,
pub unspecified_rates_extension: Option<Box<Extension>>,
}
impl UnspecifiedRates {
const FIELDS: &'static [u32] = &[0x206bf, 0x20a10, 0x209f1, 0x2058d, 0x2062f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20251);
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 {
0x206bf => { let v = r.string()?; e0.extend(v); }
0x20a10 => { let v = Some(Payment::read(r)?); r.set(&mut e1, v.map(Box::new), 2576); }
0x209f1 => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e2, v.map(Box::new), 2545); }
0x2058d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1421); }
0x2062f => { let v = r.raw()?; r.set(&mut e4, 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: e1,
overall_period: e2,
rates_extension: e3,
unspecified_rates_extension: e4,
};
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("afac:applicableCurrency", v)?; }
if let Some(v) = &self.payment { v.write(w, "afac:payment", "", "")?; }
if let Some(v) = &self.overall_period { v.write(w, "afac:overallPeriod", "", "")?; }
if let Some(v) = &self.rates_extension { w.extension("afac:_ratesExtension", v)?; }
if let Some(v) = &self.unspecified_rates_extension { w.extension("afac:_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] = &[0x20c1b, 0x20633];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x20255);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x20c1b => { let v = r.enumeration::<UserTypeEnum>()?; r.set(&mut e0, v, 3099); }
0x20633 => { 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("afac:userGroup", v.literal())?; }
None => return Err(w.missing("afac:userGroup")),
}
if let Some(v) = &self.user_qualification_extension { w.extension("afac:_userQualificationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyAnOrganisation {
AnOrganisation(Box<AnOrganisation>),
ReferenceableOrganisation(Box<ReferenceableOrganisation>),
}
impl AnyAnOrganisation {
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(0x20031) => Self::AnOrganisation(Box::new(AnOrganisation::read(r)?)),
Some(0x201ae) => Self::ReferenceableOrganisation(Box::new(ReferenceableOrganisation::read(r)?)),
None => Self::AnOrganisation(Box::new(AnOrganisation::read(r)?)),
_ => {
r.unknown_type_as("AnOrganisation");
Self::AnOrganisation(Box::new(AnOrganisation::read(r)?))
}
}))
}
pub fn general_time_validity(&self) -> Option<&com::OverallPeriod> {
match self {
Self::AnOrganisation(v) => v.general_time_validity.as_deref(),
Self::ReferenceableOrganisation(v) => v.general_time_validity.as_deref(),
}
}
pub fn organisation_extension(&self) -> Option<&Extension> {
match self {
Self::AnOrganisation(v) => v.organisation_extension.as_deref(),
Self::ReferenceableOrganisation(v) => v.organisation_extension.as_deref(),
}
}
pub fn last_updated(&self) -> Option<&DateTime> {
match self {
Self::AnOrganisation(v) => v.last_updated.as_ref(),
Self::ReferenceableOrganisation(v) => v.last_updated.as_ref(),
}
}
pub fn name(&self) -> Option<&MultilingualString> {
match self {
Self::AnOrganisation(v) => v.name.as_ref(),
Self::ReferenceableOrganisation(v) => v.name.as_ref(),
}
}
pub fn legal_name(&self) -> Option<&MultilingualString> {
match self {
Self::AnOrganisation(v) => v.legal_name.as_ref(),
Self::ReferenceableOrganisation(v) => v.legal_name.as_ref(),
}
}
pub fn description(&self) -> Option<&MultilingualString> {
match self {
Self::AnOrganisation(v) => v.description.as_ref(),
Self::ReferenceableOrganisation(v) => v.description.as_ref(),
}
}
pub fn link_to_general_information(&self) -> Option<&str> {
match self {
Self::AnOrganisation(v) => v.link_to_general_information.as_deref(),
Self::ReferenceableOrganisation(v) => v.link_to_general_information.as_deref(),
}
}
pub fn link_to_logo(&self) -> Option<&str> {
match self {
Self::AnOrganisation(v) => v.link_to_logo.as_deref(),
Self::ReferenceableOrganisation(v) => v.link_to_logo.as_deref(),
}
}
pub fn link_to_webform(&self) -> Option<&str> {
match self {
Self::AnOrganisation(v) => v.link_to_webform.as_deref(),
Self::ReferenceableOrganisation(v) => v.link_to_webform.as_deref(),
}
}
pub fn available24hours(&self) -> Option<&com::Boolean> {
match self {
Self::AnOrganisation(v) => v.available24hours.as_ref(),
Self::ReferenceableOrganisation(v) => v.available24hours.as_ref(),
}
}
pub fn responsibility(&self) -> &[MultilingualString] {
match self {
Self::AnOrganisation(v) => &v.responsibility,
Self::ReferenceableOrganisation(v) => &v.responsibility,
}
}
pub fn publishing_agreement(&self) -> Option<&com::Boolean> {
match self {
Self::AnOrganisation(v) => v.publishing_agreement.as_ref(),
Self::ReferenceableOrganisation(v) => v.publishing_agreement.as_ref(),
}
}
pub fn r#type(&self) -> Option<&OrganisationTypeEnum> {
match self {
Self::AnOrganisation(v) => v.r#type.as_ref(),
Self::ReferenceableOrganisation(v) => v.r#type.as_ref(),
}
}
pub fn national_organisation_number(&self) -> Option<&str> {
match self {
Self::AnOrganisation(v) => v.national_organisation_number.as_deref(),
Self::ReferenceableOrganisation(v) => v.national_organisation_number.as_deref(),
}
}
pub fn national_register(&self) -> Option<&str> {
match self {
Self::AnOrganisation(v) => v.national_register.as_deref(),
Self::ReferenceableOrganisation(v) => v.national_register.as_deref(),
}
}
pub fn vat_identification_number(&self) -> Option<&str> {
match self {
Self::AnOrganisation(v) => v.vat_identification_number.as_deref(),
Self::ReferenceableOrganisation(v) => v.vat_identification_number.as_deref(),
}
}
pub fn organisation_unit(&self) -> &[OrganisationUnit] {
match self {
Self::AnOrganisation(v) => &v.organisation_unit,
Self::ReferenceableOrganisation(v) => &v.organisation_unit,
}
}
pub fn external_identifier(&self) -> &[ExternalIdentifier] {
match self {
Self::AnOrganisation(v) => &v.external_identifier,
Self::ReferenceableOrganisation(v) => &v.external_identifier,
}
}
pub fn sub_organisation(&self) -> &[Organisation] {
match self {
Self::AnOrganisation(v) => &v.sub_organisation,
Self::ReferenceableOrganisation(v) => &v.sub_organisation,
}
}
pub fn an_organisation_extension(&self) -> Option<&Extension> {
match self {
Self::AnOrganisation(v) => v.an_organisation_extension.as_deref(),
Self::ReferenceableOrganisation(v) => v.an_organisation_extension.as_deref(),
}
}
}
impl AnyAnOrganisation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::AnOrganisation(v) => v.write(w, tag, "", ""),
Self::ReferenceableOrganisation(v) => v.write(w, tag, " xsi:type=\"afac:ReferenceableOrganisation\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AssignedRightTimeRelative {
RelativeOffsets(Box<RelativeOffsets>),
TimesOfDay(Box<TimesOfDay>),
}
impl AssignedRightTimeRelative {
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(0x201b5) => Self::RelativeOffsets(Box::new(RelativeOffsets::read(r)?)),
Some(0x20219) => Self::TimesOfDay(Box::new(TimesOfDay::read(r)?)),
_ => {
r.unknown_type("AssignedRightTimeRelative")?;
return Ok(None);
}
}))
}
pub fn assigned_right_time_relative_extension(&self) -> Option<&Extension> {
match self {
Self::RelativeOffsets(v) => v.assigned_right_time_relative_extension.as_deref(),
Self::TimesOfDay(v) => v.assigned_right_time_relative_extension.as_deref(),
}
}
}
impl AssignedRightTimeRelative {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::RelativeOffsets(v) => v.write(w, tag, " xsi:type=\"afac:RelativeOffsets\"", ""),
Self::TimesOfDay(v) => v.write(w, tag, " xsi:type=\"afac:TimesOfDay\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyAssociatedFacility {
AssociatedFacility(Box<AssociatedFacility>),
AssociatedParking(Box<aegi::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(0x20038) => Self::AssociatedFacility(Box::new(AssociatedFacility::read(r)?)),
Some(0x10039) => Self::AssociatedParking(Box::new(aegi::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=\"aegi: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(0x2005c) => Self::ContactInformation(Box::new(ContactInformation::read(r)?)),
Some(0x2005d) => 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=\"afac: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(0x20064) => Self::Credential(Box::new(Credential::read(r)?)),
Some(0x20065) => 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=\"afac: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(0x2012e) => Self::OpenAllHours(Box::new(OpenAllHours::read(r)?)),
Some(0x20145) => Self::OperatingHoursByReference(Box::new(OperatingHoursByReference::read(r)?)),
Some(0x20147) => Self::OperatingHoursSpecification(Box::new(OperatingHoursSpecification::read(r)?)),
Some(0x2024c) => Self::UndefinedOperatingHours(Box::new(UndefinedOperatingHours::read(r)?)),
Some(0x2024e) => 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=\"afac:OpenAllHours\"", ""),
Self::OperatingHoursByReference(v) => v.write(w, tag, " xsi:type=\"afac:OperatingHoursByReference\"", ""),
Self::OperatingHoursSpecification(v) => v.write(w, tag, " xsi:type=\"afac:OperatingHoursSpecification\"", ""),
Self::UndefinedOperatingHours(v) => v.write(w, tag, " xsi:type=\"afac:UndefinedOperatingHours\"", ""),
Self::UnknownOperatingHours(v) => v.write(w, tag, " xsi:type=\"afac:UnknownOperatingHours\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Organisation {
AnOrganisation(Box<AnOrganisation>),
ReferenceableOrganisation(Box<ReferenceableOrganisation>),
OrganisationByReference(Box<OrganisationByReference>),
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(0x20031) => Self::AnOrganisation(Box::new(AnOrganisation::read(r)?)),
Some(0x201ae) => Self::ReferenceableOrganisation(Box::new(ReferenceableOrganisation::read(r)?)),
Some(0x20153) => Self::OrganisationByReference(Box::new(OrganisationByReference::read(r)?)),
Some(0x2024d) => Self::UndefinedOrganisation(Box::new(UndefinedOrganisation::read(r)?)),
Some(0x2024f) => 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::AnOrganisation(v) => v.general_time_validity.as_deref(),
Self::ReferenceableOrganisation(v) => v.general_time_validity.as_deref(),
Self::OrganisationByReference(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::AnOrganisation(v) => v.organisation_extension.as_deref(),
Self::ReferenceableOrganisation(v) => v.organisation_extension.as_deref(),
Self::OrganisationByReference(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::AnOrganisation(v) => v.write(w, tag, " xsi:type=\"afac:AnOrganisation\"", ""),
Self::ReferenceableOrganisation(v) => v.write(w, tag, " xsi:type=\"afac:ReferenceableOrganisation\"", ""),
Self::OrganisationByReference(v) => v.write(w, tag, " xsi:type=\"afac:OrganisationByReference\"", ""),
Self::UndefinedOrganisation(v) => v.write(w, tag, " xsi:type=\"afac:UndefinedOrganisation\"", ""),
Self::UnknownOrganisation(v) => v.write(w, tag, " xsi:type=\"afac: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(0x201a3) => Self::RateLineCollection(Box::new(RateLineCollection::read(r)?)),
Some(0x201b6) => 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=\"afac:RelativeTimeRates\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Rates {
FreeOfCharge(Box<FreeOfCharge>),
GeneralRateInformation(Box<GeneralRateInformation>),
RateMatrix(Box<RateMatrix>),
RateMatrixByReference(Box<RateMatrixByReference>),
RateTable(Box<RateTable>),
RateTableByReference(Box<RateTableByReference>),
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(0x200b4) => Self::FreeOfCharge(Box::new(FreeOfCharge::read(r)?)),
Some(0x200c1) => Self::GeneralRateInformation(Box::new(GeneralRateInformation::read(r)?)),
Some(0x201a5) => Self::RateMatrix(Box::new(RateMatrix::read(r)?)),
Some(0x201a6) => Self::RateMatrixByReference(Box::new(RateMatrixByReference::read(r)?)),
Some(0x201a7) => Self::RateTable(Box::new(RateTable::read(r)?)),
Some(0x201a8) => Self::RateTableByReference(Box::new(RateTableByReference::read(r)?)),
Some(0x20250) => Self::UnknownRates(Box::new(UnknownRates::read(r)?)),
Some(0x20251) => 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::RateMatrix(v) => &v.applicable_currency,
Self::RateMatrixByReference(v) => &v.applicable_currency,
Self::RateTable(v) => &v.applicable_currency,
Self::RateTableByReference(v) => &v.applicable_currency,
Self::UnknownRates(v) => &v.applicable_currency,
Self::UnspecifiedRates(v) => &v.applicable_currency,
}
}
pub fn payment(&self) -> Option<&Payment> {
match self {
Self::FreeOfCharge(v) => v.payment.as_deref(),
Self::GeneralRateInformation(v) => v.payment.as_deref(),
Self::RateMatrix(v) => v.payment.as_deref(),
Self::RateMatrixByReference(v) => v.payment.as_deref(),
Self::RateTable(v) => v.payment.as_deref(),
Self::RateTableByReference(v) => v.payment.as_deref(),
Self::UnknownRates(v) => v.payment.as_deref(),
Self::UnspecifiedRates(v) => v.payment.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::RateMatrix(v) => v.overall_period.as_deref(),
Self::RateMatrixByReference(v) => v.overall_period.as_deref(),
Self::RateTable(v) => v.overall_period.as_deref(),
Self::RateTableByReference(v) => v.overall_period.as_deref(),
Self::UnknownRates(v) => v.overall_period.as_deref(),
Self::UnspecifiedRates(v) => v.overall_period.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::RateMatrix(v) => v.rates_extension.as_deref(),
Self::RateMatrixByReference(v) => v.rates_extension.as_deref(),
Self::RateTable(v) => v.rates_extension.as_deref(),
Self::RateTableByReference(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=\"afac:FreeOfCharge\"", ""),
Self::GeneralRateInformation(v) => v.write(w, tag, " xsi:type=\"afac:GeneralRateInformation\"", ""),
Self::RateMatrix(v) => v.write(w, tag, " xsi:type=\"afac:RateMatrix\"", ""),
Self::RateMatrixByReference(v) => v.write(w, tag, " xsi:type=\"afac:RateMatrixByReference\"", ""),
Self::RateTable(v) => v.write(w, tag, " xsi:type=\"afac:RateTable\"", ""),
Self::RateTableByReference(v) => v.write(w, tag, " xsi:type=\"afac:RateTableByReference\"", ""),
Self::UnknownRates(v) => v.write(w, tag, " xsi:type=\"afac:UnknownRates\"", ""),
Self::UnspecifiedRates(v) => v.write(w, tag, " xsi:type=\"afac:UnspecifiedRates\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum SupplementalFacility {
ElectricChargingEquipment(Box<aegi::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(0x10090) => Self::ElectricChargingEquipment(Box::new(aegi::ElectricChargingEquipment::read(r)?)),
Some(0x201fc) => Self::SupplementalEquipment(Box::new(SupplementalEquipment::read(r)?)),
Some(0x201ff) => 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 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 external_identifier(&self) -> &[ExternalIdentifier] {
match self {
Self::ElectricChargingEquipment(v) => &v.external_identifier,
Self::SupplementalEquipment(v) => &v.external_identifier,
Self::SupplementalServiceFacility(v) => &v.external_identifier,
}
}
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 helpdesk(&self) -> Option<&Organisation> {
match self {
Self::ElectricChargingEquipment(v) => v.helpdesk.as_ref(),
Self::SupplementalEquipment(v) => v.helpdesk.as_ref(),
Self::SupplementalServiceFacility(v) => v.helpdesk.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 amenities(&self) -> Option<&Amenities> {
match self {
Self::ElectricChargingEquipment(v) => v.amenities.as_deref(),
Self::SupplementalEquipment(v) => v.amenities.as_deref(),
Self::SupplementalServiceFacility(v) => v.amenities.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 nearby(&self) -> Option<&com::Boolean> {
match self {
Self::ElectricChargingEquipment(v) => v.nearby.as_ref(),
Self::SupplementalEquipment(v) => v.nearby.as_ref(),
Self::SupplementalServiceFacility(v) => v.nearby.as_ref(),
}
}
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=\"aegi:ElectricChargingEquipment\"", ""),
Self::SupplementalEquipment(v) => v.write(w, tag, " xsi:type=\"afac:SupplementalEquipment\"", ""),
Self::SupplementalServiceFacility(v) => v.write(w, tag, " xsi:type=\"afac:SupplementalServiceFacility\"", ""),
}
}
}