A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: tools.ozone.verification.revokeVerifications 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 RevokeVerifications<'a> { 21 ///Reason for revoking the verification. This is optional and can be omitted if not needed. 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 #[serde(borrow)] 24 #[builder(into)] 25 pub revoke_reason: std::option::Option<jacquard_common::CowStr<'a>>, 26 ///Array of verification record uris to revoke 27 #[serde(borrow)] 28 pub uris: Vec<jacquard_common::types::string::AtUri<'a>>, 29 #[serde(flatten)] 30 #[serde(borrow)] 31 #[builder(default)] 32 pub extra_data: ::std::collections::BTreeMap< 33 ::jacquard_common::smol_str::SmolStr, 34 ::jacquard_common::types::value::Data<'a>, 35 >, 36} 37 38impl jacquard_common::IntoStatic for RevokeVerifications<'_> { 39 type Output = RevokeVerifications<'static>; 40 fn into_static(self) -> Self::Output { 41 RevokeVerifications { 42 revoke_reason: self.revoke_reason.into_static(), 43 uris: self.uris.into_static(), 44 extra_data: self.extra_data.into_static(), 45 } 46 } 47} 48 49#[jacquard_derive::lexicon] 50#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 51#[serde(rename_all = "camelCase")] 52pub struct RevokeVerificationsOutput<'a> { 53 ///List of verification uris that couldn't be revoked, including failure reasons 54 #[serde(borrow)] 55 pub failed_revocations: Vec<jacquard_common::types::value::Data<'a>>, 56 ///List of verification uris successfully revoked 57 #[serde(borrow)] 58 pub revoked_verifications: Vec<jacquard_common::types::string::AtUri<'a>>, 59} 60 61impl jacquard_common::IntoStatic for RevokeVerificationsOutput<'_> { 62 type Output = RevokeVerificationsOutput<'static>; 63 fn into_static(self) -> Self::Output { 64 RevokeVerificationsOutput { 65 failed_revocations: self.failed_revocations.into_static(), 66 revoked_verifications: self.revoked_verifications.into_static(), 67 extra_data: self.extra_data.into_static(), 68 } 69 } 70} 71 72impl jacquard_common::types::xrpc::XrpcRequest for RevokeVerifications<'_> { 73 const NSID: &'static str = "tools.ozone.verification.revokeVerifications"; 74 const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( 75 "application/json", 76 ); 77 const OUTPUT_ENCODING: &'static str = "application/json"; 78 type Output<'de> = RevokeVerificationsOutput<'de>; 79 type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; 80} 81 82///Error object for failed revocations 83#[jacquard_derive::lexicon] 84#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 85#[serde(rename_all = "camelCase")] 86pub struct RevokeError<'a> { 87 ///Description of the error that occurred during revocation. 88 #[serde(borrow)] 89 pub error: jacquard_common::CowStr<'a>, 90 ///The AT-URI of the verification record that failed to revoke. 91 #[serde(borrow)] 92 pub uri: jacquard_common::types::string::AtUri<'a>, 93} 94 95impl jacquard_common::IntoStatic for RevokeError<'_> { 96 type Output = RevokeError<'static>; 97 fn into_static(self) -> Self::Output { 98 RevokeError { 99 error: self.error.into_static(), 100 uri: self.uri.into_static(), 101 extra_data: self.extra_data.into_static(), 102 } 103 } 104}