atproto blogging
at main 137 lines 4.1 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: sh.weaver.notification.getUnreadCount 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 GetUnreadCount { 19 #[serde(skip_serializing_if = "std::option::Option::is_none")] 20 pub seen_at: std::option::Option<jacquard_common::types::string::Datetime>, 21} 22 23pub mod get_unread_count_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 /// Empty state - all required fields are unset 34 pub struct Empty(()); 35 impl sealed::Sealed for Empty {} 36 impl State for Empty {} 37 /// Marker types for field names 38 #[allow(non_camel_case_types)] 39 pub mod members {} 40} 41 42/// Builder for constructing an instance of this type 43pub struct GetUnreadCountBuilder<S: get_unread_count_state::State> { 44 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 45 __unsafe_private_named: ( 46 ::core::option::Option<jacquard_common::types::string::Datetime>, 47 ), 48} 49 50impl GetUnreadCount { 51 /// Create a new builder for this type 52 pub fn new() -> GetUnreadCountBuilder<get_unread_count_state::Empty> { 53 GetUnreadCountBuilder::new() 54 } 55} 56 57impl GetUnreadCountBuilder<get_unread_count_state::Empty> { 58 /// Create a new builder with all fields unset 59 pub fn new() -> Self { 60 GetUnreadCountBuilder { 61 _phantom_state: ::core::marker::PhantomData, 62 __unsafe_private_named: (None,), 63 } 64 } 65} 66 67impl<S: get_unread_count_state::State> GetUnreadCountBuilder<S> { 68 /// Set the `seenAt` field (optional) 69 pub fn seen_at( 70 mut self, 71 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 72 ) -> Self { 73 self.__unsafe_private_named.0 = value.into(); 74 self 75 } 76 /// Set the `seenAt` field to an Option value (optional) 77 pub fn maybe_seen_at( 78 mut self, 79 value: Option<jacquard_common::types::string::Datetime>, 80 ) -> Self { 81 self.__unsafe_private_named.0 = value; 82 self 83 } 84} 85 86impl<S> GetUnreadCountBuilder<S> 87where 88 S: get_unread_count_state::State, 89{ 90 /// Build the final struct 91 pub fn build(self) -> GetUnreadCount { 92 GetUnreadCount { 93 seen_at: self.__unsafe_private_named.0, 94 } 95 } 96} 97 98#[jacquard_derive::lexicon] 99#[derive( 100 serde::Serialize, 101 serde::Deserialize, 102 Debug, 103 Clone, 104 PartialEq, 105 Eq, 106 jacquard_derive::IntoStatic 107)] 108#[serde(rename_all = "camelCase")] 109pub struct GetUnreadCountOutput<'a> { 110 pub count: i64, 111} 112 113/// Response type for 114///sh.weaver.notification.getUnreadCount 115pub struct GetUnreadCountResponse; 116impl jacquard_common::xrpc::XrpcResp for GetUnreadCountResponse { 117 const NSID: &'static str = "sh.weaver.notification.getUnreadCount"; 118 const ENCODING: &'static str = "application/json"; 119 type Output<'de> = GetUnreadCountOutput<'de>; 120 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 121} 122 123impl jacquard_common::xrpc::XrpcRequest for GetUnreadCount { 124 const NSID: &'static str = "sh.weaver.notification.getUnreadCount"; 125 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 126 type Response = GetUnreadCountResponse; 127} 128 129/// Endpoint type for 130///sh.weaver.notification.getUnreadCount 131pub struct GetUnreadCountRequest; 132impl jacquard_common::xrpc::XrpcEndpoint for GetUnreadCountRequest { 133 const PATH: &'static str = "/xrpc/sh.weaver.notification.getUnreadCount"; 134 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 135 type Request<'de> = GetUnreadCount; 136 type Response = GetUnreadCountResponse; 137}