A better Rust ATProto crate
at main 1.9 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.ocho.push.register 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 jacquard_derive::IntoStatic, 17 Default 18)] 19#[serde(rename_all = "camelCase")] 20pub struct Register<'a> { 21 /// The expo push token 22 #[serde(borrow)] 23 pub push_token: jacquard_common::CowStr<'a>, 24} 25 26#[jacquard_derive::lexicon] 27#[derive( 28 serde::Serialize, 29 serde::Deserialize, 30 Debug, 31 Clone, 32 PartialEq, 33 Eq, 34 jacquard_derive::IntoStatic 35)] 36#[serde(rename_all = "camelCase")] 37pub struct RegisterOutput<'a> { 38 /// Whether the token was successfully registered. 39 pub success: bool, 40} 41 42///Response type for 43///app.ocho.push.register 44pub struct RegisterResponse; 45impl jacquard_common::xrpc::XrpcResp for RegisterResponse { 46 const NSID: &'static str = "app.ocho.push.register"; 47 const ENCODING: &'static str = "application/json"; 48 type Output<'de> = RegisterOutput<'de>; 49 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 50} 51 52impl<'a> jacquard_common::xrpc::XrpcRequest for Register<'a> { 53 const NSID: &'static str = "app.ocho.push.register"; 54 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 55 "application/json", 56 ); 57 type Response = RegisterResponse; 58} 59 60///Endpoint type for 61///app.ocho.push.register 62pub struct RegisterRequest; 63impl jacquard_common::xrpc::XrpcEndpoint for RegisterRequest { 64 const PATH: &'static str = "/xrpc/app.ocho.push.register"; 65 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 66 "application/json", 67 ); 68 type Request<'de> = Register<'de>; 69 type Response = RegisterResponse; 70}