Skip to main content

bitbucket_cli/models/
user.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct User {
6    pub uuid: String,
7    pub username: Option<String>,
8    pub display_name: String,
9    pub account_id: Option<String>,
10    #[serde(rename = "type")]
11    pub user_type: String,
12    pub links: Option<UserLinks>,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct UserLinks {
17    #[serde(rename = "self")]
18    pub self_link: Option<Link>,
19    pub html: Option<Link>,
20    pub avatar: Option<Link>,
21}
22
23/// An email address associated with the authenticated user.
24#[derive(Debug, Clone, Serialize, Deserialize)]
25pub struct UserEmail {
26    pub email: Option<String>,
27    pub is_primary: Option<bool>,
28    pub is_confirmed: Option<bool>,
29}
30
31#[derive(Debug, Clone, Serialize, Deserialize)]
32pub struct Link {
33    pub href: String,
34}
35
36#[derive(Debug, Clone, Serialize, Deserialize)]
37pub struct Workspace {
38    pub uuid: String,
39    pub slug: String,
40    pub name: String,
41    #[serde(rename = "type")]
42    pub workspace_type: String,
43    pub is_private: Option<bool>,
44    pub created_on: Option<DateTime<Utc>>,
45    pub links: Option<WorkspaceLinks>,
46}
47
48#[derive(Debug, Clone, Serialize, Deserialize)]
49pub struct WorkspaceLinks {
50    pub html: Option<Link>,
51    pub avatar: Option<Link>,
52}
53
54#[derive(Debug, Clone, Serialize, Deserialize)]
55pub struct Paginated<T> {
56    pub size: Option<u32>,
57    pub page: Option<u32>,
58    pub pagelen: Option<u32>,
59    pub next: Option<String>,
60    pub previous: Option<String>,
61    pub values: Vec<T>,
62}