A better Rust ATProto crate
at oauth 2.6 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: com.atproto.label.queryLabels 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[derive( 9 serde::Serialize, 10 serde::Deserialize, 11 Debug, 12 Clone, 13 PartialEq, 14 Eq, 15 bon::Builder 16)] 17#[builder(start_fn = new)] 18#[serde(rename_all = "camelCase")] 19pub struct QueryLabels<'a> { 20 #[serde(skip_serializing_if = "std::option::Option::is_none")] 21 #[serde(borrow)] 22 #[builder(into)] 23 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 24 ///(default: 50, min: 1, max: 250) 25 #[serde(skip_serializing_if = "std::option::Option::is_none")] 26 pub limit: std::option::Option<i64>, 27 #[serde(skip_serializing_if = "std::option::Option::is_none")] 28 #[serde(borrow)] 29 pub sources: std::option::Option<Vec<jacquard_common::types::string::Did<'a>>>, 30 #[serde(borrow)] 31 pub uri_patterns: Vec<jacquard_common::CowStr<'a>>, 32} 33 34impl jacquard_common::IntoStatic for QueryLabels<'_> { 35 type Output = QueryLabels<'static>; 36 fn into_static(self) -> Self::Output { 37 QueryLabels { 38 cursor: self.cursor.into_static(), 39 limit: self.limit.into_static(), 40 sources: self.sources.into_static(), 41 uri_patterns: self.uri_patterns.into_static(), 42 } 43 } 44} 45 46#[jacquard_derive::lexicon] 47#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 48#[serde(rename_all = "camelCase")] 49pub struct QueryLabelsOutput<'a> { 50 #[serde(skip_serializing_if = "std::option::Option::is_none")] 51 #[serde(borrow)] 52 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 53 #[serde(borrow)] 54 pub labels: Vec<crate::com_atproto::label::Label<'a>>, 55} 56 57impl jacquard_common::IntoStatic for QueryLabelsOutput<'_> { 58 type Output = QueryLabelsOutput<'static>; 59 fn into_static(self) -> Self::Output { 60 QueryLabelsOutput { 61 cursor: self.cursor.into_static(), 62 labels: self.labels.into_static(), 63 extra_data: self.extra_data.into_static(), 64 } 65 } 66} 67 68impl jacquard_common::types::xrpc::XrpcRequest for QueryLabels<'_> { 69 const NSID: &'static str = "com.atproto.label.queryLabels"; 70 const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; 71 const OUTPUT_ENCODING: &'static str = "application/json"; 72 type Output<'de> = QueryLabelsOutput<'de>; 73 type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; 74}