tba_openapi_rust/models/
webcast.rs

1/*
2 * The Blue Alliance API v3
3 *
4 * # Overview    Information and statistics about FIRST Robotics Competition teams and events.   # Authentication   All endpoints require an Auth Key to be passed in the header `X-TBA-Auth-Key`. If you do not have an auth key yet, you can obtain one from your [Account Page](/account).
5 *
6 * The version of the OpenAPI document: 3.8.2
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct Webcast {
16    /// Type of webcast, typically descriptive of the streaming provider.
17    #[serde(rename = "type")]
18    pub r#type: RHashType,
19    /// Type specific channel information. May be the YouTube stream, or Twitch channel name. In the case of iframe types, contains HTML to embed the stream in an HTML iframe.
20    #[serde(rename = "channel")]
21    pub channel: String,
22    /// The date for the webcast in `yyyy-mm-dd` format. May be null.
23    #[serde(rename = "date", skip_serializing_if = "Option::is_none")]
24    pub date: Option<String>,
25    /// File identification as may be required for some types. May be null.
26    #[serde(rename = "file", skip_serializing_if = "Option::is_none")]
27    pub file: Option<String>,
28}
29
30impl Webcast {
31    pub fn new(r#type: RHashType, channel: String) -> Webcast {
32        Webcast {
33            r#type,
34            channel,
35            date: None,
36            file: None,
37        }
38    }
39}
40
41/// Type of webcast, typically descriptive of the streaming provider.
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum RHashType {
44    #[serde(rename = "youtube")]
45    Youtube,
46    #[serde(rename = "twitch")]
47    Twitch,
48    #[serde(rename = "ustream")]
49    Ustream,
50    #[serde(rename = "iframe")]
51    Iframe,
52    #[serde(rename = "html5")]
53    Html5,
54    #[serde(rename = "rtmp")]
55    Rtmp,
56    #[serde(rename = "livestream")]
57    Livestream,
58    #[serde(rename = "direct_link")]
59    DirectLink,
60    #[serde(rename = "mms")]
61    Mms,
62    #[serde(rename = "justin")]
63    Justin,
64    #[serde(rename = "stemtv")]
65    Stemtv,
66    #[serde(rename = "dacast")]
67    Dacast,
68}
69
70impl Default for RHashType {
71    fn default() -> RHashType {
72        Self::Youtube
73    }
74}
75