atproto blogging
1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: chat.bsky.convo.getLog
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[derive(
9 serde::Serialize,
10 serde::Deserialize,
11 Debug,
12 Clone,
13 PartialEq,
14 Eq,
15 jacquard_derive::IntoStatic
16)]
17#[serde(rename_all = "camelCase")]
18pub struct GetLog<'a> {
19 #[serde(skip_serializing_if = "std::option::Option::is_none")]
20 #[serde(borrow)]
21 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
22}
23
24pub mod get_log_state {
25
26 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
27 #[allow(unused)]
28 use ::core::marker::PhantomData;
29 mod sealed {
30 pub trait Sealed {}
31 }
32 /// State trait tracking which required fields have been set
33 pub trait State: sealed::Sealed {}
34 /// Empty state - all required fields are unset
35 pub struct Empty(());
36 impl sealed::Sealed for Empty {}
37 impl State for Empty {}
38 /// Marker types for field names
39 #[allow(non_camel_case_types)]
40 pub mod members {}
41}
42
43/// Builder for constructing an instance of this type
44pub struct GetLogBuilder<'a, S: get_log_state::State> {
45 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
46 __unsafe_private_named: (::core::option::Option<jacquard_common::CowStr<'a>>,),
47 _phantom: ::core::marker::PhantomData<&'a ()>,
48}
49
50impl<'a> GetLog<'a> {
51 /// Create a new builder for this type
52 pub fn new() -> GetLogBuilder<'a, get_log_state::Empty> {
53 GetLogBuilder::new()
54 }
55}
56
57impl<'a> GetLogBuilder<'a, get_log_state::Empty> {
58 /// Create a new builder with all fields unset
59 pub fn new() -> Self {
60 GetLogBuilder {
61 _phantom_state: ::core::marker::PhantomData,
62 __unsafe_private_named: (None,),
63 _phantom: ::core::marker::PhantomData,
64 }
65 }
66}
67
68impl<'a, S: get_log_state::State> GetLogBuilder<'a, S> {
69 /// Set the `cursor` field (optional)
70 pub fn cursor(
71 mut self,
72 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
73 ) -> Self {
74 self.__unsafe_private_named.0 = value.into();
75 self
76 }
77 /// Set the `cursor` field to an Option value (optional)
78 pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
79 self.__unsafe_private_named.0 = value;
80 self
81 }
82}
83
84impl<'a, S> GetLogBuilder<'a, S>
85where
86 S: get_log_state::State,
87{
88 /// Build the final struct
89 pub fn build(self) -> GetLog<'a> {
90 GetLog {
91 cursor: self.__unsafe_private_named.0,
92 }
93 }
94}
95
96#[jacquard_derive::lexicon]
97#[derive(
98 serde::Serialize,
99 serde::Deserialize,
100 Debug,
101 Clone,
102 PartialEq,
103 Eq,
104 jacquard_derive::IntoStatic
105)]
106#[serde(rename_all = "camelCase")]
107pub struct GetLogOutput<'a> {
108 #[serde(skip_serializing_if = "std::option::Option::is_none")]
109 #[serde(borrow)]
110 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
111 #[serde(borrow)]
112 pub logs: Vec<GetLogOutputLogsItem<'a>>,
113}
114
115#[jacquard_derive::open_union]
116#[derive(
117 serde::Serialize,
118 serde::Deserialize,
119 Debug,
120 Clone,
121 PartialEq,
122 Eq,
123 jacquard_derive::IntoStatic
124)]
125#[serde(tag = "$type")]
126#[serde(bound(deserialize = "'de: 'a"))]
127pub enum GetLogOutputLogsItem<'a> {
128 #[serde(rename = "chat.bsky.convo.defs#logBeginConvo")]
129 LogBeginConvo(Box<crate::chat_bsky::convo::LogBeginConvo<'a>>),
130 #[serde(rename = "chat.bsky.convo.defs#logAcceptConvo")]
131 LogAcceptConvo(Box<crate::chat_bsky::convo::LogAcceptConvo<'a>>),
132 #[serde(rename = "chat.bsky.convo.defs#logLeaveConvo")]
133 LogLeaveConvo(Box<crate::chat_bsky::convo::LogLeaveConvo<'a>>),
134 #[serde(rename = "chat.bsky.convo.defs#logMuteConvo")]
135 LogMuteConvo(Box<crate::chat_bsky::convo::LogMuteConvo<'a>>),
136 #[serde(rename = "chat.bsky.convo.defs#logUnmuteConvo")]
137 LogUnmuteConvo(Box<crate::chat_bsky::convo::LogUnmuteConvo<'a>>),
138 #[serde(rename = "chat.bsky.convo.defs#logCreateMessage")]
139 LogCreateMessage(Box<crate::chat_bsky::convo::LogCreateMessage<'a>>),
140 #[serde(rename = "chat.bsky.convo.defs#logDeleteMessage")]
141 LogDeleteMessage(Box<crate::chat_bsky::convo::LogDeleteMessage<'a>>),
142 #[serde(rename = "chat.bsky.convo.defs#logReadMessage")]
143 LogReadMessage(Box<crate::chat_bsky::convo::LogReadMessage<'a>>),
144 #[serde(rename = "chat.bsky.convo.defs#logAddReaction")]
145 LogAddReaction(Box<crate::chat_bsky::convo::LogAddReaction<'a>>),
146 #[serde(rename = "chat.bsky.convo.defs#logRemoveReaction")]
147 LogRemoveReaction(Box<crate::chat_bsky::convo::LogRemoveReaction<'a>>),
148}
149
150/// Response type for
151///chat.bsky.convo.getLog
152pub struct GetLogResponse;
153impl jacquard_common::xrpc::XrpcResp for GetLogResponse {
154 const NSID: &'static str = "chat.bsky.convo.getLog";
155 const ENCODING: &'static str = "application/json";
156 type Output<'de> = GetLogOutput<'de>;
157 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
158}
159
160impl<'a> jacquard_common::xrpc::XrpcRequest for GetLog<'a> {
161 const NSID: &'static str = "chat.bsky.convo.getLog";
162 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
163 type Response = GetLogResponse;
164}
165
166/// Endpoint type for
167///chat.bsky.convo.getLog
168pub struct GetLogRequest;
169impl jacquard_common::xrpc::XrpcEndpoint for GetLogRequest {
170 const PATH: &'static str = "/xrpc/chat.bsky.convo.getLog";
171 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
172 type Request<'de> = GetLog<'de>;
173 type Response = GetLogResponse;
174}