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 */
1011/// Media : The `Media` object contains a reference for most any media associated with a team or event on TBA.
12131415#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct Media {
17/// String type of the media element.
18#[serde(rename = "type")]
19pub r#type: RHashType,
20/// The key used to identify this media on the media site.
21#[serde(rename = "foreign_key")]
22pub foreign_key: String,
23/// If required, a JSON dict of additional media information.
24#[serde(rename = "details", skip_serializing_if = "Option::is_none")]
25pub details: Option<serde_json::Value>,
26/// True if the media is of high quality.
27#[serde(rename = "preferred", skip_serializing_if = "Option::is_none")]
28pub preferred: Option<bool>,
29/// Direct URL to the media.
30#[serde(rename = "direct_url", skip_serializing_if = "Option::is_none")]
31pub direct_url: Option<String>,
32/// The URL that leads to the full web page for the media, if one exists.
33#[serde(rename = "view_url", skip_serializing_if = "Option::is_none")]
34pub view_url: Option<String>,
35}
3637impl Media {
38/// The `Media` object contains a reference for most any media associated with a team or event on TBA.
39pub fn new(r#type: RHashType, foreign_key: String) -> Media {
40 Media {
41 r#type,
42 foreign_key,
43 details: None,
44 preferred: None,
45 direct_url: None,
46 view_url: None,
47 }
48 }
49}
5051/// String type of the media element.
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
53pub enum RHashType {
54#[serde(rename = "youtube")]
55Youtube,
56#[serde(rename = "cdphotothread")]
57Cdphotothread,
58#[serde(rename = "imgur")]
59Imgur,
60#[serde(rename = "facebook-profile")]
61FacebookProfile,
62#[serde(rename = "youtube-channel")]
63YoutubeChannel,
64#[serde(rename = "twitter-profile")]
65TwitterProfile,
66#[serde(rename = "github-profile")]
67GithubProfile,
68#[serde(rename = "instagram-profile")]
69InstagramProfile,
70#[serde(rename = "periscope-profile")]
71PeriscopeProfile,
72#[serde(rename = "grabcad")]
73Grabcad,
74#[serde(rename = "instagram-image")]
75InstagramImage,
76#[serde(rename = "external-link")]
77ExternalLink,
78#[serde(rename = "avatar")]
79Avatar,
80}
8182impl Default for RHashType {
83fn default() -> RHashType {
84Self::Youtube
85 }
86}
87