A better Rust ATProto crate
at oauth 3.5 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: com.atproto.sync.listHosts 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(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 10#[serde(rename_all = "camelCase")] 11pub struct Host<'a> { 12 #[serde(skip_serializing_if = "std::option::Option::is_none")] 13 pub account_count: std::option::Option<i64>, 14 ///hostname of server; not a URL (no scheme) 15 #[serde(borrow)] 16 pub hostname: jacquard_common::CowStr<'a>, 17 ///Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). 18 #[serde(skip_serializing_if = "std::option::Option::is_none")] 19 pub seq: std::option::Option<i64>, 20 #[serde(skip_serializing_if = "std::option::Option::is_none")] 21 #[serde(borrow)] 22 pub status: std::option::Option<crate::com_atproto::sync::HostStatus<'a>>, 23} 24 25impl jacquard_common::IntoStatic for Host<'_> { 26 type Output = Host<'static>; 27 fn into_static(self) -> Self::Output { 28 Host { 29 account_count: self.account_count.into_static(), 30 hostname: self.hostname.into_static(), 31 seq: self.seq.into_static(), 32 status: self.status.into_static(), 33 extra_data: self.extra_data.into_static(), 34 } 35 } 36} 37 38#[derive( 39 serde::Serialize, 40 serde::Deserialize, 41 Debug, 42 Clone, 43 PartialEq, 44 Eq, 45 bon::Builder 46)] 47#[builder(start_fn = new)] 48#[serde(rename_all = "camelCase")] 49pub struct ListHosts<'a> { 50 #[serde(skip_serializing_if = "std::option::Option::is_none")] 51 #[serde(borrow)] 52 #[builder(into)] 53 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 54 ///(default: 200, min: 1, max: 1000) 55 #[serde(skip_serializing_if = "std::option::Option::is_none")] 56 pub limit: std::option::Option<i64>, 57} 58 59impl jacquard_common::IntoStatic for ListHosts<'_> { 60 type Output = ListHosts<'static>; 61 fn into_static(self) -> Self::Output { 62 ListHosts { 63 cursor: self.cursor.into_static(), 64 limit: self.limit.into_static(), 65 } 66 } 67} 68 69#[jacquard_derive::lexicon] 70#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 71#[serde(rename_all = "camelCase")] 72pub struct ListHostsOutput<'a> { 73 #[serde(skip_serializing_if = "std::option::Option::is_none")] 74 #[serde(borrow)] 75 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 76 ///Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first. 77 #[serde(borrow)] 78 pub hosts: Vec<jacquard_common::types::value::Data<'a>>, 79} 80 81impl jacquard_common::IntoStatic for ListHostsOutput<'_> { 82 type Output = ListHostsOutput<'static>; 83 fn into_static(self) -> Self::Output { 84 ListHostsOutput { 85 cursor: self.cursor.into_static(), 86 hosts: self.hosts.into_static(), 87 extra_data: self.extra_data.into_static(), 88 } 89 } 90} 91 92impl jacquard_common::types::xrpc::XrpcRequest for ListHosts<'_> { 93 const NSID: &'static str = "com.atproto.sync.listHosts"; 94 const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; 95 const OUTPUT_ENCODING: &'static str = "application/json"; 96 type Output<'de> = ListHostsOutput<'de>; 97 type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; 98}