atproto blogging
1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.weaver.notification.getSubscriptionUpdates
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 GetSubscriptionUpdates<'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 ///(default: 20, min: 1, max: 50)
23 #[serde(skip_serializing_if = "std::option::Option::is_none")]
24 pub limit: std::option::Option<i64>,
25 #[serde(skip_serializing_if = "std::option::Option::is_none")]
26 pub since: std::option::Option<jacquard_common::types::string::Datetime>,
27}
28
29pub mod get_subscription_updates_state {
30
31 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
32 #[allow(unused)]
33 use ::core::marker::PhantomData;
34 mod sealed {
35 pub trait Sealed {}
36 }
37 /// State trait tracking which required fields have been set
38 pub trait State: sealed::Sealed {}
39 /// Empty state - all required fields are unset
40 pub struct Empty(());
41 impl sealed::Sealed for Empty {}
42 impl State for Empty {}
43 /// Marker types for field names
44 #[allow(non_camel_case_types)]
45 pub mod members {}
46}
47
48/// Builder for constructing an instance of this type
49pub struct GetSubscriptionUpdatesBuilder<'a, S: get_subscription_updates_state::State> {
50 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
51 __unsafe_private_named: (
52 ::core::option::Option<jacquard_common::CowStr<'a>>,
53 ::core::option::Option<i64>,
54 ::core::option::Option<jacquard_common::types::string::Datetime>,
55 ),
56 _phantom: ::core::marker::PhantomData<&'a ()>,
57}
58
59impl<'a> GetSubscriptionUpdates<'a> {
60 /// Create a new builder for this type
61 pub fn new() -> GetSubscriptionUpdatesBuilder<
62 'a,
63 get_subscription_updates_state::Empty,
64 > {
65 GetSubscriptionUpdatesBuilder::new()
66 }
67}
68
69impl<'a> GetSubscriptionUpdatesBuilder<'a, get_subscription_updates_state::Empty> {
70 /// Create a new builder with all fields unset
71 pub fn new() -> Self {
72 GetSubscriptionUpdatesBuilder {
73 _phantom_state: ::core::marker::PhantomData,
74 __unsafe_private_named: (None, None, None),
75 _phantom: ::core::marker::PhantomData,
76 }
77 }
78}
79
80impl<'a, S: get_subscription_updates_state::State> GetSubscriptionUpdatesBuilder<'a, S> {
81 /// Set the `cursor` field (optional)
82 pub fn cursor(
83 mut self,
84 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
85 ) -> Self {
86 self.__unsafe_private_named.0 = value.into();
87 self
88 }
89 /// Set the `cursor` field to an Option value (optional)
90 pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
91 self.__unsafe_private_named.0 = value;
92 self
93 }
94}
95
96impl<'a, S: get_subscription_updates_state::State> GetSubscriptionUpdatesBuilder<'a, S> {
97 /// Set the `limit` field (optional)
98 pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
99 self.__unsafe_private_named.1 = value.into();
100 self
101 }
102 /// Set the `limit` field to an Option value (optional)
103 pub fn maybe_limit(mut self, value: Option<i64>) -> Self {
104 self.__unsafe_private_named.1 = value;
105 self
106 }
107}
108
109impl<'a, S: get_subscription_updates_state::State> GetSubscriptionUpdatesBuilder<'a, S> {
110 /// Set the `since` field (optional)
111 pub fn since(
112 mut self,
113 value: impl Into<Option<jacquard_common::types::string::Datetime>>,
114 ) -> Self {
115 self.__unsafe_private_named.2 = value.into();
116 self
117 }
118 /// Set the `since` field to an Option value (optional)
119 pub fn maybe_since(
120 mut self,
121 value: Option<jacquard_common::types::string::Datetime>,
122 ) -> Self {
123 self.__unsafe_private_named.2 = value;
124 self
125 }
126}
127
128impl<'a, S> GetSubscriptionUpdatesBuilder<'a, S>
129where
130 S: get_subscription_updates_state::State,
131{
132 /// Build the final struct
133 pub fn build(self) -> GetSubscriptionUpdates<'a> {
134 GetSubscriptionUpdates {
135 cursor: self.__unsafe_private_named.0,
136 limit: self.__unsafe_private_named.1,
137 since: self.__unsafe_private_named.2,
138 }
139 }
140}
141
142#[jacquard_derive::lexicon]
143#[derive(
144 serde::Serialize,
145 serde::Deserialize,
146 Debug,
147 Clone,
148 PartialEq,
149 Eq,
150 jacquard_derive::IntoStatic
151)]
152#[serde(rename_all = "camelCase")]
153pub struct GetSubscriptionUpdatesOutput<'a> {
154 #[serde(skip_serializing_if = "std::option::Option::is_none")]
155 #[serde(borrow)]
156 pub cursor: std::option::Option<jacquard_common::CowStr<'a>>,
157 #[serde(borrow)]
158 pub updates: Vec<crate::sh_weaver::notification::SubscriptionUpdateView<'a>>,
159}
160
161/// Response type for
162///sh.weaver.notification.getSubscriptionUpdates
163pub struct GetSubscriptionUpdatesResponse;
164impl jacquard_common::xrpc::XrpcResp for GetSubscriptionUpdatesResponse {
165 const NSID: &'static str = "sh.weaver.notification.getSubscriptionUpdates";
166 const ENCODING: &'static str = "application/json";
167 type Output<'de> = GetSubscriptionUpdatesOutput<'de>;
168 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
169}
170
171impl<'a> jacquard_common::xrpc::XrpcRequest for GetSubscriptionUpdates<'a> {
172 const NSID: &'static str = "sh.weaver.notification.getSubscriptionUpdates";
173 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
174 type Response = GetSubscriptionUpdatesResponse;
175}
176
177/// Endpoint type for
178///sh.weaver.notification.getSubscriptionUpdates
179pub struct GetSubscriptionUpdatesRequest;
180impl jacquard_common::xrpc::XrpcEndpoint for GetSubscriptionUpdatesRequest {
181 const PATH: &'static str = "/xrpc/sh.weaver.notification.getSubscriptionUpdates";
182 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
183 type Request<'de> = GetSubscriptionUpdates<'de>;
184 type Response = GetSubscriptionUpdatesResponse;
185}