A better Rust ATProto crate
at main 3.1 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: tools.ozone.safelink.queryEvents 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 QueryEvents<'a> { 21 /// Cursor for pagination 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 #[serde(borrow)] 24 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 25 /// Maximum number of results to return 26 #[serde(skip_serializing_if = "std::option::Option::is_none")] 27 pub limit: std::option::Option<i64>, 28 /// Filter by pattern type 29 #[serde(skip_serializing_if = "std::option::Option::is_none")] 30 #[serde(borrow)] 31 pub pattern_type: std::option::Option<jacquard_common::CowStr<'a>>, 32 /// Sort direction 33 #[serde(skip_serializing_if = "std::option::Option::is_none")] 34 #[serde(borrow)] 35 pub sort_direction: std::option::Option<jacquard_common::CowStr<'a>>, 36 /// Filter by specific URLs or domains 37 #[serde(skip_serializing_if = "std::option::Option::is_none")] 38 #[serde(borrow)] 39 pub urls: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 40} 41 42#[jacquard_derive::lexicon] 43#[derive( 44 serde::Serialize, 45 serde::Deserialize, 46 Debug, 47 Clone, 48 PartialEq, 49 Eq, 50 jacquard_derive::IntoStatic 51)] 52#[serde(rename_all = "camelCase")] 53pub struct QueryEventsOutput<'a> { 54 /// Next cursor for pagination. Only present if there are more results. 55 #[serde(skip_serializing_if = "std::option::Option::is_none")] 56 #[serde(borrow)] 57 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 58 #[serde(borrow)] 59 pub events: Vec<crate::tools_ozone::safelink::Event<'a>>, 60} 61 62///Response type for 63///tools.ozone.safelink.queryEvents 64pub struct QueryEventsResponse; 65impl jacquard_common::xrpc::XrpcResp for QueryEventsResponse { 66 const NSID: &'static str = "tools.ozone.safelink.queryEvents"; 67 const ENCODING: &'static str = "application/json"; 68 type Output<'de> = QueryEventsOutput<'de>; 69 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 70} 71 72impl<'a> jacquard_common::xrpc::XrpcRequest for QueryEvents<'a> { 73 const NSID: &'static str = "tools.ozone.safelink.queryEvents"; 74 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 75 "application/json", 76 ); 77 type Response = QueryEventsResponse; 78} 79 80///Endpoint type for 81///tools.ozone.safelink.queryEvents 82pub struct QueryEventsRequest; 83impl jacquard_common::xrpc::XrpcEndpoint for QueryEventsRequest { 84 const PATH: &'static str = "/xrpc/tools.ozone.safelink.queryEvents"; 85 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 86 "application/json", 87 ); 88 type Request<'de> = QueryEvents<'de>; 89 type Response = QueryEventsResponse; 90}