1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
use super::*;
use serde::Deserialize;

#[derive(Deserialize, Debug)]
#[serde(tag = "type")]
pub enum OpeningEvent {
    #[serde(rename = "open")]
    Open { value: Date },
    #[serde(rename = "close")]
    Close { value: Date },
}

#[derive(Deserialize, Debug)]
pub struct OpeningTimes {
    pub monday: Option<Vec<OpeningEvent>>,
    pub tuesday: Option<Vec<OpeningEvent>>,
    pub wednesday: Option<Vec<OpeningEvent>>,
    pub thursday: Option<Vec<OpeningEvent>>,
    pub friday: Option<Vec<OpeningEvent>>,
    pub saturday: Option<Vec<OpeningEvent>>,
    pub sunday: Option<Vec<OpeningEvent>>,
}

#[derive(Deserialize, Debug)]
pub struct CompletionEstimates {
    pub delivery: String,
    pub delivery_rush: String,
    pub normal: String,
    pub order_estimates_in_use: bool,
    pub rush: String,
}

#[derive(Deserialize, Debug)]
pub struct Rush {
    pub queue_minutes: bool,
    pub status: bool,
}

#[derive(Deserialize, Debug)]
pub struct Tag {}

#[derive(Deserialize, Debug)]
pub struct EggTimers {
    pub delivery: i32,
    pub eatin: i32,
    pub takeaway: i32,
}

#[derive(Deserialize, Debug)]
#[serde(tag = "type")]
pub enum GeoRange {
    Polygon { coordinates: Vec<Vec<(f64, f64)>> },
}

#[derive(Deserialize, Debug)]
pub struct PricingRange {
    pub a: i32,
    pub b: f64,
    pub max: i32,
    pub min: i32,
}

#[derive(Deserialize, Debug)]
pub struct DeliveryPricing {
    pub base_price: i32,
    pub distance_ranges: Vec<PricingRange>,
    pub price_multiplier: f64,
    pub price_ranges: Vec<PricingRange>,
    pub tax: f64,

    #[serde(flatten)]
    pub _extra_fields: std::collections::HashMap<String, serde_json::Value>,
}

#[derive(Deserialize, Debug)]
pub struct DeliverySpecsPrice {
    tax: f64,
}

#[derive(Deserialize, Debug)]
pub struct ServiceTime {
    bike: i32,
    car: i32,
}

#[derive(Deserialize, Debug)]
pub struct DeliverySpecs {
    pub capability_values: Option<Vec<String>>,
    pub courier_restrictions: i32,
    pub custom_geo_range: Option<GeoRange>,
    pub delivery_enabled: bool,
    pub delivery_pricing: DeliveryPricing,
    pub delivery_times: OpeningTimes,
    pub forbidden_capabilities: Vec<String>,
    pub geo_range: GeoRange,
    pub postcode_range: Vec<String>,
    pub price: DeliverySpecsPrice,
    pub require_street_address: bool,
    pub required_capabilities: Vec<String>,
    pub road_range: Option<i32>,
    pub road_range_mode: String,
    pub service_time: ServiceTime,
    pub use_default_autogenerated_geo_range: bool,
    pub use_default_delivery_pricing: bool,

    #[serde(flatten)]
    pub _extra_fields: std::collections::HashMap<String, serde_json::Value>,
}

#[derive(Deserialize, Debug)]
pub struct Rating {
    pub negative_percentage: i32,
    pub neutral_percentage: i32,
    pub positive_percentage: i32,
    pub rating: i32,
    pub score: f64,
    pub text: String,
    pub volume: i32,
}

#[derive(Deserialize, Debug)]
pub struct Venue {
    pub phone: String,
    pub id: ObjectReference,
    pub delivery_methods: Vec<String>,
    pub high_volume_venue: bool,
    pub bank_account_type: String,
    pub preorder_only: bool,
    pub comment_disabled: bool,
    pub group_order_enabled: bool,
    pub short_description: Vec<LocalizedString>,
    pub country: String,
    pub r#type: String,
    pub food_tags: Vec<String>,
    pub always_available: bool,
    pub itemid: ObjectReference,
    pub opening_times: OpeningTimes,
    pub description: Vec<LocalizedString>,
    pub wolt_delivery: bool,
    pub allowed_payment_methods: Vec<String>,
    pub relevancy: f64,
    pub show_delivery_info_on_merchant: bool,
    pub preorder_times: OpeningTimes,
    pub ratings_and_reviews_enabled: bool,
    pub show_delivery_price_on_merchant: bool,
    pub alive: i32,
    pub franchise: Option<String>,
    pub public_visible: bool,
    pub merchant: ObjectReference,
    pub post_code: String,
    pub show_allergy_disclaimer_on_menu: bool,
    pub slug: String,
    pub mainimage: String,
    pub status: String,
    pub city: String,
    pub completion_estimates: CompletionEstimates,
    pub customer_support_phone: String,
    pub preorder_enabled: bool,
    pub rush: Rush,
    pub dropoff_note_prefix: String,
    pub show_phone_number_on_merchant: bool,
    pub timezone_name: String,
    pub online: bool,
    pub timezone: String,
    pub website: String,
    pub menu_layout: String,
    pub name: Vec<LocalizedString>,
    pub mainimage_blurhash: String,
    pub tags: Vec<Tag>,
    pub estimates: Estimates,
    pub currency: String,
    pub delivery_specs: DeliverySpecs,
    pub egg_timers: Option<EggTimers>,
    pub price_range: i32,
    pub rating: Rating,
    pub favourite: bool,
    pub listimage_blurhash: String,
    pub address: String,
    pub relevancy_from_purchases: f64,
    pub presence: String,
    pub product_line: String,
    pub listimage: String,
    pub public_url: String,
    pub active_menu: ObjectReference,
    pub location: Location,
    pub b2b_recommended: Option<bool>,
    pub bank_routing_code: Option<String>,

    #[serde(flatten)]
    pub _extra_fields: std::collections::HashMap<String, serde_json::Value>,
}

#[derive(Deserialize, Debug)]
pub struct VenueResults {
    pub results: Vec<Venue>,
    pub status: String,

    #[serde(flatten)]
    pub _extra_fields: std::collections::HashMap<String, serde_json::Value>,
}