modde_core/manifest/
collection.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct CollectionManifest {
6 pub slug: String,
7 pub name: String,
8 pub summary: Option<String>,
9 pub description: Option<String>,
10 pub author: CollectionAuthor,
11 pub game: CollectionGame,
12 #[serde(default)]
13 pub mods: Vec<CollectionMod>,
14 pub version: CollectionVersion,
15 #[serde(default)]
16 pub endorsements: u64,
17 pub image_url: Option<String>,
18}
19
20#[derive(Debug, Clone, Serialize, Deserialize)]
21pub struct CollectionAuthor {
22 pub name: String,
23 pub member_id: Option<u64>,
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct CollectionGame {
28 pub id: u64,
29 pub domain_name: String,
30 pub name: String,
31}
32
33#[derive(Debug, Clone, Serialize, Deserialize)]
34pub struct CollectionMod {
35 pub mod_id: u64,
36 pub file_id: u64,
37 pub name: String,
38 pub version: String,
39 #[serde(default)]
40 pub optional: bool,
41 #[serde(default)]
42 pub install_order: i32,
43 pub patch: Option<CollectionPatch>,
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
47pub struct CollectionPatch {
48 pub hash: String,
49 pub url: String,
50}
51
52#[derive(Debug, Clone, Serialize, Deserialize)]
53pub struct CollectionVersion {
54 pub version: String,
55 pub created_at: Option<String>,
56}
57
58#[derive(Debug, Clone, Serialize, Deserialize)]
60pub struct CollectionSearchResults {
61 #[serde(default)]
62 pub collections: Vec<CollectionManifest>,
63 pub total: Option<u64>,
64}