qobuz_api_rust/models/
user_simple.rs

1use serde::{Deserialize, Serialize};
2
3use crate::models::{Credential, LastUpdate, StoreFeatures, Subscription};
4
5/// User model representing a Qobuz user
6///
7/// This struct contains comprehensive information about a Qobuz user including their
8/// identification, personal information, account details, and subscription information.
9///
10/// # Examples
11///
12/// ```
13/// use qobuz_api_rust::models::User;
14///
15/// let user = User {
16///     id: Some(123456789),
17///     display_name: Some("Example User".to_string()),
18///     ..Default::default()
19/// };
20/// ```
21#[derive(Serialize, Deserialize, Debug, Clone, Default)]
22pub struct User {
23    /// Unique identifier for the user
24    #[serde(rename = "id")]
25    pub id: Option<i64>,
26
27    /// Public identifier for the user
28    #[serde(rename = "publicId")]
29    pub public_id: Option<String>,
30
31    /// Display name for the user
32    #[serde(rename = "display_name")]
33    pub display_name: Option<String>,
34
35    /// First name of the user
36    #[serde(rename = "firstname")]
37    pub firstname: Option<String>,
38
39    /// Last name of the user
40    #[serde(rename = "lastname")]
41    pub lastname: Option<String>,
42
43    /// Email address of the user
44    #[serde(rename = "email")]
45    pub email: Option<String>,
46
47    /// Login username of the user
48    #[serde(rename = "login")]
49    pub login: Option<String>,
50
51    /// Age of the user
52    #[serde(rename = "age")]
53    pub age: Option<i64>,
54
55    /// Genre preference of the user
56    #[serde(rename = "genre")]
57    pub genre: Option<String>,
58
59    /// Country where the user is located
60    #[serde(rename = "country")]
61    pub country: Option<String>,
62
63    /// Country code for the user
64    #[serde(rename = "country_code")]
65    pub country_code: Option<String>,
66
67    /// Language code for the user
68    #[serde(rename = "language_code")]
69    pub language_code: Option<String>,
70
71    /// Zone information for the user
72    #[serde(rename = "zone")]
73    pub zone: Option<String>,
74
75    /// Store associated with the user
76    #[serde(rename = "store")]
77    pub store: Option<String>,
78
79    /// URL to the user's avatar image
80    #[serde(rename = "avatar")]
81    pub avatar: Option<String>, // Using String instead of Uri
82
83    /// Date when the user account was created
84    #[serde(rename = "creation_date")]
85    pub creation_date: Option<String>,
86
87    /// Credential information for the user
88    #[serde(rename = "credential")]
89    pub credential: Option<Credential>,
90
91    /// Last update information for the user
92    #[serde(rename = "last_update")]
93    pub last_update: Option<LastUpdate>,
94
95    /// Store features available to the user
96    #[serde(rename = "store_features")]
97    pub store_features: Option<StoreFeatures>,
98
99    /// Subscription information for the user
100    #[serde(rename = "subscription")]
101    pub subscription: Option<Subscription>,
102}