atproto blogging
at main 225 lines 7.4 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.feed.getRepostedBy 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 jacquard_derive::IntoStatic 16)] 17#[serde(rename_all = "camelCase")] 18pub struct GetRepostedBy<'a> { 19 #[serde(skip_serializing_if = "std::option::Option::is_none")] 20 #[serde(borrow)] 21 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 #[serde(borrow)] 24 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 25 ///(default: 50, min: 1, max: 100) 26 #[serde(skip_serializing_if = "std::option::Option::is_none")] 27 pub limit: std::option::Option<i64>, 28 #[serde(borrow)] 29 pub uri: jacquard_common::types::string::AtUri<'a>, 30} 31 32pub mod get_reposted_by_state { 33 34 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 35 #[allow(unused)] 36 use ::core::marker::PhantomData; 37 mod sealed { 38 pub trait Sealed {} 39 } 40 /// State trait tracking which required fields have been set 41 pub trait State: sealed::Sealed { 42 type Uri; 43 } 44 /// Empty state - all required fields are unset 45 pub struct Empty(()); 46 impl sealed::Sealed for Empty {} 47 impl State for Empty { 48 type Uri = Unset; 49 } 50 ///State transition - sets the `uri` field to Set 51 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 52 impl<S: State> sealed::Sealed for SetUri<S> {} 53 impl<S: State> State for SetUri<S> { 54 type Uri = Set<members::uri>; 55 } 56 /// Marker types for field names 57 #[allow(non_camel_case_types)] 58 pub mod members { 59 ///Marker type for the `uri` field 60 pub struct uri(()); 61 } 62} 63 64/// Builder for constructing an instance of this type 65pub struct GetRepostedByBuilder<'a, S: get_reposted_by_state::State> { 66 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 67 __unsafe_private_named: ( 68 ::core::option::Option<jacquard_common::types::string::Cid<'a>>, 69 ::core::option::Option<jacquard_common::CowStr<'a>>, 70 ::core::option::Option<i64>, 71 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 72 ), 73 _phantom: ::core::marker::PhantomData<&'a ()>, 74} 75 76impl<'a> GetRepostedBy<'a> { 77 /// Create a new builder for this type 78 pub fn new() -> GetRepostedByBuilder<'a, get_reposted_by_state::Empty> { 79 GetRepostedByBuilder::new() 80 } 81} 82 83impl<'a> GetRepostedByBuilder<'a, get_reposted_by_state::Empty> { 84 /// Create a new builder with all fields unset 85 pub fn new() -> Self { 86 GetRepostedByBuilder { 87 _phantom_state: ::core::marker::PhantomData, 88 __unsafe_private_named: (None, None, None, None), 89 _phantom: ::core::marker::PhantomData, 90 } 91 } 92} 93 94impl<'a, S: get_reposted_by_state::State> GetRepostedByBuilder<'a, S> { 95 /// Set the `cid` field (optional) 96 pub fn cid( 97 mut self, 98 value: impl Into<Option<jacquard_common::types::string::Cid<'a>>>, 99 ) -> Self { 100 self.__unsafe_private_named.0 = value.into(); 101 self 102 } 103 /// Set the `cid` field to an Option value (optional) 104 pub fn maybe_cid( 105 mut self, 106 value: Option<jacquard_common::types::string::Cid<'a>>, 107 ) -> Self { 108 self.__unsafe_private_named.0 = value; 109 self 110 } 111} 112 113impl<'a, S: get_reposted_by_state::State> GetRepostedByBuilder<'a, S> { 114 /// Set the `cursor` field (optional) 115 pub fn cursor( 116 mut self, 117 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 118 ) -> Self { 119 self.__unsafe_private_named.1 = value.into(); 120 self 121 } 122 /// Set the `cursor` field to an Option value (optional) 123 pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 124 self.__unsafe_private_named.1 = value; 125 self 126 } 127} 128 129impl<'a, S: get_reposted_by_state::State> GetRepostedByBuilder<'a, S> { 130 /// Set the `limit` field (optional) 131 pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self { 132 self.__unsafe_private_named.2 = value.into(); 133 self 134 } 135 /// Set the `limit` field to an Option value (optional) 136 pub fn maybe_limit(mut self, value: Option<i64>) -> Self { 137 self.__unsafe_private_named.2 = value; 138 self 139 } 140} 141 142impl<'a, S> GetRepostedByBuilder<'a, S> 143where 144 S: get_reposted_by_state::State, 145 S::Uri: get_reposted_by_state::IsUnset, 146{ 147 /// Set the `uri` field (required) 148 pub fn uri( 149 mut self, 150 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 151 ) -> GetRepostedByBuilder<'a, get_reposted_by_state::SetUri<S>> { 152 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 153 GetRepostedByBuilder { 154 _phantom_state: ::core::marker::PhantomData, 155 __unsafe_private_named: self.__unsafe_private_named, 156 _phantom: ::core::marker::PhantomData, 157 } 158 } 159} 160 161impl<'a, S> GetRepostedByBuilder<'a, S> 162where 163 S: get_reposted_by_state::State, 164 S::Uri: get_reposted_by_state::IsSet, 165{ 166 /// Build the final struct 167 pub fn build(self) -> GetRepostedBy<'a> { 168 GetRepostedBy { 169 cid: self.__unsafe_private_named.0, 170 cursor: self.__unsafe_private_named.1, 171 limit: self.__unsafe_private_named.2, 172 uri: self.__unsafe_private_named.3.unwrap(), 173 } 174 } 175} 176 177#[jacquard_derive::lexicon] 178#[derive( 179 serde::Serialize, 180 serde::Deserialize, 181 Debug, 182 Clone, 183 PartialEq, 184 Eq, 185 jacquard_derive::IntoStatic 186)] 187#[serde(rename_all = "camelCase")] 188pub struct GetRepostedByOutput<'a> { 189 #[serde(skip_serializing_if = "std::option::Option::is_none")] 190 #[serde(borrow)] 191 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 192 #[serde(skip_serializing_if = "std::option::Option::is_none")] 193 #[serde(borrow)] 194 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 195 #[serde(borrow)] 196 pub reposted_by: Vec<crate::app_bsky::actor::ProfileView<'a>>, 197 #[serde(borrow)] 198 pub uri: jacquard_common::types::string::AtUri<'a>, 199} 200 201/// Response type for 202///app.bsky.feed.getRepostedBy 203pub struct GetRepostedByResponse; 204impl jacquard_common::xrpc::XrpcResp for GetRepostedByResponse { 205 const NSID: &'static str = "app.bsky.feed.getRepostedBy"; 206 const ENCODING: &'static str = "application/json"; 207 type Output<'de> = GetRepostedByOutput<'de>; 208 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 209} 210 211impl<'a> jacquard_common::xrpc::XrpcRequest for GetRepostedBy<'a> { 212 const NSID: &'static str = "app.bsky.feed.getRepostedBy"; 213 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 214 type Response = GetRepostedByResponse; 215} 216 217/// Endpoint type for 218///app.bsky.feed.getRepostedBy 219pub struct GetRepostedByRequest; 220impl jacquard_common::xrpc::XrpcEndpoint for GetRepostedByRequest { 221 const PATH: &'static str = "/xrpc/app.bsky.feed.getRepostedBy"; 222 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 223 type Request<'de> = GetRepostedBy<'de>; 224 type Response = GetRepostedByResponse; 225}