// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: tools.ozone.communication.updateTemplate // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, Default )] #[serde(rename_all = "camelCase")] pub struct UpdateTemplate<'a> { /// Content of the template, markdown supported, can contain variable placeholders. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub content_markdown: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub disabled: std::option::Option, /// ID of the template to be updated. #[serde(borrow)] pub id: jacquard_common::CowStr<'a>, /// Message language. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub lang: std::option::Option, /// Name of the template. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub name: std::option::Option>, /// Subject of the message, used in emails. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub subject: std::option::Option>, /// DID of the user who is updating the template. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub updated_by: std::option::Option>, } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct UpdateTemplateOutput<'a> { #[serde(flatten)] #[serde(borrow)] pub value: crate::tools_ozone::communication::TemplateView<'a>, } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, thiserror::Error, miette::Diagnostic, jacquard_derive::IntoStatic )] #[serde(tag = "error", content = "message")] #[serde(bound(deserialize = "'de: 'a"))] pub enum UpdateTemplateError<'a> { #[serde(rename = "DuplicateTemplateName")] DuplicateTemplateName(std::option::Option), } impl std::fmt::Display for UpdateTemplateError<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::DuplicateTemplateName(msg) => { write!(f, "DuplicateTemplateName")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } } ///Response type for ///tools.ozone.communication.updateTemplate pub struct UpdateTemplateResponse; impl jacquard_common::xrpc::XrpcResp for UpdateTemplateResponse { const NSID: &'static str = "tools.ozone.communication.updateTemplate"; const ENCODING: &'static str = "application/json"; type Output<'de> = UpdateTemplateOutput<'de>; type Err<'de> = UpdateTemplateError<'de>; } impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateTemplate<'a> { const NSID: &'static str = "tools.ozone.communication.updateTemplate"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( "application/json", ); type Response = UpdateTemplateResponse; } ///Endpoint type for ///tools.ozone.communication.updateTemplate pub struct UpdateTemplateRequest; impl jacquard_common::xrpc::XrpcEndpoint for UpdateTemplateRequest { const PATH: &'static str = "/xrpc/tools.ozone.communication.updateTemplate"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( "application/json", ); type Request<'de> = UpdateTemplate<'de>; type Response = UpdateTemplateResponse; }