clerk_rs/models/
template.rs

1/*
2 * Clerk Backend API
3 *
4 * The Clerk REST Backend API, meant to be accessed by backend servers. Please see https://clerk.com/docs for more information.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: support@clerk.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct Template {
13	#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
14	pub id: Option<String>,
15	/// String representing the object's type. Objects of the same type share the same value.
16	#[serde(rename = "object", skip_serializing_if = "Option::is_none")]
17	pub object: Option<Object>,
18	/// the id of the instance the template belongs to
19	#[serde(rename = "instance_id", skip_serializing_if = "Option::is_none")]
20	pub instance_id: Option<String>,
21	/// whether this is a system (default) or user overridden) template
22	#[serde(rename = "resource_type", skip_serializing_if = "Option::is_none")]
23	pub resource_type: Option<String>,
24	/// whether this is an email or SMS template
25	#[serde(rename = "template_type", skip_serializing_if = "Option::is_none")]
26	pub template_type: Option<String>,
27	/// user-friendly name of the template
28	#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
29	pub name: Option<String>,
30	/// machine-friendly name of the template
31	#[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
32	pub slug: Option<String>,
33	/// position with the listing of templates
34	#[serde(rename = "position", skip_serializing_if = "Option::is_none")]
35	pub position: Option<i64>,
36	/// whether this template can be reverted to the corresponding system default
37	#[serde(rename = "can_revert", skip_serializing_if = "Option::is_none")]
38	pub can_revert: Option<bool>,
39	/// whether this template can be deleted
40	#[serde(rename = "can_delete", skip_serializing_if = "Option::is_none")]
41	pub can_delete: Option<bool>,
42	/// email subject
43	#[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
44	pub subject: Option<String>,
45	/// the editor markup used to generate the body of the template
46	#[serde(rename = "markup", skip_serializing_if = "Option::is_none")]
47	pub markup: Option<String>,
48	/// the template body before variable interpolation
49	#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
50	pub body: Option<String>,
51	/// list of variables that are available for use in the template body
52	#[serde(rename = "available_variables", skip_serializing_if = "Option::is_none")]
53	pub available_variables: Option<Vec<String>>,
54	/// list of variables that must be contained in the template body
55	#[serde(rename = "required_variables", skip_serializing_if = "Option::is_none")]
56	pub required_variables: Option<Vec<String>>,
57	#[serde(rename = "from_email_name", skip_serializing_if = "Option::is_none")]
58	pub from_email_name: Option<String>,
59	#[serde(rename = "delivered_by_clerk", skip_serializing_if = "Option::is_none")]
60	pub delivered_by_clerk: Option<bool>,
61	/// Unix timestamp of last update.
62	#[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
63	pub updated_at: Option<i64>,
64	/// Unix timestamp of creation.
65	#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
66	pub created_at: Option<i64>,
67}
68
69impl Template {
70	pub fn new() -> Template {
71		Template {
72			id: None,
73			object: None,
74			instance_id: None,
75			resource_type: None,
76			template_type: None,
77			name: None,
78			slug: None,
79			position: None,
80			can_revert: None,
81			can_delete: None,
82			subject: None,
83			markup: None,
84			body: None,
85			available_variables: None,
86			required_variables: None,
87			from_email_name: None,
88			delivered_by_clerk: None,
89			updated_at: None,
90			created_at: None,
91		}
92	}
93}
94
95/// String representing the object's type. Objects of the same type share the same value.
96#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
97pub enum Object {
98	#[serde(rename = "template")]
99	Template,
100}
101
102impl Default for Object {
103	fn default() -> Object {
104		Self::Template
105	}
106}