atproto blogging
at main 152 lines 4.5 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: chat.bsky.convo.getConvo 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 GetConvo<'a> { 19 #[serde(borrow)] 20 pub convo_id: jacquard_common::CowStr<'a>, 21} 22 23pub mod get_convo_state { 24 25 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 26 #[allow(unused)] 27 use ::core::marker::PhantomData; 28 mod sealed { 29 pub trait Sealed {} 30 } 31 /// State trait tracking which required fields have been set 32 pub trait State: sealed::Sealed { 33 type ConvoId; 34 } 35 /// Empty state - all required fields are unset 36 pub struct Empty(()); 37 impl sealed::Sealed for Empty {} 38 impl State for Empty { 39 type ConvoId = Unset; 40 } 41 ///State transition - sets the `convo_id` field to Set 42 pub struct SetConvoId<S: State = Empty>(PhantomData<fn() -> S>); 43 impl<S: State> sealed::Sealed for SetConvoId<S> {} 44 impl<S: State> State for SetConvoId<S> { 45 type ConvoId = Set<members::convo_id>; 46 } 47 /// Marker types for field names 48 #[allow(non_camel_case_types)] 49 pub mod members { 50 ///Marker type for the `convo_id` field 51 pub struct convo_id(()); 52 } 53} 54 55/// Builder for constructing an instance of this type 56pub struct GetConvoBuilder<'a, S: get_convo_state::State> { 57 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 58 __unsafe_private_named: (::core::option::Option<jacquard_common::CowStr<'a>>,), 59 _phantom: ::core::marker::PhantomData<&'a ()>, 60} 61 62impl<'a> GetConvo<'a> { 63 /// Create a new builder for this type 64 pub fn new() -> GetConvoBuilder<'a, get_convo_state::Empty> { 65 GetConvoBuilder::new() 66 } 67} 68 69impl<'a> GetConvoBuilder<'a, get_convo_state::Empty> { 70 /// Create a new builder with all fields unset 71 pub fn new() -> Self { 72 GetConvoBuilder { 73 _phantom_state: ::core::marker::PhantomData, 74 __unsafe_private_named: (None,), 75 _phantom: ::core::marker::PhantomData, 76 } 77 } 78} 79 80impl<'a, S> GetConvoBuilder<'a, S> 81where 82 S: get_convo_state::State, 83 S::ConvoId: get_convo_state::IsUnset, 84{ 85 /// Set the `convoId` field (required) 86 pub fn convo_id( 87 mut self, 88 value: impl Into<jacquard_common::CowStr<'a>>, 89 ) -> GetConvoBuilder<'a, get_convo_state::SetConvoId<S>> { 90 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 91 GetConvoBuilder { 92 _phantom_state: ::core::marker::PhantomData, 93 __unsafe_private_named: self.__unsafe_private_named, 94 _phantom: ::core::marker::PhantomData, 95 } 96 } 97} 98 99impl<'a, S> GetConvoBuilder<'a, S> 100where 101 S: get_convo_state::State, 102 S::ConvoId: get_convo_state::IsSet, 103{ 104 /// Build the final struct 105 pub fn build(self) -> GetConvo<'a> { 106 GetConvo { 107 convo_id: self.__unsafe_private_named.0.unwrap(), 108 } 109 } 110} 111 112#[jacquard_derive::lexicon] 113#[derive( 114 serde::Serialize, 115 serde::Deserialize, 116 Debug, 117 Clone, 118 PartialEq, 119 Eq, 120 jacquard_derive::IntoStatic 121)] 122#[serde(rename_all = "camelCase")] 123pub struct GetConvoOutput<'a> { 124 #[serde(borrow)] 125 pub convo: crate::chat_bsky::convo::ConvoView<'a>, 126} 127 128/// Response type for 129///chat.bsky.convo.getConvo 130pub struct GetConvoResponse; 131impl jacquard_common::xrpc::XrpcResp for GetConvoResponse { 132 const NSID: &'static str = "chat.bsky.convo.getConvo"; 133 const ENCODING: &'static str = "application/json"; 134 type Output<'de> = GetConvoOutput<'de>; 135 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 136} 137 138impl<'a> jacquard_common::xrpc::XrpcRequest for GetConvo<'a> { 139 const NSID: &'static str = "chat.bsky.convo.getConvo"; 140 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 141 type Response = GetConvoResponse; 142} 143 144/// Endpoint type for 145///chat.bsky.convo.getConvo 146pub struct GetConvoRequest; 147impl jacquard_common::xrpc::XrpcEndpoint for GetConvoRequest { 148 const PATH: &'static str = "/xrpc/chat.bsky.convo.getConvo"; 149 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 150 type Request<'de> = GetConvo<'de>; 151 type Response = GetConvoResponse; 152}