atproto blogging
at main 156 lines 4.9 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.notification.updateSeen 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[jacquard_derive::lexicon] 9#[derive( 10 serde::Serialize, 11 serde::Deserialize, 12 Debug, 13 Clone, 14 PartialEq, 15 Eq, 16 jacquard_derive::IntoStatic 17)] 18#[serde(rename_all = "camelCase")] 19pub struct UpdateSeen<'a> { 20 pub seen_at: jacquard_common::types::string::Datetime, 21} 22 23pub mod update_seen_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 SeenAt; 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 SeenAt = Unset; 40 } 41 ///State transition - sets the `seen_at` field to Set 42 pub struct SetSeenAt<S: State = Empty>(PhantomData<fn() -> S>); 43 impl<S: State> sealed::Sealed for SetSeenAt<S> {} 44 impl<S: State> State for SetSeenAt<S> { 45 type SeenAt = Set<members::seen_at>; 46 } 47 /// Marker types for field names 48 #[allow(non_camel_case_types)] 49 pub mod members { 50 ///Marker type for the `seen_at` field 51 pub struct seen_at(()); 52 } 53} 54 55/// Builder for constructing an instance of this type 56pub struct UpdateSeenBuilder<'a, S: update_seen_state::State> { 57 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 58 __unsafe_private_named: ( 59 ::core::option::Option<jacquard_common::types::string::Datetime>, 60 ), 61 _phantom: ::core::marker::PhantomData<&'a ()>, 62} 63 64impl<'a> UpdateSeen<'a> { 65 /// Create a new builder for this type 66 pub fn new() -> UpdateSeenBuilder<'a, update_seen_state::Empty> { 67 UpdateSeenBuilder::new() 68 } 69} 70 71impl<'a> UpdateSeenBuilder<'a, update_seen_state::Empty> { 72 /// Create a new builder with all fields unset 73 pub fn new() -> Self { 74 UpdateSeenBuilder { 75 _phantom_state: ::core::marker::PhantomData, 76 __unsafe_private_named: (None,), 77 _phantom: ::core::marker::PhantomData, 78 } 79 } 80} 81 82impl<'a, S> UpdateSeenBuilder<'a, S> 83where 84 S: update_seen_state::State, 85 S::SeenAt: update_seen_state::IsUnset, 86{ 87 /// Set the `seenAt` field (required) 88 pub fn seen_at( 89 mut self, 90 value: impl Into<jacquard_common::types::string::Datetime>, 91 ) -> UpdateSeenBuilder<'a, update_seen_state::SetSeenAt<S>> { 92 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 93 UpdateSeenBuilder { 94 _phantom_state: ::core::marker::PhantomData, 95 __unsafe_private_named: self.__unsafe_private_named, 96 _phantom: ::core::marker::PhantomData, 97 } 98 } 99} 100 101impl<'a, S> UpdateSeenBuilder<'a, S> 102where 103 S: update_seen_state::State, 104 S::SeenAt: update_seen_state::IsSet, 105{ 106 /// Build the final struct 107 pub fn build(self) -> UpdateSeen<'a> { 108 UpdateSeen { 109 seen_at: self.__unsafe_private_named.0.unwrap(), 110 extra_data: Default::default(), 111 } 112 } 113 /// Build the final struct with custom extra_data 114 pub fn build_with_data( 115 self, 116 extra_data: std::collections::BTreeMap< 117 jacquard_common::smol_str::SmolStr, 118 jacquard_common::types::value::Data<'a>, 119 >, 120 ) -> UpdateSeen<'a> { 121 UpdateSeen { 122 seen_at: self.__unsafe_private_named.0.unwrap(), 123 extra_data: Some(extra_data), 124 } 125 } 126} 127 128/// Response type for 129///app.bsky.notification.updateSeen 130pub struct UpdateSeenResponse; 131impl jacquard_common::xrpc::XrpcResp for UpdateSeenResponse { 132 const NSID: &'static str = "app.bsky.notification.updateSeen"; 133 const ENCODING: &'static str = "application/json"; 134 type Output<'de> = (); 135 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 136} 137 138impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateSeen<'a> { 139 const NSID: &'static str = "app.bsky.notification.updateSeen"; 140 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 141 "application/json", 142 ); 143 type Response = UpdateSeenResponse; 144} 145 146/// Endpoint type for 147///app.bsky.notification.updateSeen 148pub struct UpdateSeenRequest; 149impl jacquard_common::xrpc::XrpcEndpoint for UpdateSeenRequest { 150 const PATH: &'static str = "/xrpc/app.bsky.notification.updateSeen"; 151 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 152 "application/json", 153 ); 154 type Request<'de> = UpdateSeen<'de>; 155 type Response = UpdateSeenResponse; 156}