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    pub self_link: Option<Link>,
18    pub html: Option<Link>,
19    pub avatar: Option<Link>,
20}
21
22#[derive(Debug, Clone, Serialize, Deserialize)]
23pub struct Link {
24    pub href: String,
25}
26
27#[derive(Debug, Clone, Serialize, Deserialize)]
28pub struct Workspace {
29    pub uuid: String,
30    pub slug: String,
31    pub name: String,
32    #[serde(rename = "type")]
33    pub workspace_type: String,
34    pub is_private: Option<bool>,
35    pub created_on: Option<DateTime<Utc>>,
36    pub links: Option<WorkspaceLinks>,
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
40pub struct WorkspaceLinks {
41    pub html: Option<Link>,
42    pub avatar: Option<Link>,
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize)]
46pub struct Paginated<T> {
47    pub size: Option<u32>,
48    pub page: Option<u32>,
49    pub pagelen: Option<u32>,
50    pub next: Option<String>,
51    pub previous: Option<String>,
52    pub values: Vec<T>,
53}