atrium_api/tools/ozone/communication/
create_template.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `tools.ozone.communication.createTemplate` namespace.
3pub const NSID: &str = "tools.ozone.communication.createTemplate";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    ///Content of the template, markdown supported, can contain variable placeholders.
8    pub content_markdown: String,
9    ///DID of the user who is creating the template.
10    #[serde(skip_serializing_if = "core::option::Option::is_none")]
11    pub created_by: core::option::Option<crate::types::string::Did>,
12    ///Message language.
13    #[serde(skip_serializing_if = "core::option::Option::is_none")]
14    pub lang: core::option::Option<crate::types::string::Language>,
15    ///Name of the template.
16    pub name: String,
17    ///Subject of the message, used in emails.
18    pub subject: String,
19}
20pub type Input = crate::types::Object<InputData>;
21pub type Output = crate::tools::ozone::communication::defs::TemplateView;
22#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
23#[serde(tag = "error", content = "message")]
24pub enum Error {
25    DuplicateTemplateName(Option<String>),
26}
27impl std::fmt::Display for Error {
28    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
29        match self {
30            Error::DuplicateTemplateName(msg) => {
31                write!(_f, "DuplicateTemplateName")?;
32                if let Some(msg) = msg {
33                    write!(_f, ": {msg}")?;
34                }
35            }
36        }
37        Ok(())
38    }
39}