atproto blogging
at main 169 lines 5.1 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: sh.weaver.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#[jacquard_derive::lexicon] 129#[derive( 130 serde::Serialize, 131 serde::Deserialize, 132 Debug, 133 Clone, 134 PartialEq, 135 Eq, 136 jacquard_derive::IntoStatic, 137 Default 138)] 139#[serde(rename_all = "camelCase")] 140pub struct UpdateSeenOutput<'a> {} 141/// Response type for 142///sh.weaver.notification.updateSeen 143pub struct UpdateSeenResponse; 144impl jacquard_common::xrpc::XrpcResp for UpdateSeenResponse { 145 const NSID: &'static str = "sh.weaver.notification.updateSeen"; 146 const ENCODING: &'static str = "application/json"; 147 type Output<'de> = UpdateSeenOutput<'de>; 148 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 149} 150 151impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateSeen<'a> { 152 const NSID: &'static str = "sh.weaver.notification.updateSeen"; 153 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 154 "application/json", 155 ); 156 type Response = UpdateSeenResponse; 157} 158 159/// Endpoint type for 160///sh.weaver.notification.updateSeen 161pub struct UpdateSeenRequest; 162impl jacquard_common::xrpc::XrpcEndpoint for UpdateSeenRequest { 163 const PATH: &'static str = "/xrpc/sh.weaver.notification.updateSeen"; 164 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 165 "application/json", 166 ); 167 type Request<'de> = UpdateSeen<'de>; 168 type Response = UpdateSeenResponse; 169}