A better Rust ATProto crate
at main 4.1 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: tools.ozone.verification.grantVerifications 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8/// Error object for failed verifications. 9#[jacquard_derive::lexicon] 10#[derive( 11 serde::Serialize, 12 serde::Deserialize, 13 Debug, 14 Clone, 15 PartialEq, 16 Eq, 17 jacquard_derive::IntoStatic, 18 bon::Builder 19)] 20#[serde(rename_all = "camelCase")] 21pub struct GrantError<'a> { 22 /// Error message describing the reason for failure. 23 #[serde(borrow)] 24 #[builder(into)] 25 pub error: jacquard_common::CowStr<'a>, 26 /// The did of the subject being verified 27 #[serde(borrow)] 28 pub subject: jacquard_common::types::string::Did<'a>, 29} 30 31#[jacquard_derive::lexicon] 32#[derive( 33 serde::Serialize, 34 serde::Deserialize, 35 Debug, 36 Clone, 37 PartialEq, 38 Eq, 39 bon::Builder, 40 jacquard_derive::IntoStatic 41)] 42#[serde(rename_all = "camelCase")] 43#[builder(start_fn = new)] 44pub struct GrantVerifications<'a> { 45 /// Array of verification requests to process 46 #[serde(borrow)] 47 pub verifications: Vec<jacquard_common::types::value::Data<'a>>, 48 #[serde(flatten)] 49 #[serde(borrow)] 50 #[builder(default)] 51 pub extra_data: ::std::collections::BTreeMap< 52 ::jacquard_common::smol_str::SmolStr, 53 ::jacquard_common::types::value::Data<'a>, 54 >, 55} 56 57#[jacquard_derive::lexicon] 58#[derive( 59 serde::Serialize, 60 serde::Deserialize, 61 Debug, 62 Clone, 63 PartialEq, 64 Eq, 65 jacquard_derive::IntoStatic 66)] 67#[serde(rename_all = "camelCase")] 68pub struct GrantVerificationsOutput<'a> { 69 #[serde(borrow)] 70 pub failed_verifications: Vec<jacquard_common::types::value::Data<'a>>, 71 #[serde(borrow)] 72 pub verifications: Vec<crate::tools_ozone::verification::VerificationView<'a>>, 73} 74 75///Response type for 76///tools.ozone.verification.grantVerifications 77pub struct GrantVerificationsResponse; 78impl jacquard_common::xrpc::XrpcResp for GrantVerificationsResponse { 79 const NSID: &'static str = "tools.ozone.verification.grantVerifications"; 80 const ENCODING: &'static str = "application/json"; 81 type Output<'de> = GrantVerificationsOutput<'de>; 82 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 83} 84 85impl<'a> jacquard_common::xrpc::XrpcRequest for GrantVerifications<'a> { 86 const NSID: &'static str = "tools.ozone.verification.grantVerifications"; 87 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 88 "application/json", 89 ); 90 type Response = GrantVerificationsResponse; 91} 92 93///Endpoint type for 94///tools.ozone.verification.grantVerifications 95pub struct GrantVerificationsRequest; 96impl jacquard_common::xrpc::XrpcEndpoint for GrantVerificationsRequest { 97 const PATH: &'static str = "/xrpc/tools.ozone.verification.grantVerifications"; 98 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 99 "application/json", 100 ); 101 type Request<'de> = GrantVerifications<'de>; 102 type Response = GrantVerificationsResponse; 103} 104 105#[jacquard_derive::lexicon] 106#[derive( 107 serde::Serialize, 108 serde::Deserialize, 109 Debug, 110 Clone, 111 PartialEq, 112 Eq, 113 jacquard_derive::IntoStatic, 114 bon::Builder 115)] 116#[serde(rename_all = "camelCase")] 117pub struct VerificationInput<'a> { 118 /// Timestamp for verification record. Defaults to current time when not specified. 119 #[serde(skip_serializing_if = "std::option::Option::is_none")] 120 #[builder(into)] 121 pub created_at: Option<jacquard_common::types::string::Datetime>, 122 /// Display name of the subject the verification applies to at the moment of verifying. 123 #[serde(borrow)] 124 #[builder(into)] 125 pub display_name: jacquard_common::CowStr<'a>, 126 /// Handle of the subject the verification applies to at the moment of verifying. 127 #[serde(borrow)] 128 pub handle: jacquard_common::types::string::Handle<'a>, 129 /// The did of the subject being verified 130 #[serde(borrow)] 131 pub subject: jacquard_common::types::string::Did<'a>, 132}