tetrio_api/models/users/
user_connections.rs

1use serde::{Deserialize, Serialize};
2
3use crate::models::common::APIstring;
4use std::collections::HashMap;
5
6#[derive(Debug, Serialize, Deserialize, Clone)]
7pub struct DiscordConnection {
8    pub id: APIstring,
9    pub username: APIstring,
10    pub display_username: APIstring,
11    #[serde(flatten)]
12    pub ignored_fields: HashMap<String, serde_json::Value>,
13}
14
15#[derive(Debug, Serialize, Deserialize, Clone)]
16pub struct TwitchConnection {
17    pub id: APIstring,
18    pub username: APIstring,
19    pub display_username: APIstring,
20    #[serde(flatten)]
21    pub ignored_fields: HashMap<String, serde_json::Value>,
22}
23
24#[derive(Debug, Serialize, Deserialize, Clone)]
25pub struct TwitterConnection {
26    pub id: APIstring,
27    pub username: APIstring,
28    pub display_username: APIstring,
29    #[serde(flatten)]
30    pub ignored_fields: HashMap<String, serde_json::Value>,
31}
32
33#[derive(Debug, Serialize, Deserialize, Clone)]
34pub struct RedditConnection {
35    pub id: APIstring,
36    pub username: APIstring,
37    pub display_username: APIstring,
38    #[serde(flatten)]
39    pub ignored_fields: HashMap<String, serde_json::Value>,
40}
41
42#[derive(Debug, Serialize, Deserialize, Clone)]
43pub struct YoutubeConnection {
44    pub id: APIstring,
45    pub username: APIstring,
46    pub display_username: APIstring,
47    #[serde(flatten)]
48    pub ignored_fields: HashMap<String, serde_json::Value>,
49}
50
51#[derive(Debug, Serialize, Deserialize, Clone)]
52pub struct SteamConnection {
53    pub id: APIstring,
54    pub username: APIstring,
55    pub display_username: APIstring,
56    #[serde(flatten)]
57    pub ignored_fields: HashMap<String, serde_json::Value>,
58}
59
60#[derive(Debug, Serialize, Deserialize, Clone)]
61pub struct UserConnections {
62    pub discord: Option<DiscordConnection>,
63    pub twitch: Option<TwitchConnection>,
64    pub twitter: Option<TwitterConnection>,
65    pub reddit: Option<RedditConnection>,
66    pub youtube: Option<YoutubeConnection>,
67    pub steam: Option<SteamConnection>,
68    #[serde(flatten)]
69    pub ignored_fields: HashMap<String, serde_json::Value>,
70}