A better Rust ATProto crate
at oauth 2.9 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: com.atproto.admin.sendEmail 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[jacquard_derive::lexicon] 9#[derive( 10 serde::Serialize, 11 serde::Deserialize, 12 Debug, 13 Clone, 14 PartialEq, 15 Eq, 16 bon::Builder 17)] 18#[serde(rename_all = "camelCase")] 19#[builder(start_fn = new)] 20pub struct SendEmail<'a> { 21 ///Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 #[serde(borrow)] 24 #[builder(into)] 25 pub comment: std::option::Option<jacquard_common::CowStr<'a>>, 26 #[serde(borrow)] 27 #[builder(into)] 28 pub content: jacquard_common::CowStr<'a>, 29 #[serde(borrow)] 30 pub recipient_did: jacquard_common::types::string::Did<'a>, 31 #[serde(borrow)] 32 pub sender_did: jacquard_common::types::string::Did<'a>, 33 #[serde(skip_serializing_if = "std::option::Option::is_none")] 34 #[serde(borrow)] 35 #[builder(into)] 36 pub subject: std::option::Option<jacquard_common::CowStr<'a>>, 37 #[serde(flatten)] 38 #[serde(borrow)] 39 #[builder(default)] 40 pub extra_data: ::std::collections::BTreeMap< 41 ::jacquard_common::smol_str::SmolStr, 42 ::jacquard_common::types::value::Data<'a>, 43 >, 44} 45 46impl jacquard_common::IntoStatic for SendEmail<'_> { 47 type Output = SendEmail<'static>; 48 fn into_static(self) -> Self::Output { 49 SendEmail { 50 comment: self.comment.into_static(), 51 content: self.content.into_static(), 52 recipient_did: self.recipient_did.into_static(), 53 sender_did: self.sender_did.into_static(), 54 subject: self.subject.into_static(), 55 extra_data: self.extra_data.into_static(), 56 } 57 } 58} 59 60#[jacquard_derive::lexicon] 61#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 62#[serde(rename_all = "camelCase")] 63pub struct SendEmailOutput<'a> { 64 pub sent: bool, 65} 66 67impl jacquard_common::IntoStatic for SendEmailOutput<'_> { 68 type Output = SendEmailOutput<'static>; 69 fn into_static(self) -> Self::Output { 70 SendEmailOutput { 71 sent: self.sent.into_static(), 72 extra_data: self.extra_data.into_static(), 73 } 74 } 75} 76 77impl jacquard_common::types::xrpc::XrpcRequest for SendEmail<'_> { 78 const NSID: &'static str = "com.atproto.admin.sendEmail"; 79 const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( 80 "application/json", 81 ); 82 const OUTPUT_ENCODING: &'static str = "application/json"; 83 type Output<'de> = SendEmailOutput<'de>; 84 type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; 85}