#[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<jacquard_common::types::string::Datetime>,
}
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 {}
}
pub trait State: sealed::Sealed {}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {}
#[allow(non_camel_case_types)]
pub mod members {}
}
pub struct GetUnreadCountBuilder<S: get_unread_count_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Datetime>,
),
}
impl GetUnreadCount {
pub fn new() -> GetUnreadCountBuilder<get_unread_count_state::Empty> {
GetUnreadCountBuilder::new()
}
}
impl GetUnreadCountBuilder<get_unread_count_state::Empty> {
pub fn new() -> Self {
GetUnreadCountBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
}
}
}
impl<S: get_unread_count_state::State> GetUnreadCountBuilder<S> {
pub fn seen_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_seen_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<S> GetUnreadCountBuilder<S>
where
S: get_unread_count_state::State,
{
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,
}
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;
}
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;
}