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