#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;
use jacquard_derive::{IntoStatic, lexicon, open_union};
use serde::{Serialize, Deserialize};
use crate::chat_bsky::convo::LogAcceptConvo;
use crate::chat_bsky::convo::LogAddReaction;
use crate::chat_bsky::convo::LogBeginConvo;
use crate::chat_bsky::convo::LogCreateMessage;
use crate::chat_bsky::convo::LogDeleteMessage;
use crate::chat_bsky::convo::LogLeaveConvo;
use crate::chat_bsky::convo::LogMuteConvo;
use crate::chat_bsky::convo::LogReadMessage;
use crate::chat_bsky::convo::LogRemoveReaction;
use crate::chat_bsky::convo::LogUnmuteConvo;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetLog<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cursor: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetLogOutput<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cursor: Option<CowStr<'a>>,
#[serde(borrow)]
pub logs: Vec<GetLogOutputLogsItem<'a>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
pub enum GetLogOutputLogsItem<'a> {
#[serde(rename = "chat.bsky.convo.defs#logBeginConvo")]
LogBeginConvo(Box<LogBeginConvo<'a>>),
#[serde(rename = "chat.bsky.convo.defs#logAcceptConvo")]
LogAcceptConvo(Box<LogAcceptConvo<'a>>),
#[serde(rename = "chat.bsky.convo.defs#logLeaveConvo")]
LogLeaveConvo(Box<LogLeaveConvo<'a>>),
#[serde(rename = "chat.bsky.convo.defs#logMuteConvo")]
LogMuteConvo(Box<LogMuteConvo<'a>>),
#[serde(rename = "chat.bsky.convo.defs#logUnmuteConvo")]
LogUnmuteConvo(Box<LogUnmuteConvo<'a>>),
#[serde(rename = "chat.bsky.convo.defs#logCreateMessage")]
LogCreateMessage(Box<LogCreateMessage<'a>>),
#[serde(rename = "chat.bsky.convo.defs#logDeleteMessage")]
LogDeleteMessage(Box<LogDeleteMessage<'a>>),
#[serde(rename = "chat.bsky.convo.defs#logReadMessage")]
LogReadMessage(Box<LogReadMessage<'a>>),
#[serde(rename = "chat.bsky.convo.defs#logAddReaction")]
LogAddReaction(Box<LogAddReaction<'a>>),
#[serde(rename = "chat.bsky.convo.defs#logRemoveReaction")]
LogRemoveReaction(Box<LogRemoveReaction<'a>>),
}
pub struct GetLogResponse;
impl jacquard_common::xrpc::XrpcResp for GetLogResponse {
const NSID: &'static str = "chat.bsky.convo.getLog";
const ENCODING: &'static str = "application/json";
type Output<'de> = GetLogOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for GetLog<'a> {
const NSID: &'static str = "chat.bsky.convo.getLog";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetLogResponse;
}
pub struct GetLogRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetLogRequest {
const PATH: &'static str = "/xrpc/chat.bsky.convo.getLog";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<'de> = GetLog<'de>;
type Response = GetLogResponse;
}
pub mod get_log_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 GetLogBuilder<'a, S: get_log_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<CowStr<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> GetLog<'a> {
pub fn new() -> GetLogBuilder<'a, get_log_state::Empty> {
GetLogBuilder::new()
}
}
impl<'a> GetLogBuilder<'a, get_log_state::Empty> {
pub fn new() -> Self {
GetLogBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S: get_log_state::State> GetLogBuilder<'a, S> {
pub fn cursor(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_cursor(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S> GetLogBuilder<'a, S>
where
S: get_log_state::State,
{
pub fn build(self) -> GetLog<'a> {
GetLog { cursor: self._fields.0 }
}
}