rustigram-types 0.9.3

Telegram Bot API type definitions for rustigram
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
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
use crate::chat::Location;
use crate::user::User;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
/// An incoming inline query.
///
/// Sent when a user types `@YourBot something` in any chat. Respond with
/// [`answerInlineQuery`](https://core.telegram.org/bots/api#answerinlinequery)
/// within 10 seconds.
pub struct InlineQuery {
    /// Unique identifier for this query.
    pub id: String,
    /// The user who sent the query.
    pub from: User,
    /// Text of the query (up to 256 characters).
    pub query: String,
    /// Offset of the result to be returned.
    pub offset: String,
    /// Type of the chat from which the query was sent.
    pub chat_type: Option<String>,
    /// Sender's location, if enabled.
    pub location: Option<Location>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
/// The result a user chose from an inline query.
///
/// Delivered only when the bot has been granted access to inline feedback.
/// Set up in [@BotFather](https://t.me/BotFather) under "Inline Feedback".
pub struct ChosenInlineResult {
    /// Identifier of the chosen result.
    pub result_id: String,
    /// The user who chose the result.
    pub from: User,
    /// Sender's location, if enabled.
    pub location: Option<Location>,
    /// Identifier of the sent inline message, if applicable.
    pub inline_message_id: Option<String>,
    /// The query used to obtain the result.
    pub query: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
/// One result to show in an inline query answer.
///
/// Up to 50 results can be returned per [`answerInlineQuery`](https://core.telegram.org/bots/api#answerinlinequery) call.
/// Each variant corresponds to a different content type (article, photo,
/// video, etc.). Cached variants re-use a previously uploaded Telegram
/// `file_id` rather than a URL.
pub enum InlineQueryResult {
    /// A link to an article or web page.
    Article(InlineQueryResultArticle),
    /// A link to a photo.
    Photo(InlineQueryResultPhoto),
    /// A link to an animated GIF.
    Gif(InlineQueryResultGif),
    /// A link to a video animation (MPEG4 without sound).
    Mpeg4Gif(InlineQueryResultMpeg4Gif),
    /// A link to a video.
    Video(InlineQueryResultVideo),
    /// A link to an audio file.
    Audio(InlineQueryResultAudio),
    /// A link to a voice recording.
    Voice(InlineQueryResultVoice),
    /// A link to a general file.
    Document(InlineQueryResultDocument),
    /// A geographic location.
    Location(InlineQueryResultLocation),
    /// A venue.
    Venue(InlineQueryResultVenue),
    /// A contact.
    Contact(InlineQueryResultContact),
    /// A game.
    Game(InlineQueryResultGame),
    /// A photo from a Telegram `file_id`.
    CachedPhoto(InlineQueryResultCachedPhoto),
    /// A GIF from a Telegram `file_id`.
    CachedGif(InlineQueryResultCachedGif),
    /// An MPEG4 GIF from a Telegram `file_id`.
    CachedMpeg4Gif(InlineQueryResultCachedMpeg4Gif),
    /// A sticker from a Telegram `file_id`.
    CachedSticker(InlineQueryResultCachedSticker),
    /// A document from a Telegram `file_id`.
    CachedDocument(InlineQueryResultCachedDocument),
    /// A video from a Telegram `file_id`.
    CachedVideo(InlineQueryResultCachedVideo),
    /// A voice message from a Telegram `file_id`.
    CachedVoice(InlineQueryResultCachedVoice),
    /// An audio file from a Telegram `file_id`.
    CachedAudio(InlineQueryResultCachedAudio),
}

#[derive(Debug, Clone, Serialize, Deserialize)]
/// Represents an article link in an inline query result.
pub struct InlineQueryResultArticle {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// Title of the result.
    pub title: String,
    /// Content of the message to be sent.
    pub input_message_content: InputMessageContent,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// URL of the result.
    pub url: Option<String>,
    /// Short description of the result.
    pub description: Option<String>,
    /// URL of the thumbnail for the result.
    pub thumbnail_url: Option<String>,
    /// Thumbnail width in pixels.
    pub thumbnail_width: Option<u32>,
    /// Thumbnail height in pixels.
    pub thumbnail_height: Option<u32>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
/// A photo result in an inline query.
pub struct InlineQueryResultPhoto {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid URL of the photo (JPEG, max 5 MB).
    pub photo_url: String,
    /// URL of the thumbnail for the photo.
    pub thumbnail_url: String,
    /// Photo width in pixels.
    pub photo_width: Option<u32>,
    /// Photo height in pixels.
    pub photo_height: Option<u32>,
    /// Title for the result.
    pub title: Option<String>,
    /// Short description of the result.
    pub description: Option<String>,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// Show the caption above the media instead of below.
    pub show_caption_above_media: Option<bool>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
/// An animated GIF result in an inline query.
pub struct InlineQueryResultGif {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid URL for the GIF file (max 1 MB).
    pub gif_url: String,
    /// URL of the static or animated thumbnail for the result.
    pub thumbnail_url: String,
    /// Width of the GIF in pixels.
    pub gif_width: Option<u32>,
    /// Height of the GIF in pixels.
    pub gif_height: Option<u32>,
    /// Duration of the GIF in seconds.
    pub gif_duration: Option<u32>,
    /// Title for the result.
    pub title: Option<String>,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// Show the caption above the media instead of below.
    pub show_caption_above_media: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// An MPEG4 animated GIF result in an inline query.
pub struct InlineQueryResultMpeg4Gif {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid URL for the MPEG4 file (max 1 MB).
    pub mpeg4_url: String,
    /// URL of the static or animated thumbnail.
    pub thumbnail_url: String,
    /// Video width in pixels.
    pub mpeg4_width: Option<u32>,
    /// Video height in pixels.
    pub mpeg4_height: Option<u32>,
    /// Video duration in seconds.
    pub mpeg4_duration: Option<u32>,
    /// Title for the result.
    pub title: Option<String>,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// Show the caption above the media instead of below.
    pub show_caption_above_media: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A video result in an inline query.
pub struct InlineQueryResultVideo {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid URL for the video file.
    pub video_url: String,
    /// MIME type of the video (`text/html` or `video/mp4`).
    pub mime_type: String,
    /// URL of the thumbnail for the video.
    pub thumbnail_url: String,
    /// Title for the result.
    pub title: String,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Video width in pixels.
    pub video_width: Option<u32>,
    /// Video height in pixels.
    pub video_height: Option<u32>,
    /// Video duration in seconds.
    pub video_duration: Option<u32>,
    /// Short description of the result.
    pub description: Option<String>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// Show the caption above the media instead of below.
    pub show_caption_above_media: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// An audio result in an inline query.
pub struct InlineQueryResultAudio {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid URL for the audio file.
    pub audio_url: String,
    /// Title.
    pub title: String,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Performer.
    pub performer: Option<String>,
    /// Audio duration in seconds.
    pub audio_duration: Option<u32>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A voice recording result in an inline query.
pub struct InlineQueryResultVoice {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid URL for the voice recording.
    pub voice_url: String,
    /// Recording title.
    pub title: String,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Recording duration in seconds.
    pub voice_duration: Option<u32>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A general file result in an inline query.
pub struct InlineQueryResultDocument {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// Title for the result.
    pub title: String,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// A valid URL for the file.
    pub document_url: String,
    /// MIME type of the document (`application/pdf` or `application/zip`).
    pub mime_type: String,
    /// Short description of the result.
    pub description: Option<String>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// URL of the thumbnail for the result.
    pub thumbnail_url: Option<String>,
    /// Thumbnail width in pixels.
    pub thumbnail_width: Option<u32>,
    /// Thumbnail height in pixels.
    pub thumbnail_height: Option<u32>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A location result in an inline query.
pub struct InlineQueryResultLocation {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// Location latitude in degrees.
    pub latitude: f64,
    /// Location longitude in degrees.
    pub longitude: f64,
    /// Location title.
    pub title: String,
    /// Radius of uncertainty for the location, in metres (0–1500).
    pub horizontal_accuracy: Option<f64>,
    /// Period in seconds during which the location can be updated (60–86400).
    pub live_period: Option<u32>,
    /// Direction of movement in degrees (1–360) for live locations.
    pub heading: Option<u16>,
    /// Maximum distance in metres for proximity alerts.
    pub proximity_alert_radius: Option<u32>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// URL of the thumbnail for the result.
    pub thumbnail_url: Option<String>,
    /// Thumbnail width in pixels.
    pub thumbnail_width: Option<u32>,
    /// Thumbnail height in pixels.
    pub thumbnail_height: Option<u32>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A venue result in an inline query.
pub struct InlineQueryResultVenue {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// Venue latitude in degrees.
    pub latitude: f64,
    /// Venue longitude in degrees.
    pub longitude: f64,
    /// Venue title.
    pub title: String,
    /// Venue address.
    pub address: String,
    /// Foursquare identifier of the venue.
    pub foursquare_id: Option<String>,
    /// Foursquare type of the venue.
    pub foursquare_type: Option<String>,
    /// Google Places identifier of the venue.
    pub google_place_id: Option<String>,
    /// Google Places type of the venue.
    pub google_place_type: Option<String>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// URL of the thumbnail for the result.
    pub thumbnail_url: Option<String>,
    /// Thumbnail width in pixels.
    pub thumbnail_width: Option<u32>,
    /// Thumbnail height in pixels.
    pub thumbnail_height: Option<u32>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A contact result in an inline query.
pub struct InlineQueryResultContact {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// Contact phone number.
    pub phone_number: String,
    /// Contact first name.
    pub first_name: String,
    /// Contact last name.
    pub last_name: Option<String>,
    /// Contact vCard (0–2048 bytes).
    pub vcard: Option<String>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// URL of the thumbnail for the result.
    pub thumbnail_url: Option<String>,
    /// Thumbnail width in pixels.
    pub thumbnail_width: Option<u32>,
    /// Thumbnail height in pixels.
    pub thumbnail_height: Option<u32>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A game result in an inline query.
pub struct InlineQueryResultGame {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// Short name of the game.
    pub game_short_name: String,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A photo result using a previously uploaded Telegram `file_id`.
pub struct InlineQueryResultCachedPhoto {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid Telegram `file_id` of the cached media.
    pub photo_file_id: String,
    /// Title for the result.
    pub title: Option<String>,
    /// Short description of the result.
    pub description: Option<String>,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// Show the caption above the media instead of below.
    pub show_caption_above_media: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// An animated GIF result using a previously uploaded Telegram `file_id`.
pub struct InlineQueryResultCachedGif {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid Telegram `file_id` of the cached media.
    pub gif_file_id: String,
    /// Title for the result.
    pub title: Option<String>,
    /// Short description of the result.
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// Show the caption above the media instead of below.
    pub show_caption_above_media: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// An MPEG4 GIF result using a previously uploaded Telegram `file_id`.
pub struct InlineQueryResultCachedMpeg4Gif {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid Telegram `file_id` of the cached media.
    pub mpeg4_file_id: String,
    /// Title for the result.
    pub title: Option<String>,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// Show the caption above the media instead of below.
    pub show_caption_above_media: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A sticker result using a previously uploaded Telegram `file_id`.
pub struct InlineQueryResultCachedSticker {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid Telegram `file_id` of the cached media.
    pub sticker_file_id: String,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A document result using a previously uploaded Telegram `file_id`.
pub struct InlineQueryResultCachedDocument {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid Telegram `file_id` of the cached media.
    pub title: String,
    /// A valid Telegram `file_id` of the cached media.
    pub document_file_id: String,
    /// Short description of the result.
    pub description: Option<String>,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A video result using a previously uploaded Telegram `file_id`.
pub struct InlineQueryResultCachedVideo {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid Telegram `file_id` of the cached media.
    pub video_file_id: String,
    /// Title for the result.
    pub title: String,
    /// Short description of the result.
    pub description: Option<String>,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
    /// Show the caption above the media instead of below.
    pub show_caption_above_media: Option<bool>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// A voice result using a previously uploaded Telegram `file_id`.
pub struct InlineQueryResultCachedVoice {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid Telegram `file_id` of the cached media.
    pub voice_file_id: String,
    /// Title for the result.
    pub title: String,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// An audio result using a previously uploaded Telegram `file_id`.
pub struct InlineQueryResultCachedAudio {
    /// Unique identifier for this result (1–64 bytes).
    pub id: String,
    /// A valid Telegram `file_id` of the cached media.
    pub audio_file_id: String,
    /// Caption of the media (0–1024 characters).
    pub caption: Option<String>,
    /// Parse mode for the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Inline keyboard attached to the message.
    pub reply_markup: Option<crate::keyboard::InlineKeyboardMarkup>,
    /// Content of the message to be sent instead of the media.
    pub input_message_content: Option<InputMessageContent>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
/// The content of a message sent as the result of an inline query.
pub enum InputMessageContent {
    /// The message text.
    Text(InputTextMessageContent),
    /// A location on a map.
    Location(InputLocationMessageContent),
    /// A venue.
    Venue(InputVenueMessageContent),
    /// A contact.
    Contact(InputContactMessageContent),
    /// An invoice.
    Invoice(InputInvoiceMessageContent),
}

#[derive(Debug, Clone, Serialize, Deserialize)]
/// Text message content for an inline query result.
pub struct InputTextMessageContent {
    /// Text of the message (1–4096 characters).
    pub message_text: String,
    /// Parse mode for the message text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
    pub parse_mode: Option<crate::message::ParseMode>,
    /// Special entities in the message text.
    pub entities: Option<Vec<crate::message::MessageEntity>>,
    /// Options for link preview generation.
    pub link_preview_options: Option<crate::message::LinkPreviewOptions>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// Live location content for an inline query result.
pub struct InputLocationMessageContent {
    /// Latitude in degrees.
    pub latitude: f64,
    /// Longitude in degrees.
    pub longitude: f64,
    /// Radius of uncertainty for the location, in metres (0–1500).
    pub horizontal_accuracy: Option<f64>,
    /// Period in seconds during which the location can be updated (60–86400).
    pub live_period: Option<u32>,
    /// Direction of movement in degrees (1–360).
    pub heading: Option<u16>,
    /// Maximum distance for proximity alerts in metres.
    pub proximity_alert_radius: Option<u32>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// Venue content for an inline query result.
pub struct InputVenueMessageContent {
    /// Latitude in degrees.
    pub latitude: f64,
    /// Longitude in degrees.
    pub longitude: f64,
    /// Venue name.
    pub title: String,
    /// Venue address.
    pub address: String,
    /// Foursquare identifier of the venue.
    pub foursquare_id: Option<String>,
    /// Foursquare type of the venue.
    pub foursquare_type: Option<String>,
    /// Google Places identifier.
    pub google_place_id: Option<String>,
    /// Google Places type.
    pub google_place_type: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// Contact content for an inline query result.
pub struct InputContactMessageContent {
    /// Contact phone number.
    pub phone_number: String,
    /// Contact first name.
    pub first_name: String,
    /// Contact last name.
    pub last_name: Option<String>,
    /// Contact vCard (0–2048 bytes).
    pub vcard: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// Invoice content for an inline query result.
pub struct InputInvoiceMessageContent {
    /// Product name (1–32 characters).
    pub title: String,
    /// Product description (1–255 characters).
    pub description: String,
    /// Bot-defined invoice payload (1–128 bytes).
    pub payload: String,
    /// Payment provider token. Not required for Telegram Stars.
    pub provider_token: Option<String>,
    /// Three-letter ISO 4217 currency code.
    pub currency: String,
    /// Price breakdown.
    pub prices: Vec<crate::payments::LabeledPrice>,
    /// Maximum accepted tip amount in the smallest currency unit.
    pub max_tip_amount: Option<u64>,
    /// Suggested tip amounts in the smallest currency unit.
    pub suggested_tip_amounts: Option<Vec<u64>>,
    /// JSON-encoded data about the invoice for the payment provider.
    pub provider_data: Option<String>,
    /// URL of the product photo.
    pub photo_url: Option<String>,
    /// Photo size in bytes.
    pub photo_size: Option<u64>,
    /// Photo width in pixels.
    pub photo_width: Option<u32>,
    /// Photo height in pixels.
    pub photo_height: Option<u32>,
    /// Requests the buyer's full name.
    pub need_name: Option<bool>,
    /// Requests the buyer's phone number.
    pub need_phone_number: Option<bool>,
    /// Requests the buyer's email address.
    pub need_email: Option<bool>,
    /// Requests the buyer's shipping address.
    pub need_shipping_address: Option<bool>,
    /// Passes the buyer's phone number to the provider.
    pub send_phone_number_to_provider: Option<bool>,
    /// Passes the buyer's email address to the provider.
    pub send_email_to_provider: Option<bool>,
    /// `true` if the final price depends on the shipping method.
    pub is_flexible: Option<bool>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
/// A message sent from a Web App on behalf of the user.
pub struct SentWebAppMessage {
    /// Identifier of the sent inline message.
    pub inline_message_id: Option<String>,
}