ticketmeister 0.1.2

A lightweight and intuitive library for accessing ticket master api in rust
Documentation
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
use api_request_utils_rs::serde::{Deserialize,Serialize};

use crate::{
    Market,
    Dma,
    ImageRatio,
    EventStatus
};

/// Total number of available elements in server
#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize,Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Page {
    /// Size of page.
    pub size : u16,

    /// Total number of available elements in server
    #[serde(rename="totalElements")]
    pub total_elements : u16,

    /// Total number of available elements in server
    #[serde(rename="totalPages")]
    pub total_pages : u16,

    /// Current page number (counted from 0)
    #[serde(rename="number")]
    pub current_page : u16
}

/// Represents information about an entity.
#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")]
pub struct Info {
    /// The ID of the entity.
    pub id: String,
    /// The Name of the entity.
    pub name: String,
    /// Locale in which the content is returned.
    pub locale: String,
}

#[derive(Debug)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")]
pub struct Event {
    #[serde(flatten)]
    pub info : Info,

    #[serde(rename ="test")]
    pub is_test: bool,

    pub url: String,

    pub images: Vec<Image>,

    pub sales: Sales,

    pub dates: Dates,

    pub classifications: Vec<Classification>,

    pub promoter: Promoter,

    pub promoters: Vec<Promoter>,

    #[serde(rename = "pleaseNote")]
    pub please_note: String,

    #[serde(rename = "priceRanges")]
    pub price_ranges: Vec<PriceRange>,

    pub products: Vec<Product>,

    #[serde(rename = "seatmap/static_url")]
    pub seatmap: String,

    pub accessibility: Accessibility,

    #[serde(rename = "ticketLimit/info")]
    pub ticket_limit_infomation: String,

    #[serde(rename = "ageRestrictions/legalAgeEnforced")]
    pub is_legal_age_enforced: bool,

    pub ticketing: Ticketing,

    #[serde(rename = "_embedded/venues")]
    pub venues: Vec<Venue>,

    #[serde(rename = "_embedded/attractions")]
    pub attractions: Vec<Attraction>,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize,Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
/// Image Information
pub struct Image {
    /// Public URL of the image
    pub url: String,
    /// Aspect ratio of the image
    pub ratio: ImageRatio,
    /// Width of the image
    pub width: u32,
    /// Height of the image
    pub height: u32,
    /// true if the image is not the event's image but a fallbak image
    pub fallback: bool,
    /// Attribution of the image
    pub attribution: Option<String>,
}
#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Sales {
    pub public: Public,
    pub presales: Vec<Presale>,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Presale {
    #[serde(rename = "startDateTime")]
    pub start_date_time: String,

    #[serde(rename = "endDateTime")]
    pub end_date_time: String,

    pub name: String,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Public {
    #[serde(rename = "startDateTime")]
    pub start_date_time: String,

    #[serde(rename = "startTBD")]
    pub start_tbd: bool,

    #[serde(rename = "startTBA")]
    pub start_tba: bool,

    #[serde(rename = "endDateTime")]
    pub end_date_time: String,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Dates {
    pub start: Start,

    pub timezone: String,

    #[serde(rename = "status/code")]
    pub status: EventStatus,

    #[serde(rename = "spanMultipleDays")]
    pub span_multiple_days: bool,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Start {
    #[serde(rename = "localDate")]
    pub local_date: String,

    #[serde(rename = "localTime")]
    pub local_time: String,

    #[serde(rename = "dateTime")]
    pub date_time: String,

    #[serde(rename = "dateTBD")]
    pub date_tbd: bool,

    #[serde(rename = "dateTBA")]
    pub date_tba: bool,

    #[serde(rename = "timeTBA")]
    pub time_tba: bool,

    #[serde(rename = "noSpecificTime")]
    pub no_specific_time: bool,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Classification {
    #[serde(rename = "primary")]
    pub is_primary: bool,

    pub segment: Genre,

    pub genre: Genre,

    #[serde(rename = "subGenre")]
    pub sub_genre: Genre,

    pub r#type : Type,

    #[serde(rename = "subType")]
    pub sub_type: Genre,

    #[serde(rename = "family")]
    pub is_family: bool,
}


/// Represents a sub-genre.
#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct SubGenre(pub Info);

/// Represents a genre.
#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Genre {
    /// Information about the genre.
    #[serde(flatten)]
    pub info: Info,
    /// List of Tertiary Genre linked to the Secondary Genre
    #[serde(rename = "subGenres")]
    pub sub_genres: Vec<SubGenre>,
}

/// Represents a segment.
#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Segment(pub Info);

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Type {
    #[serde(flatten)]
    pub info: Info,
    
    #[serde(rename = "subTypes")]
    pub sub_types: Vec<SubType>,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct SubType(Info);

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Promoter {
    pub id: String,
    pub name: String,
    pub description: String,
}

#[derive(Debug)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct PriceRange {
    pub currency: String,
    pub min: f64,
    pub max: f64,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Product {
    pub name: String,
    pub id: String,
    pub url: String,

    #[serde(rename = "type")]
    pub product_type: String,

    pub classifications: Vec<Classification>,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Accessibility {
    pub information : String,

    #[serde(rename = "ticketLimit")]
    pub ticket_limit: u8
}


#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Ticketing {
    #[serde(rename = "safeTix/enabled")]
    pub is_safe_tix: bool,

    #[serde(rename = "allInclusivePricing/enabled")]
    pub is_all_inclusive_pricing: bool,
}


#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Venue {
    #[serde(flatten)]
    pub info : Info,

    #[serde(rename = "test")]
    pub is_test: bool,
    pub url: String,
    pub aliases: Vec<String>,
    pub images: Vec<Image>,
    pub postal_code: String,
    pub timezone: String,
    #[serde(rename = "city/name")]
    pub city: String,

    #[serde(rename = "state")]
    pub state: State,

    #[serde(rename = "country")]
    pub country: Country,

    #[serde(rename = "address")]
    pub address: Address,

    pub location: Location,

    pub markets: Vec<Market>,

    #[serde(rename = "dmas")]
    pub dmas: Vec<Dma>,

    #[serde(rename = "boxOfficeInfo")]
    pub box_office_info: BoxOfficeInfo,

    #[serde(rename = "parkingDetail")]
    pub parking_detail: String,

    #[serde(rename = "accessibleSeatingDetail")]
    pub  accessible_seating_detail: String,

    #[serde(rename = "generalInfo")]
    pub general_info: GeneralInfo,

    #[serde(rename = "upcomingEvents")]
    pub upcoming_events: UpcomingEvents
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Country {
    #[serde(rename = "name")]
    pub name: String,

    #[serde(rename = "countryCode")]
    pub code: String,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct State {
    #[serde(rename = "name")]
    pub name: String,

    #[serde(rename = "stateCode")]
    pub code: String,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Address {
    pub line1: String,
    pub line2: Option<String>,
    pub line3: Option<String>,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Location {
    pub longitude: String,
    pub latitude: String,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct BoxOfficeInfo {
    #[serde(rename = "phoneNumberDetail")]
    pub phone_number_detail: String,

    #[serde(rename = "openHoursDetail")]
    pub open_hours_detail: String,

    #[serde(rename = "acceptedPaymentDetail")]
    pub accepted_payment_detail: String,

    #[serde(rename = "willCallDetail")]
    pub  will_call_detail: String,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct GeneralInfo {
    #[serde(rename = "generalRule")]
    pub general_rule: String,

    #[serde(rename = "childRule")]
    pub child_rule: String,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct UpcomingEvents {
    #[serde(rename = "ticketmaster")]
    pub ticketmaster: u32,

    #[serde(rename = "_total")]
    pub total: u32,

    #[serde(rename = "_filtered")]
    pub filtered: u32,

    pub tmr : Option<u32>
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct Attraction {
    #[serde(flatten)]
    pub info : Info,

    #[serde(rename = "type")]
    pub attraction_type: String,

    #[serde(rename = "test")]
    pub is_test: bool,

    pub url: String,

    #[serde(rename = "externalLinks")]
    pub external_links: ExternalLinks,

    #[serde(rename = "aliases")]
    pub aliases: Option<Vec<String>>,

    #[serde(rename = "images")]
    pub images: Vec<Image>,

    #[serde(rename = "classifications")]
    pub classifications: Vec<Classification>,

    #[serde(rename = "upcomingEvents")]
    pub upcoming_events : UpcomingEvents,
}

#[derive(Debug,PartialOrd,Ord,PartialEq,Eq,Hash)]
#[derive(Serialize, Deserialize)]
#[serde(crate = "api_request_utils_rs::serde")] // must be below the derive attribute
pub struct ExternalLinks {
    #[serde(rename = "youtube")]
    pub youtube: Option<Vec<String>>,

    #[serde(rename = "twitter")]
    pub twitter: Option<Vec<String>>,

    #[serde(rename = "itunes")]
    pub itunes: Option<Vec<String>>,

    #[serde(rename = "lastfm")]
    pub lastfm: Option<Vec<String>>,

    #[serde(rename = "facebook")]
    pub facebook: Vec<String>,

    #[serde(rename = "wiki")]
    pub wiki: Option<Vec<String>>,

    #[serde(rename = "spotify")]
    pub spotify: Vec<String>,

    #[serde(rename = "musicbrainz")]
    pub musicbrainz: Option<Vec<String>>,

    #[serde(rename = "instagram")]
    pub instagram: Vec<String>,

    #[serde(rename = "homepage")]
    pub  homepage: Vec<String>,
}