// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: sh.weaver.notification.getUnreadCount // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct GetUnreadCount { #[serde(skip_serializing_if = "std::option::Option::is_none")] pub seen_at: std::option::Option, } pub mod get_unread_count_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed {} /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty {} /// Marker types for field names #[allow(non_camel_case_types)] pub mod members {} } /// Builder for constructing an instance of this type pub struct GetUnreadCountBuilder { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option, ), } impl GetUnreadCount { /// Create a new builder for this type pub fn new() -> GetUnreadCountBuilder { GetUnreadCountBuilder::new() } } impl GetUnreadCountBuilder { /// Create a new builder with all fields unset pub fn new() -> Self { GetUnreadCountBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None,), } } } impl GetUnreadCountBuilder { /// Set the `seenAt` field (optional) pub fn seen_at( mut self, value: impl Into>, ) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `seenAt` field to an Option value (optional) pub fn maybe_seen_at( mut self, value: Option, ) -> Self { self.__unsafe_private_named.0 = value; self } } impl GetUnreadCountBuilder where S: get_unread_count_state::State, { /// Build the final struct pub fn build(self) -> GetUnreadCount { GetUnreadCount { seen_at: self.__unsafe_private_named.0, } } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct GetUnreadCountOutput<'a> { pub count: i64, } /// Response type for ///sh.weaver.notification.getUnreadCount pub struct GetUnreadCountResponse; impl jacquard_common::xrpc::XrpcResp for GetUnreadCountResponse { const NSID: &'static str = "sh.weaver.notification.getUnreadCount"; const ENCODING: &'static str = "application/json"; type Output<'de> = GetUnreadCountOutput<'de>; type Err<'de> = jacquard_common::xrpc::GenericError<'de>; } impl jacquard_common::xrpc::XrpcRequest for GetUnreadCount { const NSID: &'static str = "sh.weaver.notification.getUnreadCount"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Response = GetUnreadCountResponse; } /// Endpoint type for ///sh.weaver.notification.getUnreadCount pub struct GetUnreadCountRequest; impl jacquard_common::xrpc::XrpcEndpoint for GetUnreadCountRequest { const PATH: &'static str = "/xrpc/sh.weaver.notification.getUnreadCount"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Request<'de> = GetUnreadCount; type Response = GetUnreadCountResponse; }