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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
use serde::{Deserialize, Serialize};
use super::user::APIUser;
use crate::models::rest::{Locale, RESTPostAPIGuildsJSONBody};
/**
* Types extracted from https://discord.com/developers/docs/resources/guild-template
*/
/**
* @see {@link https://discord.com/developers/docs/resources/guild-template#guild-template-object}
*/
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct APITemplate {
/**
* The template code (unique ID)
*/
pub code: String,
/**
* Template name
*/
pub name: String,
/**
* The description for the template
*/
pub description: Option<String>,
/**
* Number of times this template has been used
*/
pub usage_count: u64,
/**
* The ID of the user who created the template
*/
pub creator_id: String,
/**
* The user who created the template
*
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
*/
pub creator: APIUser,
/**
* When this template was created
*/
pub created_at: String,
/**
* When this template was last synced to the source guild
*/
pub updated_at: String,
/**
* The ID of the guild this template is based on
*/
pub source_guild_id: String,
/**
* The guild snapshot this template contains
*/
pub serialized_source_guild: APITemplateSerializedSourceGuild,
/**
* Whether the template has unsynced changes
*/
pub is_dirty: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct APITemplateSerializedSourceGuild {
#[serde(flatten)]
pub base: RESTPostAPIGuildsJSONBody,
pub description: Option<String>,
pub preferred_locale: Locale,
pub icon_hash: Option<String>,
}