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
use super::*;

/// <https://vk.com/dev/objects/market_item>
#[derive(Deserialize, Clone, Debug)]
pub struct MarketItem {
    pub id: Integer,
    pub owner_id: Integer,
    pub title: String,
    pub description: String,
    pub price: link::Price,
    pub category: Category,
    pub thumb_photo: String,
    pub date: Integer,
    pub availability: Integer,
    pub is_favorite: Option<Boolean>,

    // extended
    pub photos: Option<Vec<photo::Photo>>,
    pub can_comment: Option<Integer>,
    pub can_repost: Option<Integer>,
    pub likes: Option<Likes>,
}

#[derive(Deserialize, Clone, Debug)]
pub struct Category {
    pub id: Integer,
    pub name: String,
    pub section: Section,
}

#[derive(Deserialize, Clone, Debug)]
pub struct Section {
    pub id: Integer,
    pub name: String,
}

#[derive(Deserialize, Clone, Debug)]
pub struct Likes {
    pub user_likes: Integer,
    pub count: Integer,
}