Skip to main content

ticketmaster_rs/models/
event.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4#[serde(rename_all = "camelCase")]
5pub struct Event {
6    pub name: Option<String>,
7
8    #[serde(rename = "type")]
9    pub event_type: String,
10
11    pub id: String,
12
13    pub test: bool,
14
15    pub url: Option<String>,
16
17    pub locale: String,
18
19    pub images: Vec<Image>,
20
21    pub sales: Option<Sales>,
22
23    pub dates: Dates,
24
25    #[serde(default)]
26    pub classifications: Vec<Classification>,
27
28    pub promoter: Option<Promoter>,
29
30    #[serde(default)]
31    pub promoters: Vec<Promoter>,
32
33    #[serde(default)]
34    pub price_ranges: Vec<PriceRange>,
35
36    #[serde(default)]
37    pub products: Vec<Product>,
38
39    pub seatmap: Option<Seatmap>,
40
41    pub accessibility: Option<Accessibility>,
42
43    pub ticket_limit: Option<TicketLimit>,
44
45    pub age_restrictions: Option<AgeRestrictions>,
46
47    pub ticketing: Option<Ticketing>,
48
49    #[serde(rename = "_links")]
50    pub links: EventLinks,
51
52    #[serde(rename = "_embedded")]
53    #[serde(default)]
54    pub embedded: EventEmbedded,
55
56    pub info: Option<String>,
57
58    pub please_note: Option<String>,
59}
60
61#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
62#[serde(rename_all = "camelCase")]
63pub struct Accessibility {
64    pub ticket_limit: Option<i64>,
65
66    pub id: String,
67
68    pub info: Option<String>,
69}
70
71#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
72#[serde(rename_all = "camelCase")]
73pub struct AgeRestrictions {
74    pub legal_age_enforced: bool,
75
76    pub id: String,
77}
78
79#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
80#[serde(rename_all = "camelCase")]
81pub struct Classification {
82    pub primary: bool,
83
84    pub segment: Option<Genre>,
85
86    pub genre: Option<Genre>,
87
88    pub sub_genre: Option<Genre>,
89
90    #[serde(rename = "type")]
91    pub classification_type: Option<Genre>,
92
93    pub sub_type: Option<Genre>,
94
95    pub family: bool,
96}
97
98#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
99pub struct Genre {
100    pub id: String,
101
102    pub name: Option<String>,
103}
104
105#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
106#[serde(rename_all = "camelCase")]
107pub struct Dates {
108    pub start: Start,
109
110    pub timezone: Option<String>,
111
112    pub status: Status,
113
114    pub span_multiple_days: bool,
115}
116
117#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
118#[serde(rename_all = "camelCase")]
119pub struct Start {
120    pub local_date: Option<String>,
121
122    pub local_time: Option<String>,
123
124    pub date_time: Option<String>,
125
126    #[serde(rename = "dateTBD")]
127    pub date_tbd: bool,
128
129    #[serde(rename = "dateTBA")]
130    pub date_tba: bool,
131
132    #[serde(rename = "timeTBA")]
133    pub time_tba: bool,
134
135    pub no_specific_time: bool,
136}
137
138#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
139pub struct Status {
140    pub code: String,
141}
142
143#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
144pub struct EventEmbedded {
145    #[serde(default)]
146    pub venues: Vec<Venue>,
147
148    #[serde(default)]
149    pub attractions: Vec<Attraction>,
150}
151
152#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
153#[serde(rename_all = "camelCase")]
154pub struct Attraction {
155    pub name: Option<String>,
156
157    #[serde(rename = "type")]
158    pub attraction_type: Option<String>,
159
160    pub id: String,
161
162    pub test: bool,
163
164    pub url: Option<String>,
165
166    pub locale: String,
167
168    pub external_links: Option<ExternalLinks>,
169
170    #[serde(default)]
171    pub aliases: Vec<String>,
172
173    #[serde(default)]
174    pub images: Vec<Image>,
175
176    #[serde(default)]
177    pub classifications: Vec<Classification>,
178
179    pub upcoming_events: AttractionUpcomingEvents,
180
181    #[serde(rename = "_links")]
182    pub links: AttractionLinks,
183}
184
185#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
186pub struct ExternalLinks {
187    #[serde(default)]
188    pub twitter: Vec<SocialLink>,
189
190    #[serde(default)]
191    pub facebook: Vec<SocialLink>,
192
193    #[serde(default)]
194    pub wiki: Vec<SocialLink>,
195
196    #[serde(default)]
197    pub instagram: Vec<SocialLink>,
198
199    #[serde(default)]
200    pub homepage: Vec<SocialLink>,
201}
202
203#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
204pub struct SocialLink {
205    pub url: Option<String>,
206}
207
208#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
209pub struct Image {
210    pub ratio: Option<String>,
211
212    pub url: Option<String>,
213
214    pub width: i64,
215
216    pub height: i64,
217
218    pub fallback: bool,
219}
220
221#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
222pub struct AttractionLinks {
223    #[serde(rename = "self")]
224    pub links_self: First,
225}
226
227#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
228pub struct First {
229    pub href: String,
230}
231
232#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
233pub struct AttractionUpcomingEvents {
234    pub tmr: Option<i64>,
235
236    pub ticketmaster: Option<i64>,
237
238    #[serde(rename = "_total")]
239    pub total: i64,
240
241    #[serde(rename = "_filtered")]
242    pub filtered: i64,
243}
244
245#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
246#[serde(rename_all = "camelCase")]
247pub struct Venue {
248    pub name: Option<String>,
249
250    #[serde(rename = "type")]
251    pub venue_type: Option<String>,
252
253    pub id: String,
254
255    pub test: bool,
256
257    pub url: Option<String>,
258
259    pub locale: String,
260
261    #[serde(default)]
262    pub images: Vec<Image>,
263
264    pub postal_code: Option<String>,
265
266    pub timezone: Option<String>,
267
268    pub city: City,
269
270    pub state: Option<State>,
271
272    pub country: Country,
273
274    pub address: Option<Address>,
275
276    pub location: Option<Location>,
277
278    #[serde(default)]
279    pub markets: Vec<Genre>,
280
281    #[serde(default)]
282    pub dmas: Vec<Dma>,
283
284    pub upcoming_events: VenueUpcomingEvents,
285
286    #[serde(rename = "_links")]
287    pub links: AttractionLinks,
288
289    pub box_office_info: Option<BoxOfficeInfo>,
290
291    pub parking_detail: Option<String>,
292
293    pub accessible_seating_detail: Option<String>,
294
295    pub general_info: Option<GeneralInfo>,
296
297    #[serde(default)]
298    pub aliases: Vec<String>,
299
300    pub social: Option<Social>,
301
302    pub ada: Option<Ada>,
303}
304
305#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
306#[serde(rename_all = "camelCase")]
307pub struct Ada {
308    pub ada_phones: Option<String>,
309
310    pub ada_custom_copy: Option<String>,
311
312    pub ada_hours: Option<String>,
313}
314
315#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
316pub struct Address {
317    pub line1: String,
318}
319
320#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
321#[serde(rename_all = "camelCase")]
322pub struct BoxOfficeInfo {
323    pub phone_number_detail: Option<String>,
324
325    pub open_hours_detail: Option<String>,
326
327    pub accepted_payment_detail: Option<String>,
328
329    pub will_call_detail: Option<String>,
330}
331
332#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
333pub struct City {
334    pub name: Option<String>,
335}
336
337#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
338#[serde(rename_all = "camelCase")]
339pub struct Country {
340    pub name: Option<String>,
341
342    pub country_code: String,
343}
344
345#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
346pub struct Dma {
347    pub id: i64,
348}
349
350#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
351#[serde(rename_all = "camelCase")]
352pub struct GeneralInfo {
353    pub general_rule: Option<String>,
354
355    pub child_rule: Option<String>,
356}
357
358#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
359pub struct Location {
360    pub longitude: String,
361
362    pub latitude: String,
363}
364
365#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
366pub struct Social {
367    pub twitter: Twitter,
368}
369
370#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
371pub struct Twitter {
372    pub handle: String,
373}
374
375#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
376#[serde(rename_all = "camelCase")]
377pub struct State {
378    pub name: Option<String>,
379
380    pub state_code: String,
381}
382
383#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
384pub struct VenueUpcomingEvents {
385    pub archtics: Option<i64>,
386
387    pub ticketmaster: Option<i64>,
388
389    #[serde(rename = "_total")]
390    pub total: i64,
391
392    #[serde(rename = "_filtered")]
393    pub filtered: i64,
394
395    pub tmr: Option<i64>,
396
397    pub universe: Option<i64>,
398}
399
400#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
401pub struct EventLinks {
402    #[serde(rename = "self")]
403    pub links_self: First,
404
405    #[serde(default)]
406    pub attractions: Vec<First>,
407
408    #[serde(default)]
409    pub venues: Vec<First>,
410}
411
412#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
413pub struct PriceRange {
414    #[serde(rename = "type")]
415    pub price_range_type: Option<String>,
416
417    pub currency: String,
418
419    pub min: Option<f64>,
420
421    pub max: Option<f64>,
422}
423
424#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
425pub struct Product {
426    pub name: Option<String>,
427
428    pub id: String,
429
430    pub url: Option<String>,
431
432    #[serde(rename = "type")]
433    pub product_type: Option<String>,
434
435    pub classifications: Vec<Classification>,
436}
437
438#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
439pub struct Promoter {
440    pub id: String,
441
442    pub name: Option<String>,
443
444    pub description: Option<String>,
445}
446
447#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
448pub struct Sales {
449    pub public: Public,
450
451    #[serde(default)]
452    pub presales: Vec<Presale>,
453}
454
455#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
456#[serde(rename_all = "camelCase")]
457pub struct Presale {
458    pub start_date_time: Option<String>,
459
460    pub end_date_time: Option<String>,
461
462    pub name: Option<String>,
463
464    pub description: Option<String>,
465}
466
467#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
468#[serde(rename_all = "camelCase")]
469pub struct Public {
470    pub start_date_time: Option<String>,
471
472    #[serde(rename = "startTBD")]
473    pub start_tbd: bool,
474
475    #[serde(rename = "startTBA")]
476    pub start_tba: bool,
477
478    pub end_date_time: Option<String>,
479}
480
481#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
482#[serde(rename_all = "camelCase")]
483pub struct Seatmap {
484    pub static_url: Option<String>,
485
486    pub id: String,
487}
488
489#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
490pub struct TicketLimit {
491    pub info: Option<String>,
492
493    pub id: String,
494}
495
496#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
497#[serde(rename_all = "camelCase")]
498pub struct Ticketing {
499    pub safe_tix: SafeTix,
500
501    #[serde(default)]
502    pub all_inclusive_pricing: AllInclusivePricing,
503
504    pub id: String,
505}
506
507#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
508pub struct AllInclusivePricing {
509    pub enabled: bool,
510}
511
512#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
513#[serde(rename_all = "camelCase")]
514pub struct SafeTix {
515    #[serde(default)]
516    pub enabled: bool,
517
518    #[serde(default)]
519    pub in_app_only_enabled: bool,
520}