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