1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use chrono::{DateTime, Local};
use getset::{CopyGetters, Getters};
use serde::{Deserialize, Serialize};

use crate::User;

#[derive(Clone, Debug, Serialize, Deserialize, Getters, CopyGetters)]
#[getset(get, get)]
pub struct Release {
    url: String,
    assets_url: String,
    upload_url: String,
    html_url: String,
    id: usize,
    author: User,
    node_id: String,
    tag_name: String,
    target_commitish: String,
    name: Option<String>,
    draft: bool,
    prerelease: bool,
    created_at: DateTime<Local>,
    published_at: DateTime<Local>,
    assets: Vec<ReleaseAsset>,
    tarball_url: String,
    zipball_url: String,
    body: Option<String>,
}

#[derive(Clone, Debug, Serialize, Deserialize, Getters, CopyGetters)]
#[getset(get, get)]
pub struct ReleaseAsset {
    url: String,
    id: usize,
    node_id: String,
    name: String,
    label: Option<String>,
    uploader: User,
    content_type: String,
    state: String,
    size: usize,
    download_count: usize,
    created_at: DateTime<Local>,
    updated_at: DateTime<Local>,
    browser_download_url: String,
}