#[cfg(feature = "openimmo127c")]
use crate::spec::openimmo127c as spec;
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct AnyXml(pub String);
impl From<AnyXml> for spec::AnyXml {
fn from(value: AnyXml) -> Self {
spec::AnyXml(value.0)
}
}
impl From<spec::AnyXml> for AnyXml {
fn from(value: spec::AnyXml) -> Self {
AnyXml(value.0)
}
}
pub type AvailableFromDate = String;
pub type DownPayment = rust_decimal::Decimal;
pub type HasStorageRoom = bool;
pub type AddressSharingConsent = bool;
pub type CourtFileNumber = String;
#[derive(Debug)]
pub struct Action {
pub kind: Option<ActionKind>,
}
impl From<Action> for spec::AktionElementType {
fn from(value: Action) -> Self {
spec::AktionElementType {
aktionart: value.kind.map(Into::into),
}
}
}
impl From<spec::AktionElementType> for Action {
fn from(value: spec::AktionElementType) -> Self {
Action {
kind: value.aktionart.map(Into::into),
}
}
}
#[derive(Debug)]
pub enum ActionKind {
Change,
Delete,
Reference,
}
impl From<ActionKind> for spec::AktionAktionartType {
fn from(value: ActionKind) -> Self {
match value {
ActionKind::Change => spec::AktionAktionartType::Change,
ActionKind::Delete => spec::AktionAktionartType::Delete,
ActionKind::Reference => spec::AktionAktionartType::Referenz,
}
}
}
impl From<spec::AktionAktionartType> for ActionKind {
fn from(value: spec::AktionAktionartType) -> Self {
match value {
spec::AktionAktionartType::Change => ActionKind::Change,
spec::AktionAktionartType::Delete => ActionKind::Delete,
spec::AktionAktionartType::Referenz => ActionKind::Reference,
}
}
}
pub type ActiveUntil = String;
pub type ActiveFrom = String;
pub type IsVacationProperty = bool;
#[derive(Debug)]
pub struct BuildingAge {
pub age: Option<BuildingAgeKind>,
}
impl From<BuildingAge> for spec::AlterElementType {
fn from(value: BuildingAge) -> Self {
spec::AlterElementType {
alter_attr: value.age.map(Into::into),
}
}
}
impl From<spec::AlterElementType> for BuildingAge {
fn from(value: spec::AlterElementType) -> Self {
BuildingAge {
age: value.alter_attr.map(Into::into),
}
}
}
#[derive(Debug)]
pub enum BuildingAgeKind {
New,
Old,
}
impl From<BuildingAgeKind> for spec::AlterAlterAttrType {
fn from(value: BuildingAgeKind) -> Self {
match value {
BuildingAgeKind::New => spec::AlterAlterAttrType::Neubau,
BuildingAgeKind::Old => spec::AlterAlterAttrType::Altbau,
}
}
}
impl From<spec::AlterAlterAttrType> for BuildingAgeKind {
fn from(value: spec::AlterAlterAttrType) -> Self {
match value {
spec::AlterAlterAttrType::Neubau => BuildingAgeKind::New,
spec::AlterAlterAttrType::Altbau => BuildingAgeKind::Old,
}
}
}
pub type ContaminationNotes = String;
pub type DistrictCourt = String;
#[derive(Debug)]
pub struct OpenImmoDocument {
pub transfer: Transfer,
pub providers: Vec<Provider>,
pub user_defined_simple_fields: Vec<spec::UserDefinedSimplefieldElementType>,
pub user_defined_any_fields: Vec<spec::UserDefinedAnyfieldElementType>,
}
impl From<OpenImmoDocument> for spec::OpenimmoElementType {
fn from(value: OpenImmoDocument) -> Self {
spec::OpenimmoElementType {
uebertragung: value.transfer.into(),
anbieter: value.providers.into_iter().map(Into::into).collect(),
user_defined_simplefield: value.user_defined_simple_fields,
user_defined_anyfield: value.user_defined_any_fields,
}
}
}
impl From<spec::OpenimmoElementType> for OpenImmoDocument {
fn from(value: spec::OpenimmoElementType) -> Self {
OpenImmoDocument {
transfer: value.uebertragung.into(),
providers: value.anbieter.into_iter().map(Into::into).collect(),
user_defined_simple_fields: value.user_defined_simplefield,
user_defined_any_fields: value.user_defined_anyfield,
}
}
}
#[derive(Debug)]
pub struct Transfer {
pub transfer_type: spec::UebertragungArtType,
pub scope: spec::UebertragungUmfangType,
pub mode: Option<spec::UebertragungModusType>,
pub version: Option<String>,
pub sender_software: Option<String>,
pub sender_version: Option<String>,
pub technical_email: Option<String>,
pub registration_id: Option<String>,
pub timestamp: Option<String>,
}
impl From<Transfer> for spec::UebertragungElementType {
fn from(value: Transfer) -> Self {
spec::UebertragungElementType {
art: value.transfer_type,
umfang: value.scope,
modus: value.mode,
version: value.version,
sendersoftware: value.sender_software,
senderversion: value.sender_version,
techn_email: value.technical_email,
regi_id: value.registration_id,
timestamp: value.timestamp,
}
}
}
impl From<spec::UebertragungElementType> for Transfer {
fn from(value: spec::UebertragungElementType) -> Self {
Transfer {
transfer_type: value.art,
scope: value.umfang,
mode: value.modus,
version: value.version,
sender_software: value.sendersoftware,
sender_version: value.senderversion,
technical_email: value.techn_email,
registration_id: value.regi_id,
timestamp: value.timestamp,
}
}
}
#[derive(Debug)]
pub struct Provider {
pub provider_number: Option<String>,
pub company: Option<String>,
pub openimmo_provider_id: Option<String>,
pub license_id: Option<String>,
pub attachment: Option<Attachment>,
pub properties: Vec<Property>,
pub legal_notice: Option<String>,
pub legal_notice_structured: Option<spec::ImpressumStruktElementType>,
pub user_defined_simple_fields: Vec<spec::UserDefinedSimplefieldElementType>,
pub user_defined_any_fields: Vec<spec::UserDefinedAnyfieldElementType>,
pub user_defined_extensions: Vec<spec::UserDefinedExtendElementType>,
}
impl From<Provider> for spec::AnbieterElementType {
fn from(value: Provider) -> Self {
spec::AnbieterElementType {
anbieternr: value.provider_number,
firma: value.company,
openimmo_anid: value.openimmo_provider_id,
lizenzkennung: value.license_id,
anhang: value.attachment.map(Into::into),
immobilie: value.properties.into_iter().map(Into::into).collect(),
impressum: value.legal_notice,
impressum_strukt: value.legal_notice_structured,
user_defined_simplefield: value.user_defined_simple_fields,
user_defined_anyfield: value.user_defined_any_fields,
user_defined_extend: value.user_defined_extensions,
}
}
}
impl From<spec::AnbieterElementType> for Provider {
fn from(value: spec::AnbieterElementType) -> Self {
Provider {
provider_number: value.anbieternr,
company: value.firma,
openimmo_provider_id: value.openimmo_anid,
license_id: value.lizenzkennung,
attachment: value.anhang.map(Into::into),
properties: value.immobilie.into_iter().map(Into::into).collect(),
legal_notice: value.impressum,
legal_notice_structured: value.impressum_strukt,
user_defined_simple_fields: value.user_defined_simplefield,
user_defined_any_fields: value.user_defined_anyfield,
user_defined_extensions: value.user_defined_extend,
}
}
}
pub type ProviderNumber = String;
#[derive(Debug)]
pub struct ConnectedGastronomy {
pub hotel_restaurant: Option<bool>,
pub bar: Option<bool>,
}
impl From<ConnectedGastronomy> for spec::AngeschlGastronomieElementType {
fn from(value: ConnectedGastronomy) -> Self {
spec::AngeschlGastronomieElementType {
hotelrestaurant: value.hotel_restaurant,
bar: value.bar,
}
}
}
impl From<spec::AngeschlGastronomieElementType> for ConnectedGastronomy {
fn from(value: spec::AngeschlGastronomieElementType) -> Self {
ConnectedGastronomy {
hotel_restaurant: value.hotelrestaurant,
bar: value.bar,
}
}
}
#[derive(Debug)]
pub struct Attachments {
pub attachments: Vec<Attachment>,
pub user_defined_simple_fields: Vec<spec::UserDefinedSimplefieldElementType>,
pub user_defined_any_fields: Vec<spec::UserDefinedAnyfieldElementType>,
pub user_defined_extensions: Vec<spec::UserDefinedExtendElementType>,
}
impl From<Attachments> for spec::AnhaengeElementType {
fn from(value: Attachments) -> Self {
spec::AnhaengeElementType {
anhang: value.attachments.into_iter().map(Into::into).collect(),
user_defined_simplefield: value.user_defined_simple_fields,
user_defined_anyfield: value.user_defined_any_fields,
user_defined_extend: value.user_defined_extensions,
}
}
}
impl From<spec::AnhaengeElementType> for Attachments {
fn from(value: spec::AnhaengeElementType) -> Self {
Attachments {
attachments: value.anhang.into_iter().map(Into::into).collect(),
user_defined_simple_fields: value.user_defined_simplefield,
user_defined_any_fields: value.user_defined_anyfield,
user_defined_extensions: value.user_defined_extend,
}
}
}
#[derive(Debug)]
pub struct Attachment {
pub location: spec::AnhangLocationType,
pub group: Option<spec::AnhangGruppeType>,
pub title: Option<String>,
pub format: Option<String>,
pub check: Option<spec::CheckElementType>,
pub data: spec::DatenElementType,
}
impl From<Attachment> for spec::AnhangElementType {
fn from(value: Attachment) -> Self {
spec::AnhangElementType {
location: value.location,
gruppe: value.group,
anhangtitel: value.title,
format: value.format,
check: value.check,
daten: value.data,
}
}
}
impl From<spec::AnhangElementType> for Attachment {
fn from(value: spec::AnhangElementType) -> Self {
Attachment {
location: value.location,
group: value.gruppe,
title: value.anhangtitel,
format: value.format,
check: value.check,
data: value.daten,
}
}
}
pub type AttachmentContent = String;
pub type AttachmentTitle = String;
pub type Salutation = String;
pub type LetterSalutation = String;
pub type BathroomCount = rust_decimal::Decimal;
pub type BalconyTerraceCount = rust_decimal::Decimal;
pub type BalconyCount = rust_decimal::Decimal;
pub type BedCount = rust_decimal::Decimal;
pub type FloorCount = i32;
pub type CommercialUnitCount = rust_decimal::Decimal;
pub type LoggiaCount = rust_decimal::Decimal;
pub type BedroomCount = rust_decimal::Decimal;
pub type SeparateWcCount = rust_decimal::Decimal;
pub type ParkingSpaceCount = u64;
pub type MeetingRoomCount = rust_decimal::Decimal;
pub type TerraceCount = rust_decimal::Decimal;
pub type LivingSleepingRoomCount = rust_decimal::Decimal;
pub type ResidentialUnitCount = rust_decimal::Decimal;
pub type RoomCount = rust_decimal::Decimal;
#[derive(Debug)]
pub struct BuildOutStage {
pub kit_home: Option<bool>,
pub shell_house: Option<bool>,
pub turnkey_with_basement: Option<bool>,
pub turnkey_without_slab: Option<bool>,
pub turnkey_with_slab: Option<bool>,
}
impl From<BuildOutStage> for spec::AusbaustufeElementType {
fn from(value: BuildOutStage) -> Self {
spec::AusbaustufeElementType {
bausatzhaus: value.kit_home,
ausbauhaus: value.shell_house,
schluesselfertigmitkeller: value.turnkey_with_basement,
schluesselfertigohnebodenplatte: value.turnkey_without_slab,
schluesselfertigmitbodenplatte: value.turnkey_with_slab,
}
}
}
impl From<spec::AusbaustufeElementType> for BuildOutStage {
fn from(value: spec::AusbaustufeElementType) -> Self {
BuildOutStage {
kit_home: value.bausatzhaus,
shell_house: value.ausbauhaus,
turnkey_with_basement: value.schluesselfertigmitkeller,
turnkey_without_slab: value.schluesselfertigohnebodenplatte,
turnkey_with_slab: value.schluesselfertigmitbodenplatte,
}
}
}
#[derive(Debug)]
pub struct ViewOrientation {
pub view: Option<spec::AusblickBlickType>,
}
impl From<ViewOrientation> for spec::AusblickElementType {
fn from(value: ViewOrientation) -> Self {
spec::AusblickElementType { blick: value.view }
}
}
impl From<spec::AusblickElementType> for ViewOrientation {
fn from(value: spec::AusblickElementType) -> Self {
ViewOrientation { view: value.blick }
}
}
pub type FloorAreaRatio = rust_decimal::Decimal;
#[derive(Debug)]
pub struct BalconyTerraceOrientation {
pub north: Option<bool>,
pub east: Option<bool>,
pub south: Option<bool>,
pub west: Option<bool>,
pub north_east: Option<bool>,
pub north_west: Option<bool>,
pub south_east: Option<bool>,
pub south_west: Option<bool>,
}
impl From<BalconyTerraceOrientation> for spec::AusrichtBalkonTerrasseElementType {
fn from(value: BalconyTerraceOrientation) -> Self {
spec::AusrichtBalkonTerrasseElementType {
nord: value.north,
ost: value.east,
sued: value.south,
west: value.west,
nordost: value.north_east,
nordwest: value.north_west,
suedost: value.south_east,
suedwest: value.south_west,
}
}
}
impl From<spec::AusrichtBalkonTerrasseElementType> for BalconyTerraceOrientation {
fn from(value: spec::AusrichtBalkonTerrasseElementType) -> Self {
BalconyTerraceOrientation {
north: value.nord,
east: value.ost,
south: value.sued,
west: value.west,
north_east: value.nordost,
north_west: value.nordwest,
south_east: value.suedost,
south_west: value.suedwest,
}
}
}
#[derive(Debug)]
pub struct BuyerCommission {
pub includes_vat: Option<bool>,
pub text: Option<String>,
}
impl From<BuyerCommission> for spec::AussenCourtageElementType {
fn from(value: BuyerCommission) -> Self {
spec::AussenCourtageElementType {
mit_mwst: value.includes_vat,
text: value.text,
}
}
}
impl From<spec::AussenCourtageElementType> for BuyerCommission {
fn from(value: spec::AussenCourtageElementType) -> Self {
BuyerCommission {
includes_vat: value.mit_mwst,
text: value.text,
}
}
}
pub type EquipmentDescription = String;
#[derive(Debug)]
pub enum EquipmentCategory {
Standard,
Upscale,
Luxury,
}
impl From<EquipmentCategory> for spec::AusstattKategorieElementType {
fn from(value: EquipmentCategory) -> Self {
match value {
EquipmentCategory::Standard => spec::AusstattKategorieElementType::Standard,
EquipmentCategory::Upscale => spec::AusstattKategorieElementType::Gehoben,
EquipmentCategory::Luxury => spec::AusstattKategorieElementType::Luxus,
}
}
}
impl From<spec::AusstattKategorieElementType> for EquipmentCategory {
fn from(value: spec::AusstattKategorieElementType) -> Self {
match value {
spec::AusstattKategorieElementType::Standard => EquipmentCategory::Standard,
spec::AusstattKategorieElementType::Gehoben => EquipmentCategory::Upscale,
spec::AusstattKategorieElementType::Luxus => EquipmentCategory::Luxury,
}
}
}
#[derive(Debug)]
pub struct Equipment {
pub category: Option<EquipmentCategory>,
pub shared_flat_suitable: Option<bool>,
pub rooms_changeable: Option<bool>,
pub bathroom: Option<BathroomFeatures>,
pub kitchen: Option<KitchenFeatures>,
pub flooring: Option<FlooringFeatures>,
pub fireplace: Option<bool>,
pub heating_type: Option<HeatingTypes>,
pub fuel_type: Option<FuelTypes>,
pub air_conditioned: Option<bool>,
pub elevator: Option<ElevatorTypes>,
pub parking_types: Vec<ParkingTypes>,
pub garden_use: Option<bool>,
pub balcony_terrace_orientation: Option<BalconyTerraceOrientation>,
pub furnished: Option<FurnishingLevel>,
pub wheelchair_accessible: Option<bool>,
pub cable_sat_tv: Option<bool>,
pub dvbt: Option<bool>,
pub barrier_free: Option<bool>,
pub sauna: Option<bool>,
pub swimming_pool: Option<bool>,
pub laundry_drying_room: Option<bool>,
pub winter_garden: Option<bool>,
pub dv_cabling: Option<bool>,
pub ramp: Option<bool>,
pub lift_platform: Option<bool>,
pub crane: Option<bool>,
pub guest_terrace: Option<bool>,
pub power_connection_value: Option<String>,
pub canteen_cafeteria: Option<bool>,
pub tea_kitchen: Option<bool>,
pub hall_height: Option<f64>,
pub connected_gastronomy: Option<ConnectedGastronomy>,
pub brewery_obligation: Option<bool>,
pub sports_facilities: Option<bool>,
pub wellness_area: Option<bool>,
pub services: Vec<ServiceOfferings>,
pub holiday_phone: Option<bool>,
pub broadband_access: Option<BroadbandAccess>,
pub umts_reception: Option<bool>,
pub security_technology: Option<SecurityTechnology>,
pub basement: Option<BasementInfo>,
pub storage_room: Option<bool>,
pub bicycle_room: Option<bool>,
pub shutters: Option<bool>,
pub roof_form: Option<RoofForm>,
pub construction_method: Option<ConstructionMethod>,
pub build_out_stage: Option<BuildOutStage>,
pub energy_type: Option<EnergyType>,
pub library: Option<bool>,
pub attic: Option<bool>,
pub guest_wc: Option<bool>,
pub cable_ducts: Option<bool>,
pub senior_friendly: Option<bool>,
pub user_defined_simple_fields: Vec<spec::UserDefinedSimplefieldElementType>,
pub user_defined_any_fields: Vec<spec::UserDefinedAnyfieldElementType>,
pub user_defined_extensions: Vec<spec::UserDefinedExtendElementType>,
}
impl From<Equipment> for spec::AusstattungElementType {
fn from(value: Equipment) -> Self {
spec::AusstattungElementType {
ausstatt_kategorie: value.category.map(Into::into),
wg_geeignet: value.shared_flat_suitable,
raeume_veraenderbar: value.rooms_changeable,
bad: value.bathroom.map(Into::into),
kueche: value.kitchen.map(Into::into),
boden: value.flooring.map(Into::into),
kamin: value.fireplace,
heizungsart: value.heating_type.map(Into::into),
befeuerung: value.fuel_type.map(Into::into),
klimatisiert: value.air_conditioned,
fahrstuhl: value.elevator.map(Into::into),
stellplatzart: value.parking_types.into_iter().map(Into::into).collect(),
gartennutzung: value.garden_use,
ausricht_balkon_terrasse: value.balcony_terrace_orientation.map(Into::into),
moebliert: value.furnished.map(Into::into),
rollstuhlgerecht: value.wheelchair_accessible,
kabel_sat_tv: value.cable_sat_tv,
dvbt: value.dvbt,
barrierefrei: value.barrier_free,
sauna: value.sauna,
swimmingpool: value.swimming_pool,
wasch_trockenraum: value.laundry_drying_room,
wintergarten: value.winter_garden,
dv_verkabelung: value.dv_cabling,
rampe: value.ramp,
hebebuehne: value.lift_platform,
kran: value.crane,
gastterrasse: value.guest_terrace,
stromanschlusswert: value.power_connection_value,
kantine_cafeteria: value.canteen_cafeteria,
teekueche: value.tea_kitchen,
hallenhoehe: value.hall_height,
angeschl_gastronomie: value.connected_gastronomy.map(Into::into),
brauereibindung: value.brewery_obligation,
sporteinrichtungen: value.sports_facilities,
wellnessbereich: value.wellness_area,
serviceleistungen: value.services.into_iter().map(Into::into).collect(),
telefon_ferienimmobilie: value.holiday_phone,
breitband_zugang: value.broadband_access.map(Into::into),
umts_empfang: value.umts_reception,
sicherheitstechnik: value.security_technology.map(Into::into),
unterkellert: value.basement.map(Into::into),
abstellraum: value.storage_room,
fahrradraum: value.bicycle_room,
rolladen: value.shutters,
dachform: value.roof_form.map(Into::into),
bauweise: value.construction_method.map(Into::into),
ausbaustufe: value.build_out_stage.map(Into::into),
energietyp: value.energy_type.map(Into::into),
bibliothek: value.library,
dachboden: value.attic,
gaestewc: value.guest_wc,
kabelkanaele: value.cable_ducts,
seniorengerecht: value.senior_friendly,
user_defined_simplefield: value.user_defined_simple_fields,
user_defined_anyfield: value.user_defined_any_fields,
user_defined_extend: value.user_defined_extensions,
}
}
}
impl From<spec::AusstattungElementType> for Equipment {
fn from(value: spec::AusstattungElementType) -> Self {
Equipment {
category: value.ausstatt_kategorie.map(Into::into),
shared_flat_suitable: value.wg_geeignet,
rooms_changeable: value.raeume_veraenderbar,
bathroom: value.bad.map(Into::into),
kitchen: value.kueche.map(Into::into),
flooring: value.boden.map(Into::into),
fireplace: value.kamin,
heating_type: value.heizungsart.map(Into::into),
fuel_type: value.befeuerung.map(Into::into),
air_conditioned: value.klimatisiert,
elevator: value.fahrstuhl.map(Into::into),
parking_types: value.stellplatzart.into_iter().map(Into::into).collect(),
garden_use: value.gartennutzung,
balcony_terrace_orientation: value.ausricht_balkon_terrasse.map(Into::into),
furnished: value.moebliert.map(Into::into),
wheelchair_accessible: value.rollstuhlgerecht,
cable_sat_tv: value.kabel_sat_tv,
dvbt: value.dvbt,
barrier_free: value.barrierefrei,
sauna: value.sauna,
swimming_pool: value.swimmingpool,
laundry_drying_room: value.wasch_trockenraum,
winter_garden: value.wintergarten,
dv_cabling: value.dv_verkabelung,
ramp: value.rampe,
lift_platform: value.hebebuehne,
crane: value.kran,
guest_terrace: value.gastterrasse,
power_connection_value: value.stromanschlusswert,
canteen_cafeteria: value.kantine_cafeteria,
tea_kitchen: value.teekueche,
hall_height: value.hallenhoehe,
connected_gastronomy: value.angeschl_gastronomie.map(Into::into),
brewery_obligation: value.brauereibindung,
sports_facilities: value.sporteinrichtungen,
wellness_area: value.wellnessbereich,
services: value
.serviceleistungen
.into_iter()
.map(Into::into)
.collect(),
holiday_phone: value.telefon_ferienimmobilie,
broadband_access: value.breitband_zugang.map(Into::into),
umts_reception: value.umts_empfang,
security_technology: value.sicherheitstechnik.map(Into::into),
basement: value.unterkellert.map(Into::into),
storage_room: value.abstellraum,
bicycle_room: value.fahrradraum,
shutters: value.rolladen,
roof_form: value.dachform.map(Into::into),
construction_method: value.bauweise.map(Into::into),
build_out_stage: value.ausbaustufe.map(Into::into),
energy_type: value.energietyp.map(Into::into),
library: value.bibliothek,
attic: value.dachboden,
guest_wc: value.gaestewc,
cable_ducts: value.kabelkanaele,
senior_friendly: value.seniorengerecht,
user_defined_simple_fields: value.user_defined_simplefield,
user_defined_any_fields: value.user_defined_anyfield,
user_defined_extensions: value.user_defined_extend,
}
}
}
#[derive(Debug)]
pub struct BathroomFeatures {
pub shower: Option<bool>,
pub bathtub: Option<bool>,
pub window: Option<bool>,
pub bidet: Option<bool>,
pub urinal: Option<bool>,
}
impl From<BathroomFeatures> for spec::BadElementType {
fn from(value: BathroomFeatures) -> Self {
spec::BadElementType {
dusche: value.shower,
wanne: value.bathtub,
fenster: value.window,
bidet: value.bidet,
pissoir: value.urinal,
}
}
}
impl From<spec::BadElementType> for BathroomFeatures {
fn from(value: spec::BadElementType) -> Self {
BathroomFeatures {
shower: value.dusche,
bathtub: value.wanne,
window: value.fenster,
bidet: value.bidet,
urinal: value.pissoir,
}
}
}
pub type BalconyTerraceArea = rust_decimal::Decimal;
pub type IsBarrierFree = bool;
pub type YearBuilt = String;
#[derive(Debug)]
pub struct ConstructionMethod {
pub solid: Option<bool>,
pub prefab: Option<bool>,
pub timber: Option<bool>,
}
impl From<ConstructionMethod> for spec::BauweiseElementType {
fn from(value: ConstructionMethod) -> Self {
spec::BauweiseElementType {
massiv: value.solid,
fertigteile: value.prefab,
holz: value.timber,
}
}
}
impl From<spec::BauweiseElementType> for ConstructionMethod {
fn from(value: spec::BauweiseElementType) -> Self {
ConstructionMethod {
solid: value.massiv,
prefab: value.fertigteile,
timber: value.holz,
}
}
}
pub type BuildingZone = String;
#[derive(Debug)]
pub struct DevelopableBy {
pub rule: Option<spec::BebaubarNachBebaubarAttrType>,
}
impl From<DevelopableBy> for spec::BebaubarNachElementType {
fn from(value: DevelopableBy) -> Self {
spec::BebaubarNachElementType {
bebaubar_attr: value.rule,
}
}
}
impl From<spec::BebaubarNachElementType> for DevelopableBy {
fn from(value: spec::BebaubarNachElementType) -> Self {
DevelopableBy {
rule: value.bebaubar_attr,
}
}
}
#[derive(Debug)]
pub struct FuelTypes {
pub oil: Option<bool>,
pub gas: Option<bool>,
pub electric: Option<bool>,
pub alternative: Option<bool>,
pub solar: Option<bool>,
pub geothermal: Option<bool>,
pub air_heat_pump: Option<bool>,
pub district_heating: Option<bool>,
pub block_heating: Option<bool>,
pub hydro: Option<bool>,
pub pellets: Option<bool>,
pub coal: Option<bool>,
pub wood: Option<bool>,
pub lpg: Option<bool>,
pub natural_gas_light: Option<bool>,
pub natural_gas_heavy: Option<bool>,
pub district_steam: Option<bool>,
pub local_heating: Option<bool>,
pub heat_delivery: Option<bool>,
pub bioenergy: Option<bool>,
pub wind_energy: Option<bool>,
pub hydro_energy: Option<bool>,
pub ambient_heat: Option<bool>,
pub chp_fossil: Option<bool>,
pub chp_renewable: Option<bool>,
pub chp_regenerative: Option<bool>,
pub chp_bio: Option<bool>,
}
impl From<FuelTypes> for spec::BefeuerungElementType {
fn from(value: FuelTypes) -> Self {
spec::BefeuerungElementType {
oel: value.oil,
gas: value.gas,
elektro: value.electric,
alternativ: value.alternative,
solar: value.solar,
erdwaerme: value.geothermal,
luftwp: value.air_heat_pump,
fern: value.district_heating,
block: value.block_heating,
wasser_elektro: value.hydro,
pellet: value.pellets,
kohle: value.coal,
holz: value.wood,
fluessiggas: value.lpg,
erdgas_leicht: value.natural_gas_light,
erdgas_schwer: value.natural_gas_heavy,
fernwaerme_dampf: value.district_steam,
nahwaerme: value.local_heating,
waermelieferung: value.heat_delivery,
bioenergie: value.bioenergy,
windenergie: value.wind_energy,
wasserenergie: value.hydro_energy,
umweltwaerme: value.ambient_heat,
kwk_fossil: value.chp_fossil,
kwk_erneuerbar: value.chp_renewable,
kwk_regenerativ: value.chp_regenerative,
kwk_bio: value.chp_bio,
}
}
}
impl From<spec::BefeuerungElementType> for FuelTypes {
fn from(value: spec::BefeuerungElementType) -> Self {
FuelTypes {
oil: value.oel,
gas: value.gas,
electric: value.elektro,
alternative: value.alternativ,
solar: value.solar,
geothermal: value.erdwaerme,
air_heat_pump: value.luftwp,
district_heating: value.fern,
block_heating: value.block,
hydro: value.wasser_elektro,
pellets: value.pellet,
coal: value.kohle,
wood: value.holz,
lpg: value.fluessiggas,
natural_gas_light: value.erdgas_leicht,
natural_gas_heavy: value.erdgas_schwer,
district_steam: value.fernwaerme_dampf,
local_heating: value.nahwaerme,
heat_delivery: value.waermelieferung,
bioenergy: value.bioenergie,
wind_energy: value.windenergie,
hydro_energy: value.wasserenergie,
ambient_heat: value.umweltwaerme,
chp_fossil: value.kwk_fossil,
chp_renewable: value.kwk_erneuerbar,
chp_regenerative: value.kwk_regenerativ,
chp_bio: value.kwk_bio,
}
}
}
#[derive(Debug)]
pub struct KitchenFeatures {
pub built_in_kitchen: Option<bool>,
pub open_kitchen: Option<bool>,
pub pantry: Option<bool>,
}
impl From<KitchenFeatures> for spec::KuecheElementType {
fn from(value: KitchenFeatures) -> Self {
spec::KuecheElementType {
ebk: value.built_in_kitchen,
offen: value.open_kitchen,
pantry: value.pantry,
}
}
}
impl From<spec::KuecheElementType> for KitchenFeatures {
fn from(value: spec::KuecheElementType) -> Self {
KitchenFeatures {
built_in_kitchen: value.ebk,
open_kitchen: value.offen,
pantry: value.pantry,
}
}
}
#[derive(Debug)]
pub struct FlooringFeatures {
pub tiles: Option<bool>,
pub stone: Option<bool>,
pub carpet: Option<bool>,
pub parquet: Option<bool>,
pub engineered_parquet: Option<bool>,
pub laminate: Option<bool>,
pub floorboards: Option<bool>,
pub synthetic: Option<bool>,
pub screed: Option<bool>,
pub raised_floor: Option<bool>,
pub linoleum: Option<bool>,
pub marble: Option<bool>,
pub terracotta: Option<bool>,
pub granite: Option<bool>,
}
impl From<FlooringFeatures> for spec::BodenElementType {
fn from(value: FlooringFeatures) -> Self {
spec::BodenElementType {
fliesen: value.tiles,
stein: value.stone,
teppich: value.carpet,
parkett: value.parquet,
fertigparkett: value.engineered_parquet,
laminat: value.laminate,
dielen: value.floorboards,
kunststoff: value.synthetic,
estrich: value.screed,
doppelboden: value.raised_floor,
linoleum: value.linoleum,
marmor: value.marble,
terrakotta: value.terracotta,
granit: value.granite,
}
}
}
impl From<spec::BodenElementType> for FlooringFeatures {
fn from(value: spec::BodenElementType) -> Self {
FlooringFeatures {
tiles: value.fliesen,
stone: value.stein,
carpet: value.teppich,
parquet: value.parkett,
engineered_parquet: value.fertigparkett,
laminate: value.laminat,
floorboards: value.dielen,
synthetic: value.kunststoff,
screed: value.estrich,
raised_floor: value.doppelboden,
linoleum: value.linoleum,
marble: value.marmor,
terracotta: value.terrakotta,
granite: value.granit,
}
}
}
#[derive(Debug)]
pub struct HeatingTypes {
pub stove: Option<bool>,
pub floor_level: Option<bool>,
pub central: Option<bool>,
pub district: Option<bool>,
pub underfloor: Option<bool>,
}
impl From<HeatingTypes> for spec::HeizungsartElementType {
fn from(value: HeatingTypes) -> Self {
spec::HeizungsartElementType {
ofen: value.stove,
etage: value.floor_level,
zentral: value.central,
fern: value.district,
fussboden: value.underfloor,
}
}
}
impl From<spec::HeizungsartElementType> for HeatingTypes {
fn from(value: spec::HeizungsartElementType) -> Self {
HeatingTypes {
stove: value.ofen,
floor_level: value.etage,
central: value.zentral,
district: value.fern,
underfloor: value.fussboden,
}
}
}
#[derive(Debug)]
pub struct ElevatorTypes {
pub passenger: Option<bool>,
pub freight: Option<bool>,
}
impl From<ElevatorTypes> for spec::FahrstuhlElementType {
fn from(value: ElevatorTypes) -> Self {
spec::FahrstuhlElementType {
personen: value.passenger,
lasten: value.freight,
}
}
}
impl From<spec::FahrstuhlElementType> for ElevatorTypes {
fn from(value: spec::FahrstuhlElementType) -> Self {
ElevatorTypes {
passenger: value.personen,
freight: value.lasten,
}
}
}
#[derive(Debug)]
pub struct ParkingTypes {
pub garage: Option<bool>,
pub underground_garage: Option<bool>,
pub carport: Option<bool>,
pub open_space: Option<bool>,
pub parking_garage: Option<bool>,
pub duplex: Option<bool>,
}
impl From<ParkingTypes> for spec::StellplatzartElementType {
fn from(value: ParkingTypes) -> Self {
spec::StellplatzartElementType {
garage: value.garage,
tiefgarage: value.underground_garage,
carport: value.carport,
freiplatz: value.open_space,
parkhaus: value.parking_garage,
duplex: value.duplex,
}
}
}
impl From<spec::StellplatzartElementType> for ParkingTypes {
fn from(value: spec::StellplatzartElementType) -> Self {
ParkingTypes {
garage: value.garage,
underground_garage: value.tiefgarage,
carport: value.carport,
open_space: value.freiplatz,
parking_garage: value.parkhaus,
duplex: value.duplex,
}
}
}
#[derive(Debug)]
pub struct FurnishingLevel {
pub level: Option<spec::MoebliertMoebType>,
}
impl From<FurnishingLevel> for spec::MoebliertElementType {
fn from(value: FurnishingLevel) -> Self {
spec::MoebliertElementType { moeb: value.level }
}
}
impl From<spec::MoebliertElementType> for FurnishingLevel {
fn from(value: spec::MoebliertElementType) -> Self {
FurnishingLevel { level: value.moeb }
}
}
#[derive(Debug)]
pub struct BroadbandAccess {
pub kind: Option<String>,
pub speed_mbit: Option<f64>,
}
impl From<BroadbandAccess> for spec::BreitbandZugangElementType {
fn from(value: BroadbandAccess) -> Self {
spec::BreitbandZugangElementType {
art: value.kind,
speed: value.speed_mbit,
}
}
}
impl From<spec::BreitbandZugangElementType> for BroadbandAccess {
fn from(value: spec::BreitbandZugangElementType) -> Self {
BroadbandAccess {
kind: value.art,
speed_mbit: value.speed,
}
}
}
#[derive(Debug)]
pub struct SecurityTechnology {
pub alarm_system: Option<bool>,
pub camera: Option<bool>,
pub police_call: Option<bool>,
}
impl From<SecurityTechnology> for spec::SicherheitstechnikElementType {
fn from(value: SecurityTechnology) -> Self {
spec::SicherheitstechnikElementType {
alarmanlage: value.alarm_system,
kamera: value.camera,
polizeiruf: value.police_call,
}
}
}
impl From<spec::SicherheitstechnikElementType> for SecurityTechnology {
fn from(value: spec::SicherheitstechnikElementType) -> Self {
SecurityTechnology {
alarm_system: value.alarmanlage,
camera: value.kamera,
police_call: value.polizeiruf,
}
}
}
#[derive(Debug)]
pub struct BasementInfo {
pub basement: Option<spec::UnterkellertKellerType>,
}
impl From<BasementInfo> for spec::UnterkellertElementType {
fn from(value: BasementInfo) -> Self {
spec::UnterkellertElementType {
keller: value.basement,
}
}
}
impl From<spec::UnterkellertElementType> for BasementInfo {
fn from(value: spec::UnterkellertElementType) -> Self {
BasementInfo {
basement: value.keller,
}
}
}
#[derive(Debug)]
pub struct RoofForm {
pub half_hip_roof: Option<bool>,
pub mansard_roof: Option<bool>,
pub shed_roof: Option<bool>,
pub gable_roof: Option<bool>,
pub hip_roof: Option<bool>,
pub flat_roof: Option<bool>,
pub pyramid_roof: Option<bool>,
}
impl From<RoofForm> for spec::DachformElementType {
fn from(value: RoofForm) -> Self {
spec::DachformElementType {
krueppelwalmdach: value.half_hip_roof,
mansarddach: value.mansard_roof,
pultdach: value.shed_roof,
satteldach: value.gable_roof,
walmdach: value.hip_roof,
flachdach: value.flat_roof,
pyramidendach: value.pyramid_roof,
}
}
}
impl From<spec::DachformElementType> for RoofForm {
fn from(value: spec::DachformElementType) -> Self {
RoofForm {
half_hip_roof: value.krueppelwalmdach,
mansard_roof: value.mansarddach,
shed_roof: value.pultdach,
gable_roof: value.satteldach,
hip_roof: value.walmdach,
flat_roof: value.flachdach,
pyramid_roof: value.pyramidendach,
}
}
}
#[derive(Debug)]
pub struct EnergyType {
pub passive_house: Option<bool>,
pub low_energy: Option<bool>,
pub new_build_standard: Option<bool>,
pub kfw40: Option<bool>,
pub kfw60: Option<bool>,
pub kfw55: Option<bool>,
pub kfw70: Option<bool>,
pub minergie_construction: Option<bool>,
pub minergie_certified: Option<bool>,
}
impl From<EnergyType> for spec::EnergietypElementType {
fn from(value: EnergyType) -> Self {
spec::EnergietypElementType {
passivhaus: value.passive_house,
niedrigenergie: value.low_energy,
neubaustandard: value.new_build_standard,
kfw_40: value.kfw40,
kfw_60: value.kfw60,
kfw_55: value.kfw55,
kfw_70: value.kfw70,
minergiebauweise: value.minergie_construction,
minergie_zertifiziert: value.minergie_certified,
}
}
}
impl From<spec::EnergietypElementType> for EnergyType {
fn from(value: spec::EnergietypElementType) -> Self {
EnergyType {
passive_house: value.passivhaus,
low_energy: value.niedrigenergie,
new_build_standard: value.neubaustandard,
kfw40: value.kfw_40,
kfw60: value.kfw_60,
kfw55: value.kfw_55,
kfw70: value.kfw_70,
minergie_construction: value.minergiebauweise,
minergie_certified: value.minergie_zertifiziert,
}
}
}
#[derive(Debug)]
pub struct ServiceOfferings {
pub assisted_living: Option<bool>,
pub catering: Option<bool>,
pub cleaning: Option<bool>,
pub shopping: Option<bool>,
pub security_service: Option<bool>,
}
impl From<ServiceOfferings> for spec::ServiceleistungenElementType {
fn from(value: ServiceOfferings) -> Self {
spec::ServiceleistungenElementType {
betreutes_wohnen: value.assisted_living,
catering: value.catering,
reinigung: value.cleaning,
einkauf: value.shopping,
wachdienst: value.security_service,
}
}
}
impl From<spec::ServiceleistungenElementType> for ServiceOfferings {
fn from(value: spec::ServiceleistungenElementType) -> Self {
ServiceOfferings {
assisted_living: value.betreutes_wohnen,
catering: value.catering,
cleaning: value.reinigung,
shopping: value.einkauf,
security_service: value.wachdienst,
}
}
}
#[derive(Debug)]
pub struct AreaDetails {
pub living_area: Option<f64>,
pub usable_area: Option<f64>,
pub total_area: Option<f64>,
pub shop_area: Option<f64>,
pub storage_area: Option<f64>,
pub sales_area: Option<f64>,
pub open_area: Option<f64>,
pub office_area: Option<f64>,
pub office_sub_area: Option<f64>,
pub window_frontage: Option<f64>,
pub administration_area: Option<f64>,
pub gastronomy_area: Option<f64>,
pub site_coverage_ratio: Option<String>,
pub floor_space_index: Option<String>,
pub mass_index: Option<String>,
pub gross_floor_area: Option<String>,
pub plot_area: Option<f64>,
pub other_area: Option<f64>,
pub rooms: Option<f64>,
pub bedrooms: Option<f64>,
pub bathrooms: Option<f64>,
pub separate_wcs: Option<f64>,
pub balconies: Option<f64>,
pub terraces: Option<f64>,
pub loggias: Option<f64>,
pub balcony_terrace_area: Option<f64>,
pub living_sleeping_rooms: Option<f64>,
pub garden_area: Option<f64>,
pub basement_area: Option<f64>,
pub window_frontage_area: Option<f64>,
pub plot_frontage: Option<f64>,
pub attic_area: Option<f64>,
pub divisible_from: Option<f64>,
pub heated_area: Option<f64>,
pub parking_spaces: Option<u64>,
pub restaurant_seats: Option<f64>,
pub beds: Option<f64>,
pub meeting_rooms: Option<f64>,
pub lettable_area: Option<f64>,
pub residential_units: Option<f64>,
pub commercial_units: Option<f64>,
pub granny_flat: Option<bool>,
pub building_volume: Option<f64>,
pub floor_area_ratio: Option<f64>,
pub area_from: Option<f64>,
pub area_to: Option<f64>,
pub user_defined_simple_fields: Vec<spec::UserDefinedSimplefieldElementType>,
pub user_defined_any_fields: Vec<spec::UserDefinedAnyfieldElementType>,
pub user_defined_extensions: Vec<spec::UserDefinedExtendElementType>,
}
impl From<AreaDetails> for spec::FlaechenElementType {
fn from(value: AreaDetails) -> Self {
spec::FlaechenElementType {
wohnflaeche: value.living_area,
nutzflaeche: value.usable_area,
gesamtflaeche: value.total_area,
ladenflaeche: value.shop_area,
lagerflaeche: value.storage_area,
verkaufsflaeche: value.sales_area,
freiflaeche: value.open_area,
bueroflaeche: value.office_area,
bueroteilflaeche: value.office_sub_area,
fensterfront: value.window_frontage,
verwaltungsflaeche: value.administration_area,
gastroflaeche: value.gastronomy_area,
grz: value.site_coverage_ratio,
gfz: value.floor_space_index,
bmz: value.mass_index,
bgf: value.gross_floor_area,
grundstuecksflaeche: value.plot_area,
sonstflaeche: value.other_area,
anzahl_zimmer: value.rooms,
anzahl_schlafzimmer: value.bedrooms,
anzahl_badezimmer: value.bathrooms,
anzahl_sep_wc: value.separate_wcs,
anzahl_balkone: value.balconies,
anzahl_terrassen: value.terraces,
anzahl_logia: value.loggias,
balkon_terrasse_flaeche: value.balcony_terrace_area,
anzahl_wohn_schlafzimmer: value.living_sleeping_rooms,
gartenflaeche: value.garden_area,
kellerflaeche: value.basement_area,
fensterfront_qm: value.window_frontage_area,
grundstuecksfront: value.plot_frontage,
dachbodenflaeche: value.attic_area,
teilbar_ab: value.divisible_from,
beheizbare_flaeche: value.heated_area,
anzahl_stellplaetze: value.parking_spaces,
plaetze_gastraum: value.restaurant_seats,
anzahl_betten: value.beds,
anzahl_tagungsraeume: value.meeting_rooms,
vermietbare_flaeche: value.lettable_area,
anzahl_wohneinheiten: value.residential_units,
anzahl_gewerbeeinheiten: value.commercial_units,
einliegerwohnung: value.granny_flat,
kubatur: value.building_volume,
ausnuetzungsziffer: value.floor_area_ratio,
flaechevon: value.area_from,
flaechebis: value.area_to,
user_defined_simplefield: value.user_defined_simple_fields,
user_defined_anyfield: value.user_defined_any_fields,
user_defined_extend: value.user_defined_extensions,
}
}
}
impl From<spec::FlaechenElementType> for AreaDetails {
fn from(value: spec::FlaechenElementType) -> Self {
AreaDetails {
living_area: value.wohnflaeche,
usable_area: value.nutzflaeche,
total_area: value.gesamtflaeche,
shop_area: value.ladenflaeche,
storage_area: value.lagerflaeche,
sales_area: value.verkaufsflaeche,
open_area: value.freiflaeche,
office_area: value.bueroflaeche,
office_sub_area: value.bueroteilflaeche,
window_frontage: value.fensterfront,
administration_area: value.verwaltungsflaeche,
gastronomy_area: value.gastroflaeche,
site_coverage_ratio: value.grz,
floor_space_index: value.gfz,
mass_index: value.bmz,
gross_floor_area: value.bgf,
plot_area: value.grundstuecksflaeche,
other_area: value.sonstflaeche,
rooms: value.anzahl_zimmer,
bedrooms: value.anzahl_schlafzimmer,
bathrooms: value.anzahl_badezimmer,
separate_wcs: value.anzahl_sep_wc,
balconies: value.anzahl_balkone,
terraces: value.anzahl_terrassen,
loggias: value.anzahl_logia,
balcony_terrace_area: value.balkon_terrasse_flaeche,
living_sleeping_rooms: value.anzahl_wohn_schlafzimmer,
garden_area: value.gartenflaeche,
basement_area: value.kellerflaeche,
window_frontage_area: value.fensterfront_qm,
plot_frontage: value.grundstuecksfront,
attic_area: value.dachbodenflaeche,
divisible_from: value.teilbar_ab,
heated_area: value.beheizbare_flaeche,
parking_spaces: value.anzahl_stellplaetze,
restaurant_seats: value.plaetze_gastraum,
beds: value.anzahl_betten,
meeting_rooms: value.anzahl_tagungsraeume,
lettable_area: value.vermietbare_flaeche,
residential_units: value.anzahl_wohneinheiten,
commercial_units: value.anzahl_gewerbeeinheiten,
granny_flat: value.einliegerwohnung,
building_volume: value.kubatur,
floor_area_ratio: value.ausnuetzungsziffer,
area_from: value.flaechevon,
area_to: value.flaechebis,
user_defined_simple_fields: value.user_defined_simplefield,
user_defined_any_fields: value.user_defined_anyfield,
user_defined_extensions: value.user_defined_extend,
}
}
}
#[derive(Debug)]
pub struct ContactPhoto {
pub location: spec::FotoLocationType,
pub format: Option<String>,
pub data: spec::DatenElementType,
}
impl From<ContactPhoto> for spec::FotoElementType {
fn from(value: ContactPhoto) -> Self {
spec::FotoElementType {
location: value.location,
format: value.format,
daten: value.data,
}
}
}
impl From<spec::FotoElementType> for ContactPhoto {
fn from(value: spec::FotoElementType) -> Self {
ContactPhoto {
location: value.location,
format: value.format,
data: value.daten,
}
}
}
#[derive(Debug)]
pub struct FreeTexts {
pub title: Option<String>,
pub teaser: Option<String>,
pub location: Option<String>,
pub equipment_description: Option<String>,
pub property_description: Option<String>,
pub other_notes: Option<String>,
pub localized_text: Option<spec::ObjektTextElementType>,
pub user_defined_simple_fields: Vec<spec::UserDefinedSimplefieldElementType>,
pub user_defined_any_fields: Vec<spec::UserDefinedAnyfieldElementType>,
pub user_defined_extensions: Vec<spec::UserDefinedExtendElementType>,
}
impl From<FreeTexts> for spec::FreitexteElementType {
fn from(value: FreeTexts) -> Self {
spec::FreitexteElementType {
objekttitel: value.title,
dreizeiler: value.teaser,
lage: value.location,
ausstatt_beschr: value.equipment_description,
objektbeschreibung: value.property_description,
sonstige_angaben: value.other_notes,
objekt_text: value.localized_text,
user_defined_simplefield: value.user_defined_simple_fields,
user_defined_anyfield: value.user_defined_any_fields,
user_defined_extend: value.user_defined_extensions,
}
}
}
impl From<spec::FreitexteElementType> for FreeTexts {
fn from(value: spec::FreitexteElementType) -> Self {
FreeTexts {
title: value.objekttitel,
teaser: value.dreizeiler,
location: value.lage,
equipment_description: value.ausstatt_beschr,
property_description: value.objektbeschreibung,
other_notes: value.sonstige_angaben,
localized_text: value.objekt_text,
user_defined_simple_fields: value.user_defined_simplefield,
user_defined_any_fields: value.user_defined_anyfield,
user_defined_extensions: value.user_defined_extend,
}
}
}
#[derive(Debug)]
pub struct GeoInfo {
pub content: Vec<GeoContent>,
}
impl From<GeoInfo> for spec::GeoElementType {
fn from(value: GeoInfo) -> Self {
spec::GeoElementType {
content: value.content.into_iter().map(Into::into).collect(),
}
}
}
impl From<spec::GeoElementType> for GeoInfo {
fn from(value: spec::GeoElementType) -> Self {
GeoInfo {
content: value.content.into_iter().map(Into::into).collect(),
}
}
}
#[derive(Debug)]
pub enum GeoContent {
PostalCode(String),
City(String),
Coordinates(Coordinates),
Street(String),
HouseNumber(String),
State(String),
Country(spec::LandElementType),
MunicipalityCode(String),
Parcel(String),
ParcelPart(String),
District(String),
Floor(i32),
TotalFloors(i32),
LocationInBuilding(spec::LageImBauElementType),
ApartmentNumber(String),
AreaLocation(spec::LageGebietElementType),
RegionalAddition(String),
MapMacro(bool),
MapMicro(bool),
VirtualTour(bool),
AerialPhotos(bool),
UserDefinedSimplefield(spec::UserDefinedSimplefieldElementType),
UserDefinedAnyfield(spec::UserDefinedAnyfieldElementType),
UserDefinedExtend(spec::UserDefinedExtendElementType),
}
impl From<GeoContent> for spec::GeoElementTypeContent {
fn from(value: GeoContent) -> Self {
match value {
GeoContent::PostalCode(value) => spec::GeoElementTypeContent::Plz(value),
GeoContent::City(value) => spec::GeoElementTypeContent::Ort(value),
GeoContent::Coordinates(value) => {
spec::GeoElementTypeContent::Geokoordinaten(value.into())
}
GeoContent::Street(value) => spec::GeoElementTypeContent::Strasse(value),
GeoContent::HouseNumber(value) => spec::GeoElementTypeContent::Hausnummer(value),
GeoContent::State(value) => spec::GeoElementTypeContent::Bundesland(value),
GeoContent::Country(value) => spec::GeoElementTypeContent::Land(value),
GeoContent::MunicipalityCode(value) => spec::GeoElementTypeContent::Gemeindecode(value),
GeoContent::Parcel(value) => spec::GeoElementTypeContent::Flur(value),
GeoContent::ParcelPart(value) => spec::GeoElementTypeContent::Flurstueck(value),
GeoContent::District(value) => spec::GeoElementTypeContent::Gemarkung(value),
GeoContent::Floor(value) => spec::GeoElementTypeContent::Etage(value),
GeoContent::TotalFloors(value) => spec::GeoElementTypeContent::AnzahlEtagen(value),
GeoContent::LocationInBuilding(value) => spec::GeoElementTypeContent::LageImBau(value),
GeoContent::ApartmentNumber(value) => spec::GeoElementTypeContent::Wohnungsnr(value),
GeoContent::AreaLocation(value) => spec::GeoElementTypeContent::LageGebiet(value),
GeoContent::RegionalAddition(value) => {
spec::GeoElementTypeContent::RegionalerZusatz(value)
}
GeoContent::MapMacro(value) => spec::GeoElementTypeContent::KartenMakro(value),
GeoContent::MapMicro(value) => spec::GeoElementTypeContent::KartenMikro(value),
GeoContent::VirtualTour(value) => spec::GeoElementTypeContent::Virtuelletour(value),
GeoContent::AerialPhotos(value) => spec::GeoElementTypeContent::Luftbildern(value),
GeoContent::UserDefinedSimplefield(value) => {
spec::GeoElementTypeContent::UserDefinedSimplefield(value)
}
GeoContent::UserDefinedAnyfield(value) => {
spec::GeoElementTypeContent::UserDefinedAnyfield(value)
}
GeoContent::UserDefinedExtend(value) => {
spec::GeoElementTypeContent::UserDefinedExtend(value)
}
}
}
}
impl From<spec::GeoElementTypeContent> for GeoContent {
fn from(value: spec::GeoElementTypeContent) -> Self {
match value {
spec::GeoElementTypeContent::Plz(value) => GeoContent::PostalCode(value),
spec::GeoElementTypeContent::Ort(value) => GeoContent::City(value),
spec::GeoElementTypeContent::Geokoordinaten(value) => {
GeoContent::Coordinates(value.into())
}
spec::GeoElementTypeContent::Strasse(value) => GeoContent::Street(value),
spec::GeoElementTypeContent::Hausnummer(value) => GeoContent::HouseNumber(value),
spec::GeoElementTypeContent::Bundesland(value) => GeoContent::State(value),
spec::GeoElementTypeContent::Land(value) => GeoContent::Country(value),
spec::GeoElementTypeContent::Gemeindecode(value) => GeoContent::MunicipalityCode(value),
spec::GeoElementTypeContent::Flur(value) => GeoContent::Parcel(value),
spec::GeoElementTypeContent::Flurstueck(value) => GeoContent::ParcelPart(value),
spec::GeoElementTypeContent::Gemarkung(value) => GeoContent::District(value),
spec::GeoElementTypeContent::Etage(value) => GeoContent::Floor(value),
spec::GeoElementTypeContent::AnzahlEtagen(value) => GeoContent::TotalFloors(value),
spec::GeoElementTypeContent::LageImBau(value) => GeoContent::LocationInBuilding(value),
spec::GeoElementTypeContent::Wohnungsnr(value) => GeoContent::ApartmentNumber(value),
spec::GeoElementTypeContent::LageGebiet(value) => GeoContent::AreaLocation(value),
spec::GeoElementTypeContent::RegionalerZusatz(value) => {
GeoContent::RegionalAddition(value)
}
spec::GeoElementTypeContent::KartenMakro(value) => GeoContent::MapMacro(value),
spec::GeoElementTypeContent::KartenMikro(value) => GeoContent::MapMicro(value),
spec::GeoElementTypeContent::Virtuelletour(value) => GeoContent::VirtualTour(value),
spec::GeoElementTypeContent::Luftbildern(value) => GeoContent::AerialPhotos(value),
spec::GeoElementTypeContent::UserDefinedSimplefield(value) => {
GeoContent::UserDefinedSimplefield(value)
}
spec::GeoElementTypeContent::UserDefinedAnyfield(value) => {
GeoContent::UserDefinedAnyfield(value)
}
spec::GeoElementTypeContent::UserDefinedExtend(value) => {
GeoContent::UserDefinedExtend(value)
}
}
}
}
#[derive(Debug)]
pub struct Coordinates {
pub latitude: Option<f32>,
pub longitude: Option<f32>,
}
impl From<Coordinates> for spec::GeokoordinatenElementType {
fn from(value: Coordinates) -> Self {
spec::GeokoordinatenElementType {
breitengrad: value.latitude,
laengengrad: value.longitude,
}
}
}
impl From<spec::GeokoordinatenElementType> for Coordinates {
fn from(value: spec::GeokoordinatenElementType) -> Self {
Coordinates {
latitude: value.breitengrad,
longitude: value.laengengrad,
}
}
}
#[derive(Debug)]
pub struct Property(pub spec::ImmobilieElementType);
impl From<Property> for spec::ImmobilieElementType {
fn from(value: Property) -> Self {
value.0
}
}
impl From<spec::ImmobilieElementType> for Property {
fn from(value: spec::ImmobilieElementType) -> Self {
Property(value)
}
}