naurt_api/models/
feature_properties.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct FeatureProperties {
16 #[serde(rename = "naurt_type")]
17 pub naurt_type: NaurtType,
18 #[serde(rename = "accuracy", skip_serializing_if = "Option::is_none")]
19 pub accuracy: Option<Box<models::Accuracy>>,
20 #[serde(rename = "minimum_parking_to_door_distance", skip_serializing_if = "Option::is_none")]
21 pub minimum_parking_to_door_distance: Option<f64>,
22}
23
24impl FeatureProperties {
25 pub fn new(naurt_type: NaurtType) -> FeatureProperties {
26 FeatureProperties {
27 naurt_type,
28 accuracy: None,
29 minimum_parking_to_door_distance: None,
30 }
31 }
32}
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
35pub enum NaurtType {
36 #[serde(rename = "basic_geocode")]
37 BasicGeocode,
38 #[serde(rename = "naurt_door")]
39 NaurtDoor,
40 #[serde(rename = "naurt_building")]
41 NaurtBuilding,
42 #[serde(rename = "naurt_parking")]
43 NaurtParking,
44}
45
46impl Default for NaurtType {
47 fn default() -> NaurtType {
48 Self::BasicGeocode
49 }
50}
51