1#[jacquard_derive::lexicon]
10#[derive(
11 serde::Serialize,
12 serde::Deserialize,
13 Debug,
14 Clone,
15 PartialEq,
16 Eq,
17 jacquard_derive::IntoStatic
18)]
19#[serde(rename_all = "camelCase")]
20pub struct Account<'a> {
21 pub active: bool,
23 #[serde(borrow)]
24 pub did: jacquard_common::types::string::Did<'a>,
25 pub seq: i64,
26 #[serde(skip_serializing_if = "std::option::Option::is_none")]
28 #[serde(borrow)]
29 pub status: Option<jacquard_common::CowStr<'a>>,
30 pub time: jacquard_common::types::string::Datetime,
31}
32
33pub mod account_state {
34
35 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
36 #[allow(unused)]
37 use ::core::marker::PhantomData;
38 mod sealed {
39 pub trait Sealed {}
40 }
41 pub trait State: sealed::Sealed {
43 type Seq;
44 type Did;
45 type Time;
46 type Active;
47 }
48 pub struct Empty(());
50 impl sealed::Sealed for Empty {}
51 impl State for Empty {
52 type Seq = Unset;
53 type Did = Unset;
54 type Time = Unset;
55 type Active = Unset;
56 }
57 pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>);
59 impl<S: State> sealed::Sealed for SetSeq<S> {}
60 impl<S: State> State for SetSeq<S> {
61 type Seq = Set<members::seq>;
62 type Did = S::Did;
63 type Time = S::Time;
64 type Active = S::Active;
65 }
66 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
68 impl<S: State> sealed::Sealed for SetDid<S> {}
69 impl<S: State> State for SetDid<S> {
70 type Seq = S::Seq;
71 type Did = Set<members::did>;
72 type Time = S::Time;
73 type Active = S::Active;
74 }
75 pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>);
77 impl<S: State> sealed::Sealed for SetTime<S> {}
78 impl<S: State> State for SetTime<S> {
79 type Seq = S::Seq;
80 type Did = S::Did;
81 type Time = Set<members::time>;
82 type Active = S::Active;
83 }
84 pub struct SetActive<S: State = Empty>(PhantomData<fn() -> S>);
86 impl<S: State> sealed::Sealed for SetActive<S> {}
87 impl<S: State> State for SetActive<S> {
88 type Seq = S::Seq;
89 type Did = S::Did;
90 type Time = S::Time;
91 type Active = Set<members::active>;
92 }
93 #[allow(non_camel_case_types)]
95 pub mod members {
96 pub struct seq(());
98 pub struct did(());
100 pub struct time(());
102 pub struct active(());
104 }
105}
106
107pub struct AccountBuilder<'a, S: account_state::State> {
109 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
110 __unsafe_private_named: (
111 ::core::option::Option<bool>,
112 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
113 ::core::option::Option<i64>,
114 ::core::option::Option<jacquard_common::CowStr<'a>>,
115 ::core::option::Option<jacquard_common::types::string::Datetime>,
116 ),
117 _phantom: ::core::marker::PhantomData<&'a ()>,
118}
119
120impl<'a> Account<'a> {
121 pub fn new() -> AccountBuilder<'a, account_state::Empty> {
123 AccountBuilder::new()
124 }
125}
126
127impl<'a> AccountBuilder<'a, account_state::Empty> {
128 pub fn new() -> Self {
130 AccountBuilder {
131 _phantom_state: ::core::marker::PhantomData,
132 __unsafe_private_named: (None, None, None, None, None),
133 _phantom: ::core::marker::PhantomData,
134 }
135 }
136}
137
138impl<'a, S> AccountBuilder<'a, S>
139where
140 S: account_state::State,
141 S::Active: account_state::IsUnset,
142{
143 pub fn active(
145 mut self,
146 value: impl Into<bool>,
147 ) -> AccountBuilder<'a, account_state::SetActive<S>> {
148 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
149 AccountBuilder {
150 _phantom_state: ::core::marker::PhantomData,
151 __unsafe_private_named: self.__unsafe_private_named,
152 _phantom: ::core::marker::PhantomData,
153 }
154 }
155}
156
157impl<'a, S> AccountBuilder<'a, S>
158where
159 S: account_state::State,
160 S::Did: account_state::IsUnset,
161{
162 pub fn did(
164 mut self,
165 value: impl Into<jacquard_common::types::string::Did<'a>>,
166 ) -> AccountBuilder<'a, account_state::SetDid<S>> {
167 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
168 AccountBuilder {
169 _phantom_state: ::core::marker::PhantomData,
170 __unsafe_private_named: self.__unsafe_private_named,
171 _phantom: ::core::marker::PhantomData,
172 }
173 }
174}
175
176impl<'a, S> AccountBuilder<'a, S>
177where
178 S: account_state::State,
179 S::Seq: account_state::IsUnset,
180{
181 pub fn seq(
183 mut self,
184 value: impl Into<i64>,
185 ) -> AccountBuilder<'a, account_state::SetSeq<S>> {
186 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
187 AccountBuilder {
188 _phantom_state: ::core::marker::PhantomData,
189 __unsafe_private_named: self.__unsafe_private_named,
190 _phantom: ::core::marker::PhantomData,
191 }
192 }
193}
194
195impl<'a, S: account_state::State> AccountBuilder<'a, S> {
196 pub fn status(
198 mut self,
199 value: impl Into<Option<jacquard_common::CowStr<'a>>>,
200 ) -> Self {
201 self.__unsafe_private_named.3 = value.into();
202 self
203 }
204 pub fn maybe_status(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
206 self.__unsafe_private_named.3 = value;
207 self
208 }
209}
210
211impl<'a, S> AccountBuilder<'a, S>
212where
213 S: account_state::State,
214 S::Time: account_state::IsUnset,
215{
216 pub fn time(
218 mut self,
219 value: impl Into<jacquard_common::types::string::Datetime>,
220 ) -> AccountBuilder<'a, account_state::SetTime<S>> {
221 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
222 AccountBuilder {
223 _phantom_state: ::core::marker::PhantomData,
224 __unsafe_private_named: self.__unsafe_private_named,
225 _phantom: ::core::marker::PhantomData,
226 }
227 }
228}
229
230impl<'a, S> AccountBuilder<'a, S>
231where
232 S: account_state::State,
233 S::Seq: account_state::IsSet,
234 S::Did: account_state::IsSet,
235 S::Time: account_state::IsSet,
236 S::Active: account_state::IsSet,
237{
238 pub fn build(self) -> Account<'a> {
240 Account {
241 active: self.__unsafe_private_named.0.unwrap(),
242 did: self.__unsafe_private_named.1.unwrap(),
243 seq: self.__unsafe_private_named.2.unwrap(),
244 status: self.__unsafe_private_named.3,
245 time: self.__unsafe_private_named.4.unwrap(),
246 extra_data: Default::default(),
247 }
248 }
249 pub fn build_with_data(
251 self,
252 extra_data: std::collections::BTreeMap<
253 jacquard_common::smol_str::SmolStr,
254 jacquard_common::types::value::Data<'a>,
255 >,
256 ) -> Account<'a> {
257 Account {
258 active: self.__unsafe_private_named.0.unwrap(),
259 did: self.__unsafe_private_named.1.unwrap(),
260 seq: self.__unsafe_private_named.2.unwrap(),
261 status: self.__unsafe_private_named.3,
262 time: self.__unsafe_private_named.4.unwrap(),
263 extra_data: Some(extra_data),
264 }
265 }
266}
267
268fn lexicon_doc_com_atproto_sync_subscribeRepos() -> ::jacquard_lexicon::lexicon::LexiconDoc<
269 'static,
270> {
271 ::jacquard_lexicon::lexicon::LexiconDoc {
272 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
273 id: ::jacquard_common::CowStr::new_static("com.atproto.sync.subscribeRepos"),
274 revision: None,
275 description: None,
276 defs: {
277 let mut map = ::std::collections::BTreeMap::new();
278 map.insert(
279 ::jacquard_common::smol_str::SmolStr::new_static("account"),
280 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
281 description: Some(
282 ::jacquard_common::CowStr::new_static(
283 "Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.",
284 ),
285 ),
286 required: Some(
287 vec![
288 ::jacquard_common::smol_str::SmolStr::new_static("seq"),
289 ::jacquard_common::smol_str::SmolStr::new_static("did"),
290 ::jacquard_common::smol_str::SmolStr::new_static("time"),
291 ::jacquard_common::smol_str::SmolStr::new_static("active")
292 ],
293 ),
294 nullable: None,
295 properties: {
296 #[allow(unused_mut)]
297 let mut map = ::std::collections::BTreeMap::new();
298 map.insert(
299 ::jacquard_common::smol_str::SmolStr::new_static("active"),
300 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
301 description: None,
302 default: None,
303 r#const: None,
304 }),
305 );
306 map.insert(
307 ::jacquard_common::smol_str::SmolStr::new_static("did"),
308 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
309 description: None,
310 format: Some(
311 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
312 ),
313 default: None,
314 min_length: None,
315 max_length: None,
316 min_graphemes: None,
317 max_graphemes: None,
318 r#enum: None,
319 r#const: None,
320 known_values: None,
321 }),
322 );
323 map.insert(
324 ::jacquard_common::smol_str::SmolStr::new_static("seq"),
325 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
326 description: None,
327 default: None,
328 minimum: None,
329 maximum: None,
330 r#enum: None,
331 r#const: None,
332 }),
333 );
334 map.insert(
335 ::jacquard_common::smol_str::SmolStr::new_static("status"),
336 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
337 description: Some(
338 ::jacquard_common::CowStr::new_static(
339 "If active=false, this optional field indicates a reason for why the account is not active.",
340 ),
341 ),
342 format: None,
343 default: None,
344 min_length: None,
345 max_length: None,
346 min_graphemes: None,
347 max_graphemes: None,
348 r#enum: None,
349 r#const: None,
350 known_values: None,
351 }),
352 );
353 map.insert(
354 ::jacquard_common::smol_str::SmolStr::new_static("time"),
355 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
356 description: None,
357 format: Some(
358 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
359 ),
360 default: None,
361 min_length: None,
362 max_length: None,
363 min_graphemes: None,
364 max_graphemes: None,
365 r#enum: None,
366 r#const: None,
367 known_values: None,
368 }),
369 );
370 map
371 },
372 }),
373 );
374 map.insert(
375 ::jacquard_common::smol_str::SmolStr::new_static("commit"),
376 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
377 description: Some(
378 ::jacquard_common::CowStr::new_static(
379 "Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature.",
380 ),
381 ),
382 required: Some(
383 vec![
384 ::jacquard_common::smol_str::SmolStr::new_static("seq"),
385 ::jacquard_common::smol_str::SmolStr::new_static("rebase"),
386 ::jacquard_common::smol_str::SmolStr::new_static("tooBig"),
387 ::jacquard_common::smol_str::SmolStr::new_static("repo"),
388 ::jacquard_common::smol_str::SmolStr::new_static("commit"),
389 ::jacquard_common::smol_str::SmolStr::new_static("rev"),
390 ::jacquard_common::smol_str::SmolStr::new_static("since"),
391 ::jacquard_common::smol_str::SmolStr::new_static("blocks"),
392 ::jacquard_common::smol_str::SmolStr::new_static("ops"),
393 ::jacquard_common::smol_str::SmolStr::new_static("blobs"),
394 ::jacquard_common::smol_str::SmolStr::new_static("time")
395 ],
396 ),
397 nullable: None,
398 properties: {
399 #[allow(unused_mut)]
400 let mut map = ::std::collections::BTreeMap::new();
401 map.insert(
402 ::jacquard_common::smol_str::SmolStr::new_static("blobs"),
403 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
404 description: None,
405 items: ::jacquard_lexicon::lexicon::LexArrayItem::CidLink(::jacquard_lexicon::lexicon::LexCidLink {
406 description: None,
407 }),
408 min_length: None,
409 max_length: None,
410 }),
411 );
412 map.insert(
413 ::jacquard_common::smol_str::SmolStr::new_static("blocks"),
414 ::jacquard_lexicon::lexicon::LexObjectProperty::Bytes(::jacquard_lexicon::lexicon::LexBytes {
415 description: None,
416 max_length: Some(2000000usize),
417 min_length: None,
418 }),
419 );
420 map.insert(
421 ::jacquard_common::smol_str::SmolStr::new_static("commit"),
422 ::jacquard_lexicon::lexicon::LexObjectProperty::CidLink(::jacquard_lexicon::lexicon::LexCidLink {
423 description: None,
424 }),
425 );
426 map.insert(
427 ::jacquard_common::smol_str::SmolStr::new_static("ops"),
428 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
429 description: None,
430 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
431 description: None,
432 r#ref: ::jacquard_common::CowStr::new_static("#repoOp"),
433 }),
434 min_length: None,
435 max_length: Some(200usize),
436 }),
437 );
438 map.insert(
439 ::jacquard_common::smol_str::SmolStr::new_static("prevData"),
440 ::jacquard_lexicon::lexicon::LexObjectProperty::CidLink(::jacquard_lexicon::lexicon::LexCidLink {
441 description: None,
442 }),
443 );
444 map.insert(
445 ::jacquard_common::smol_str::SmolStr::new_static("rebase"),
446 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
447 description: None,
448 default: None,
449 r#const: None,
450 }),
451 );
452 map.insert(
453 ::jacquard_common::smol_str::SmolStr::new_static("repo"),
454 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
455 description: Some(
456 ::jacquard_common::CowStr::new_static(
457 "The repo this event comes from. Note that all other message types name this field 'did'.",
458 ),
459 ),
460 format: Some(
461 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
462 ),
463 default: None,
464 min_length: None,
465 max_length: None,
466 min_graphemes: None,
467 max_graphemes: None,
468 r#enum: None,
469 r#const: None,
470 known_values: None,
471 }),
472 );
473 map.insert(
474 ::jacquard_common::smol_str::SmolStr::new_static("rev"),
475 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
476 description: Some(
477 ::jacquard_common::CowStr::new_static(
478 "The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event.",
479 ),
480 ),
481 format: Some(
482 ::jacquard_lexicon::lexicon::LexStringFormat::Tid,
483 ),
484 default: None,
485 min_length: None,
486 max_length: None,
487 min_graphemes: None,
488 max_graphemes: None,
489 r#enum: None,
490 r#const: None,
491 known_values: None,
492 }),
493 );
494 map.insert(
495 ::jacquard_common::smol_str::SmolStr::new_static("seq"),
496 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
497 description: None,
498 default: None,
499 minimum: None,
500 maximum: None,
501 r#enum: None,
502 r#const: None,
503 }),
504 );
505 map.insert(
506 ::jacquard_common::smol_str::SmolStr::new_static("since"),
507 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
508 description: Some(
509 ::jacquard_common::CowStr::new_static(
510 "The rev of the last emitted commit from this repo (if any).",
511 ),
512 ),
513 format: Some(
514 ::jacquard_lexicon::lexicon::LexStringFormat::Tid,
515 ),
516 default: None,
517 min_length: None,
518 max_length: None,
519 min_graphemes: None,
520 max_graphemes: None,
521 r#enum: None,
522 r#const: None,
523 known_values: None,
524 }),
525 );
526 map.insert(
527 ::jacquard_common::smol_str::SmolStr::new_static("time"),
528 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
529 description: Some(
530 ::jacquard_common::CowStr::new_static(
531 "Timestamp of when this message was originally broadcast.",
532 ),
533 ),
534 format: Some(
535 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
536 ),
537 default: None,
538 min_length: None,
539 max_length: None,
540 min_graphemes: None,
541 max_graphemes: None,
542 r#enum: None,
543 r#const: None,
544 known_values: None,
545 }),
546 );
547 map.insert(
548 ::jacquard_common::smol_str::SmolStr::new_static("tooBig"),
549 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
550 description: None,
551 default: None,
552 r#const: None,
553 }),
554 );
555 map
556 },
557 }),
558 );
559 map.insert(
560 ::jacquard_common::smol_str::SmolStr::new_static("identity"),
561 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
562 description: Some(
563 ::jacquard_common::CowStr::new_static(
564 "Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache.",
565 ),
566 ),
567 required: Some(
568 vec![
569 ::jacquard_common::smol_str::SmolStr::new_static("seq"),
570 ::jacquard_common::smol_str::SmolStr::new_static("did"),
571 ::jacquard_common::smol_str::SmolStr::new_static("time")
572 ],
573 ),
574 nullable: None,
575 properties: {
576 #[allow(unused_mut)]
577 let mut map = ::std::collections::BTreeMap::new();
578 map.insert(
579 ::jacquard_common::smol_str::SmolStr::new_static("did"),
580 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
581 description: None,
582 format: Some(
583 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
584 ),
585 default: None,
586 min_length: None,
587 max_length: None,
588 min_graphemes: None,
589 max_graphemes: None,
590 r#enum: None,
591 r#const: None,
592 known_values: None,
593 }),
594 );
595 map.insert(
596 ::jacquard_common::smol_str::SmolStr::new_static("handle"),
597 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
598 description: Some(
599 ::jacquard_common::CowStr::new_static(
600 "The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details.",
601 ),
602 ),
603 format: Some(
604 ::jacquard_lexicon::lexicon::LexStringFormat::Handle,
605 ),
606 default: None,
607 min_length: None,
608 max_length: None,
609 min_graphemes: None,
610 max_graphemes: None,
611 r#enum: None,
612 r#const: None,
613 known_values: None,
614 }),
615 );
616 map.insert(
617 ::jacquard_common::smol_str::SmolStr::new_static("seq"),
618 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
619 description: None,
620 default: None,
621 minimum: None,
622 maximum: None,
623 r#enum: None,
624 r#const: None,
625 }),
626 );
627 map.insert(
628 ::jacquard_common::smol_str::SmolStr::new_static("time"),
629 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
630 description: None,
631 format: Some(
632 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
633 ),
634 default: None,
635 min_length: None,
636 max_length: None,
637 min_graphemes: None,
638 max_graphemes: None,
639 r#enum: None,
640 r#const: None,
641 known_values: None,
642 }),
643 );
644 map
645 },
646 }),
647 );
648 map.insert(
649 ::jacquard_common::smol_str::SmolStr::new_static("info"),
650 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
651 description: None,
652 required: Some(
653 vec![::jacquard_common::smol_str::SmolStr::new_static("name")],
654 ),
655 nullable: None,
656 properties: {
657 #[allow(unused_mut)]
658 let mut map = ::std::collections::BTreeMap::new();
659 map.insert(
660 ::jacquard_common::smol_str::SmolStr::new_static("message"),
661 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
662 description: None,
663 format: None,
664 default: None,
665 min_length: None,
666 max_length: None,
667 min_graphemes: None,
668 max_graphemes: None,
669 r#enum: None,
670 r#const: None,
671 known_values: None,
672 }),
673 );
674 map.insert(
675 ::jacquard_common::smol_str::SmolStr::new_static("name"),
676 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
677 description: None,
678 format: None,
679 default: None,
680 min_length: None,
681 max_length: None,
682 min_graphemes: None,
683 max_graphemes: None,
684 r#enum: None,
685 r#const: None,
686 known_values: None,
687 }),
688 );
689 map
690 },
691 }),
692 );
693 map.insert(
694 ::jacquard_common::smol_str::SmolStr::new_static("main"),
695 ::jacquard_lexicon::lexicon::LexUserType::XrpcSubscription(::jacquard_lexicon::lexicon::LexXrpcSubscription {
696 description: None,
697 parameters: Some(
698 ::jacquard_lexicon::lexicon::LexXrpcSubscriptionParameter::Params(::jacquard_lexicon::lexicon::LexXrpcParameters {
699 description: None,
700 required: None,
701 properties: {
702 #[allow(unused_mut)]
703 let mut map = ::std::collections::BTreeMap::new();
704 map.insert(
705 ::jacquard_common::smol_str::SmolStr::new_static("cursor"),
706 ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
707 description: None,
708 default: None,
709 minimum: None,
710 maximum: None,
711 r#enum: None,
712 r#const: None,
713 }),
714 );
715 map
716 },
717 }),
718 ),
719 message: None,
720 infos: None,
721 errors: None,
722 }),
723 );
724 map.insert(
725 ::jacquard_common::smol_str::SmolStr::new_static("repoOp"),
726 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
727 description: Some(
728 ::jacquard_common::CowStr::new_static(
729 "A repo operation, ie a mutation of a single record.",
730 ),
731 ),
732 required: Some(
733 vec![
734 ::jacquard_common::smol_str::SmolStr::new_static("action"),
735 ::jacquard_common::smol_str::SmolStr::new_static("path"),
736 ::jacquard_common::smol_str::SmolStr::new_static("cid")
737 ],
738 ),
739 nullable: None,
740 properties: {
741 #[allow(unused_mut)]
742 let mut map = ::std::collections::BTreeMap::new();
743 map.insert(
744 ::jacquard_common::smol_str::SmolStr::new_static("action"),
745 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
746 description: None,
747 format: None,
748 default: None,
749 min_length: None,
750 max_length: None,
751 min_graphemes: None,
752 max_graphemes: None,
753 r#enum: None,
754 r#const: None,
755 known_values: None,
756 }),
757 );
758 map.insert(
759 ::jacquard_common::smol_str::SmolStr::new_static("cid"),
760 ::jacquard_lexicon::lexicon::LexObjectProperty::CidLink(::jacquard_lexicon::lexicon::LexCidLink {
761 description: None,
762 }),
763 );
764 map.insert(
765 ::jacquard_common::smol_str::SmolStr::new_static("path"),
766 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
767 description: None,
768 format: None,
769 default: None,
770 min_length: None,
771 max_length: None,
772 min_graphemes: None,
773 max_graphemes: None,
774 r#enum: None,
775 r#const: None,
776 known_values: None,
777 }),
778 );
779 map.insert(
780 ::jacquard_common::smol_str::SmolStr::new_static("prev"),
781 ::jacquard_lexicon::lexicon::LexObjectProperty::CidLink(::jacquard_lexicon::lexicon::LexCidLink {
782 description: None,
783 }),
784 );
785 map
786 },
787 }),
788 );
789 map.insert(
790 ::jacquard_common::smol_str::SmolStr::new_static("sync"),
791 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
792 description: Some(
793 ::jacquard_common::CowStr::new_static(
794 "Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository.",
795 ),
796 ),
797 required: Some(
798 vec![
799 ::jacquard_common::smol_str::SmolStr::new_static("seq"),
800 ::jacquard_common::smol_str::SmolStr::new_static("did"),
801 ::jacquard_common::smol_str::SmolStr::new_static("blocks"),
802 ::jacquard_common::smol_str::SmolStr::new_static("rev"),
803 ::jacquard_common::smol_str::SmolStr::new_static("time")
804 ],
805 ),
806 nullable: None,
807 properties: {
808 #[allow(unused_mut)]
809 let mut map = ::std::collections::BTreeMap::new();
810 map.insert(
811 ::jacquard_common::smol_str::SmolStr::new_static("blocks"),
812 ::jacquard_lexicon::lexicon::LexObjectProperty::Bytes(::jacquard_lexicon::lexicon::LexBytes {
813 description: None,
814 max_length: Some(10000usize),
815 min_length: None,
816 }),
817 );
818 map.insert(
819 ::jacquard_common::smol_str::SmolStr::new_static("did"),
820 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
821 description: Some(
822 ::jacquard_common::CowStr::new_static(
823 "The account this repo event corresponds to. Must match that in the commit object.",
824 ),
825 ),
826 format: Some(
827 ::jacquard_lexicon::lexicon::LexStringFormat::Did,
828 ),
829 default: None,
830 min_length: None,
831 max_length: None,
832 min_graphemes: None,
833 max_graphemes: None,
834 r#enum: None,
835 r#const: None,
836 known_values: None,
837 }),
838 );
839 map.insert(
840 ::jacquard_common::smol_str::SmolStr::new_static("rev"),
841 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
842 description: Some(
843 ::jacquard_common::CowStr::new_static(
844 "The rev of the commit. This value must match that in the commit object.",
845 ),
846 ),
847 format: None,
848 default: None,
849 min_length: None,
850 max_length: None,
851 min_graphemes: None,
852 max_graphemes: None,
853 r#enum: None,
854 r#const: None,
855 known_values: None,
856 }),
857 );
858 map.insert(
859 ::jacquard_common::smol_str::SmolStr::new_static("seq"),
860 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
861 description: None,
862 default: None,
863 minimum: None,
864 maximum: None,
865 r#enum: None,
866 r#const: None,
867 }),
868 );
869 map.insert(
870 ::jacquard_common::smol_str::SmolStr::new_static("time"),
871 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
872 description: Some(
873 ::jacquard_common::CowStr::new_static(
874 "Timestamp of when this message was originally broadcast.",
875 ),
876 ),
877 format: Some(
878 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
879 ),
880 default: None,
881 min_length: None,
882 max_length: None,
883 min_graphemes: None,
884 max_graphemes: None,
885 r#enum: None,
886 r#const: None,
887 known_values: None,
888 }),
889 );
890 map
891 },
892 }),
893 );
894 map
895 },
896 }
897}
898
899impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Account<'a> {
900 fn nsid() -> &'static str {
901 "com.atproto.sync.subscribeRepos"
902 }
903 fn def_name() -> &'static str {
904 "account"
905 }
906 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
907 lexicon_doc_com_atproto_sync_subscribeRepos()
908 }
909 fn validate(
910 &self,
911 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
912 Ok(())
913 }
914}
915
916#[jacquard_derive::lexicon]
918#[derive(
919 serde::Serialize,
920 serde::Deserialize,
921 Debug,
922 Clone,
923 PartialEq,
924 Eq,
925 jacquard_derive::IntoStatic
926)]
927#[serde(rename_all = "camelCase")]
928pub struct Commit<'a> {
929 #[serde(borrow)]
930 pub blobs: Vec<jacquard_common::types::cid::CidLink<'a>>,
931 pub blocks: bytes::Bytes,
933 #[serde(borrow)]
935 pub commit: jacquard_common::types::cid::CidLink<'a>,
936 #[serde(borrow)]
937 pub ops: Vec<crate::com_atproto::sync::subscribe_repos::RepoOp<'a>>,
938 #[serde(skip_serializing_if = "std::option::Option::is_none")]
940 #[serde(borrow)]
941 pub prev_data: Option<jacquard_common::types::cid::CidLink<'a>>,
942 pub rebase: bool,
944 #[serde(borrow)]
946 pub repo: jacquard_common::types::string::Did<'a>,
947 pub rev: jacquard_common::types::string::Tid,
949 pub seq: i64,
951 pub since: jacquard_common::types::string::Tid,
953 pub time: jacquard_common::types::string::Datetime,
955 pub too_big: bool,
957}
958
959pub mod commit_state {
960
961 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
962 #[allow(unused)]
963 use ::core::marker::PhantomData;
964 mod sealed {
965 pub trait Sealed {}
966 }
967 pub trait State: sealed::Sealed {
969 type Seq;
970 type Rebase;
971 type TooBig;
972 type Repo;
973 type Commit;
974 type Rev;
975 type Since;
976 type Blocks;
977 type Ops;
978 type Blobs;
979 type Time;
980 }
981 pub struct Empty(());
983 impl sealed::Sealed for Empty {}
984 impl State for Empty {
985 type Seq = Unset;
986 type Rebase = Unset;
987 type TooBig = Unset;
988 type Repo = Unset;
989 type Commit = Unset;
990 type Rev = Unset;
991 type Since = Unset;
992 type Blocks = Unset;
993 type Ops = Unset;
994 type Blobs = Unset;
995 type Time = Unset;
996 }
997 pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>);
999 impl<S: State> sealed::Sealed for SetSeq<S> {}
1000 impl<S: State> State for SetSeq<S> {
1001 type Seq = Set<members::seq>;
1002 type Rebase = S::Rebase;
1003 type TooBig = S::TooBig;
1004 type Repo = S::Repo;
1005 type Commit = S::Commit;
1006 type Rev = S::Rev;
1007 type Since = S::Since;
1008 type Blocks = S::Blocks;
1009 type Ops = S::Ops;
1010 type Blobs = S::Blobs;
1011 type Time = S::Time;
1012 }
1013 pub struct SetRebase<S: State = Empty>(PhantomData<fn() -> S>);
1015 impl<S: State> sealed::Sealed for SetRebase<S> {}
1016 impl<S: State> State for SetRebase<S> {
1017 type Seq = S::Seq;
1018 type Rebase = Set<members::rebase>;
1019 type TooBig = S::TooBig;
1020 type Repo = S::Repo;
1021 type Commit = S::Commit;
1022 type Rev = S::Rev;
1023 type Since = S::Since;
1024 type Blocks = S::Blocks;
1025 type Ops = S::Ops;
1026 type Blobs = S::Blobs;
1027 type Time = S::Time;
1028 }
1029 pub struct SetTooBig<S: State = Empty>(PhantomData<fn() -> S>);
1031 impl<S: State> sealed::Sealed for SetTooBig<S> {}
1032 impl<S: State> State for SetTooBig<S> {
1033 type Seq = S::Seq;
1034 type Rebase = S::Rebase;
1035 type TooBig = Set<members::too_big>;
1036 type Repo = S::Repo;
1037 type Commit = S::Commit;
1038 type Rev = S::Rev;
1039 type Since = S::Since;
1040 type Blocks = S::Blocks;
1041 type Ops = S::Ops;
1042 type Blobs = S::Blobs;
1043 type Time = S::Time;
1044 }
1045 pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>);
1047 impl<S: State> sealed::Sealed for SetRepo<S> {}
1048 impl<S: State> State for SetRepo<S> {
1049 type Seq = S::Seq;
1050 type Rebase = S::Rebase;
1051 type TooBig = S::TooBig;
1052 type Repo = Set<members::repo>;
1053 type Commit = S::Commit;
1054 type Rev = S::Rev;
1055 type Since = S::Since;
1056 type Blocks = S::Blocks;
1057 type Ops = S::Ops;
1058 type Blobs = S::Blobs;
1059 type Time = S::Time;
1060 }
1061 pub struct SetCommit<S: State = Empty>(PhantomData<fn() -> S>);
1063 impl<S: State> sealed::Sealed for SetCommit<S> {}
1064 impl<S: State> State for SetCommit<S> {
1065 type Seq = S::Seq;
1066 type Rebase = S::Rebase;
1067 type TooBig = S::TooBig;
1068 type Repo = S::Repo;
1069 type Commit = Set<members::commit>;
1070 type Rev = S::Rev;
1071 type Since = S::Since;
1072 type Blocks = S::Blocks;
1073 type Ops = S::Ops;
1074 type Blobs = S::Blobs;
1075 type Time = S::Time;
1076 }
1077 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>);
1079 impl<S: State> sealed::Sealed for SetRev<S> {}
1080 impl<S: State> State for SetRev<S> {
1081 type Seq = S::Seq;
1082 type Rebase = S::Rebase;
1083 type TooBig = S::TooBig;
1084 type Repo = S::Repo;
1085 type Commit = S::Commit;
1086 type Rev = Set<members::rev>;
1087 type Since = S::Since;
1088 type Blocks = S::Blocks;
1089 type Ops = S::Ops;
1090 type Blobs = S::Blobs;
1091 type Time = S::Time;
1092 }
1093 pub struct SetSince<S: State = Empty>(PhantomData<fn() -> S>);
1095 impl<S: State> sealed::Sealed for SetSince<S> {}
1096 impl<S: State> State for SetSince<S> {
1097 type Seq = S::Seq;
1098 type Rebase = S::Rebase;
1099 type TooBig = S::TooBig;
1100 type Repo = S::Repo;
1101 type Commit = S::Commit;
1102 type Rev = S::Rev;
1103 type Since = Set<members::since>;
1104 type Blocks = S::Blocks;
1105 type Ops = S::Ops;
1106 type Blobs = S::Blobs;
1107 type Time = S::Time;
1108 }
1109 pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>);
1111 impl<S: State> sealed::Sealed for SetBlocks<S> {}
1112 impl<S: State> State for SetBlocks<S> {
1113 type Seq = S::Seq;
1114 type Rebase = S::Rebase;
1115 type TooBig = S::TooBig;
1116 type Repo = S::Repo;
1117 type Commit = S::Commit;
1118 type Rev = S::Rev;
1119 type Since = S::Since;
1120 type Blocks = Set<members::blocks>;
1121 type Ops = S::Ops;
1122 type Blobs = S::Blobs;
1123 type Time = S::Time;
1124 }
1125 pub struct SetOps<S: State = Empty>(PhantomData<fn() -> S>);
1127 impl<S: State> sealed::Sealed for SetOps<S> {}
1128 impl<S: State> State for SetOps<S> {
1129 type Seq = S::Seq;
1130 type Rebase = S::Rebase;
1131 type TooBig = S::TooBig;
1132 type Repo = S::Repo;
1133 type Commit = S::Commit;
1134 type Rev = S::Rev;
1135 type Since = S::Since;
1136 type Blocks = S::Blocks;
1137 type Ops = Set<members::ops>;
1138 type Blobs = S::Blobs;
1139 type Time = S::Time;
1140 }
1141 pub struct SetBlobs<S: State = Empty>(PhantomData<fn() -> S>);
1143 impl<S: State> sealed::Sealed for SetBlobs<S> {}
1144 impl<S: State> State for SetBlobs<S> {
1145 type Seq = S::Seq;
1146 type Rebase = S::Rebase;
1147 type TooBig = S::TooBig;
1148 type Repo = S::Repo;
1149 type Commit = S::Commit;
1150 type Rev = S::Rev;
1151 type Since = S::Since;
1152 type Blocks = S::Blocks;
1153 type Ops = S::Ops;
1154 type Blobs = Set<members::blobs>;
1155 type Time = S::Time;
1156 }
1157 pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>);
1159 impl<S: State> sealed::Sealed for SetTime<S> {}
1160 impl<S: State> State for SetTime<S> {
1161 type Seq = S::Seq;
1162 type Rebase = S::Rebase;
1163 type TooBig = S::TooBig;
1164 type Repo = S::Repo;
1165 type Commit = S::Commit;
1166 type Rev = S::Rev;
1167 type Since = S::Since;
1168 type Blocks = S::Blocks;
1169 type Ops = S::Ops;
1170 type Blobs = S::Blobs;
1171 type Time = Set<members::time>;
1172 }
1173 #[allow(non_camel_case_types)]
1175 pub mod members {
1176 pub struct seq(());
1178 pub struct rebase(());
1180 pub struct too_big(());
1182 pub struct repo(());
1184 pub struct commit(());
1186 pub struct rev(());
1188 pub struct since(());
1190 pub struct blocks(());
1192 pub struct ops(());
1194 pub struct blobs(());
1196 pub struct time(());
1198 }
1199}
1200
1201pub struct CommitBuilder<'a, S: commit_state::State> {
1203 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
1204 __unsafe_private_named: (
1205 ::core::option::Option<Vec<jacquard_common::types::cid::CidLink<'a>>>,
1206 ::core::option::Option<bytes::Bytes>,
1207 ::core::option::Option<jacquard_common::types::cid::CidLink<'a>>,
1208 ::core::option::Option<
1209 Vec<crate::com_atproto::sync::subscribe_repos::RepoOp<'a>>,
1210 >,
1211 ::core::option::Option<jacquard_common::types::cid::CidLink<'a>>,
1212 ::core::option::Option<bool>,
1213 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
1214 ::core::option::Option<jacquard_common::types::string::Tid>,
1215 ::core::option::Option<i64>,
1216 ::core::option::Option<jacquard_common::types::string::Tid>,
1217 ::core::option::Option<jacquard_common::types::string::Datetime>,
1218 ::core::option::Option<bool>,
1219 ),
1220 _phantom: ::core::marker::PhantomData<&'a ()>,
1221}
1222
1223impl<'a> Commit<'a> {
1224 pub fn new() -> CommitBuilder<'a, commit_state::Empty> {
1226 CommitBuilder::new()
1227 }
1228}
1229
1230impl<'a> CommitBuilder<'a, commit_state::Empty> {
1231 pub fn new() -> Self {
1233 CommitBuilder {
1234 _phantom_state: ::core::marker::PhantomData,
1235 __unsafe_private_named: (
1236 None,
1237 None,
1238 None,
1239 None,
1240 None,
1241 None,
1242 None,
1243 None,
1244 None,
1245 None,
1246 None,
1247 None,
1248 ),
1249 _phantom: ::core::marker::PhantomData,
1250 }
1251 }
1252}
1253
1254impl<'a, S> CommitBuilder<'a, S>
1255where
1256 S: commit_state::State,
1257 S::Blobs: commit_state::IsUnset,
1258{
1259 pub fn blobs(
1261 mut self,
1262 value: impl Into<Vec<jacquard_common::types::cid::CidLink<'a>>>,
1263 ) -> CommitBuilder<'a, commit_state::SetBlobs<S>> {
1264 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
1265 CommitBuilder {
1266 _phantom_state: ::core::marker::PhantomData,
1267 __unsafe_private_named: self.__unsafe_private_named,
1268 _phantom: ::core::marker::PhantomData,
1269 }
1270 }
1271}
1272
1273impl<'a, S> CommitBuilder<'a, S>
1274where
1275 S: commit_state::State,
1276 S::Blocks: commit_state::IsUnset,
1277{
1278 pub fn blocks(
1280 mut self,
1281 value: impl Into<bytes::Bytes>,
1282 ) -> CommitBuilder<'a, commit_state::SetBlocks<S>> {
1283 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
1284 CommitBuilder {
1285 _phantom_state: ::core::marker::PhantomData,
1286 __unsafe_private_named: self.__unsafe_private_named,
1287 _phantom: ::core::marker::PhantomData,
1288 }
1289 }
1290}
1291
1292impl<'a, S> CommitBuilder<'a, S>
1293where
1294 S: commit_state::State,
1295 S::Commit: commit_state::IsUnset,
1296{
1297 pub fn commit(
1299 mut self,
1300 value: impl Into<jacquard_common::types::cid::CidLink<'a>>,
1301 ) -> CommitBuilder<'a, commit_state::SetCommit<S>> {
1302 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
1303 CommitBuilder {
1304 _phantom_state: ::core::marker::PhantomData,
1305 __unsafe_private_named: self.__unsafe_private_named,
1306 _phantom: ::core::marker::PhantomData,
1307 }
1308 }
1309}
1310
1311impl<'a, S> CommitBuilder<'a, S>
1312where
1313 S: commit_state::State,
1314 S::Ops: commit_state::IsUnset,
1315{
1316 pub fn ops(
1318 mut self,
1319 value: impl Into<Vec<crate::com_atproto::sync::subscribe_repos::RepoOp<'a>>>,
1320 ) -> CommitBuilder<'a, commit_state::SetOps<S>> {
1321 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
1322 CommitBuilder {
1323 _phantom_state: ::core::marker::PhantomData,
1324 __unsafe_private_named: self.__unsafe_private_named,
1325 _phantom: ::core::marker::PhantomData,
1326 }
1327 }
1328}
1329
1330impl<'a, S: commit_state::State> CommitBuilder<'a, S> {
1331 pub fn prev_data(
1333 mut self,
1334 value: impl Into<Option<jacquard_common::types::cid::CidLink<'a>>>,
1335 ) -> Self {
1336 self.__unsafe_private_named.4 = value.into();
1337 self
1338 }
1339 pub fn maybe_prev_data(
1341 mut self,
1342 value: Option<jacquard_common::types::cid::CidLink<'a>>,
1343 ) -> Self {
1344 self.__unsafe_private_named.4 = value;
1345 self
1346 }
1347}
1348
1349impl<'a, S> CommitBuilder<'a, S>
1350where
1351 S: commit_state::State,
1352 S::Rebase: commit_state::IsUnset,
1353{
1354 pub fn rebase(
1356 mut self,
1357 value: impl Into<bool>,
1358 ) -> CommitBuilder<'a, commit_state::SetRebase<S>> {
1359 self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into());
1360 CommitBuilder {
1361 _phantom_state: ::core::marker::PhantomData,
1362 __unsafe_private_named: self.__unsafe_private_named,
1363 _phantom: ::core::marker::PhantomData,
1364 }
1365 }
1366}
1367
1368impl<'a, S> CommitBuilder<'a, S>
1369where
1370 S: commit_state::State,
1371 S::Repo: commit_state::IsUnset,
1372{
1373 pub fn repo(
1375 mut self,
1376 value: impl Into<jacquard_common::types::string::Did<'a>>,
1377 ) -> CommitBuilder<'a, commit_state::SetRepo<S>> {
1378 self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into());
1379 CommitBuilder {
1380 _phantom_state: ::core::marker::PhantomData,
1381 __unsafe_private_named: self.__unsafe_private_named,
1382 _phantom: ::core::marker::PhantomData,
1383 }
1384 }
1385}
1386
1387impl<'a, S> CommitBuilder<'a, S>
1388where
1389 S: commit_state::State,
1390 S::Rev: commit_state::IsUnset,
1391{
1392 pub fn rev(
1394 mut self,
1395 value: impl Into<jacquard_common::types::string::Tid>,
1396 ) -> CommitBuilder<'a, commit_state::SetRev<S>> {
1397 self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into());
1398 CommitBuilder {
1399 _phantom_state: ::core::marker::PhantomData,
1400 __unsafe_private_named: self.__unsafe_private_named,
1401 _phantom: ::core::marker::PhantomData,
1402 }
1403 }
1404}
1405
1406impl<'a, S> CommitBuilder<'a, S>
1407where
1408 S: commit_state::State,
1409 S::Seq: commit_state::IsUnset,
1410{
1411 pub fn seq(
1413 mut self,
1414 value: impl Into<i64>,
1415 ) -> CommitBuilder<'a, commit_state::SetSeq<S>> {
1416 self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into());
1417 CommitBuilder {
1418 _phantom_state: ::core::marker::PhantomData,
1419 __unsafe_private_named: self.__unsafe_private_named,
1420 _phantom: ::core::marker::PhantomData,
1421 }
1422 }
1423}
1424
1425impl<'a, S> CommitBuilder<'a, S>
1426where
1427 S: commit_state::State,
1428 S::Since: commit_state::IsUnset,
1429{
1430 pub fn since(
1432 mut self,
1433 value: impl Into<jacquard_common::types::string::Tid>,
1434 ) -> CommitBuilder<'a, commit_state::SetSince<S>> {
1435 self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into());
1436 CommitBuilder {
1437 _phantom_state: ::core::marker::PhantomData,
1438 __unsafe_private_named: self.__unsafe_private_named,
1439 _phantom: ::core::marker::PhantomData,
1440 }
1441 }
1442}
1443
1444impl<'a, S> CommitBuilder<'a, S>
1445where
1446 S: commit_state::State,
1447 S::Time: commit_state::IsUnset,
1448{
1449 pub fn time(
1451 mut self,
1452 value: impl Into<jacquard_common::types::string::Datetime>,
1453 ) -> CommitBuilder<'a, commit_state::SetTime<S>> {
1454 self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into());
1455 CommitBuilder {
1456 _phantom_state: ::core::marker::PhantomData,
1457 __unsafe_private_named: self.__unsafe_private_named,
1458 _phantom: ::core::marker::PhantomData,
1459 }
1460 }
1461}
1462
1463impl<'a, S> CommitBuilder<'a, S>
1464where
1465 S: commit_state::State,
1466 S::TooBig: commit_state::IsUnset,
1467{
1468 pub fn too_big(
1470 mut self,
1471 value: impl Into<bool>,
1472 ) -> CommitBuilder<'a, commit_state::SetTooBig<S>> {
1473 self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into());
1474 CommitBuilder {
1475 _phantom_state: ::core::marker::PhantomData,
1476 __unsafe_private_named: self.__unsafe_private_named,
1477 _phantom: ::core::marker::PhantomData,
1478 }
1479 }
1480}
1481
1482impl<'a, S> CommitBuilder<'a, S>
1483where
1484 S: commit_state::State,
1485 S::Seq: commit_state::IsSet,
1486 S::Rebase: commit_state::IsSet,
1487 S::TooBig: commit_state::IsSet,
1488 S::Repo: commit_state::IsSet,
1489 S::Commit: commit_state::IsSet,
1490 S::Rev: commit_state::IsSet,
1491 S::Since: commit_state::IsSet,
1492 S::Blocks: commit_state::IsSet,
1493 S::Ops: commit_state::IsSet,
1494 S::Blobs: commit_state::IsSet,
1495 S::Time: commit_state::IsSet,
1496{
1497 pub fn build(self) -> Commit<'a> {
1499 Commit {
1500 blobs: self.__unsafe_private_named.0.unwrap(),
1501 blocks: self.__unsafe_private_named.1.unwrap(),
1502 commit: self.__unsafe_private_named.2.unwrap(),
1503 ops: self.__unsafe_private_named.3.unwrap(),
1504 prev_data: self.__unsafe_private_named.4,
1505 rebase: self.__unsafe_private_named.5.unwrap(),
1506 repo: self.__unsafe_private_named.6.unwrap(),
1507 rev: self.__unsafe_private_named.7.unwrap(),
1508 seq: self.__unsafe_private_named.8.unwrap(),
1509 since: self.__unsafe_private_named.9.unwrap(),
1510 time: self.__unsafe_private_named.10.unwrap(),
1511 too_big: self.__unsafe_private_named.11.unwrap(),
1512 extra_data: Default::default(),
1513 }
1514 }
1515 pub fn build_with_data(
1517 self,
1518 extra_data: std::collections::BTreeMap<
1519 jacquard_common::smol_str::SmolStr,
1520 jacquard_common::types::value::Data<'a>,
1521 >,
1522 ) -> Commit<'a> {
1523 Commit {
1524 blobs: self.__unsafe_private_named.0.unwrap(),
1525 blocks: self.__unsafe_private_named.1.unwrap(),
1526 commit: self.__unsafe_private_named.2.unwrap(),
1527 ops: self.__unsafe_private_named.3.unwrap(),
1528 prev_data: self.__unsafe_private_named.4,
1529 rebase: self.__unsafe_private_named.5.unwrap(),
1530 repo: self.__unsafe_private_named.6.unwrap(),
1531 rev: self.__unsafe_private_named.7.unwrap(),
1532 seq: self.__unsafe_private_named.8.unwrap(),
1533 since: self.__unsafe_private_named.9.unwrap(),
1534 time: self.__unsafe_private_named.10.unwrap(),
1535 too_big: self.__unsafe_private_named.11.unwrap(),
1536 extra_data: Some(extra_data),
1537 }
1538 }
1539}
1540
1541impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Commit<'a> {
1542 fn nsid() -> &'static str {
1543 "com.atproto.sync.subscribeRepos"
1544 }
1545 fn def_name() -> &'static str {
1546 "commit"
1547 }
1548 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1549 lexicon_doc_com_atproto_sync_subscribeRepos()
1550 }
1551 fn validate(
1552 &self,
1553 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1554 {
1555 let value = &self.ops;
1556 #[allow(unused_comparisons)]
1557 if value.len() > 200usize {
1558 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
1559 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
1560 "ops",
1561 ),
1562 max: 200usize,
1563 actual: value.len(),
1564 });
1565 }
1566 }
1567 Ok(())
1568 }
1569}
1570
1571#[jacquard_derive::lexicon]
1573#[derive(
1574 serde::Serialize,
1575 serde::Deserialize,
1576 Debug,
1577 Clone,
1578 PartialEq,
1579 Eq,
1580 jacquard_derive::IntoStatic
1581)]
1582#[serde(rename_all = "camelCase")]
1583pub struct Identity<'a> {
1584 #[serde(borrow)]
1585 pub did: jacquard_common::types::string::Did<'a>,
1586 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1588 #[serde(borrow)]
1589 pub handle: Option<jacquard_common::types::string::Handle<'a>>,
1590 pub seq: i64,
1591 pub time: jacquard_common::types::string::Datetime,
1592}
1593
1594pub mod identity_state {
1595
1596 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1597 #[allow(unused)]
1598 use ::core::marker::PhantomData;
1599 mod sealed {
1600 pub trait Sealed {}
1601 }
1602 pub trait State: sealed::Sealed {
1604 type Seq;
1605 type Did;
1606 type Time;
1607 }
1608 pub struct Empty(());
1610 impl sealed::Sealed for Empty {}
1611 impl State for Empty {
1612 type Seq = Unset;
1613 type Did = Unset;
1614 type Time = Unset;
1615 }
1616 pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>);
1618 impl<S: State> sealed::Sealed for SetSeq<S> {}
1619 impl<S: State> State for SetSeq<S> {
1620 type Seq = Set<members::seq>;
1621 type Did = S::Did;
1622 type Time = S::Time;
1623 }
1624 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
1626 impl<S: State> sealed::Sealed for SetDid<S> {}
1627 impl<S: State> State for SetDid<S> {
1628 type Seq = S::Seq;
1629 type Did = Set<members::did>;
1630 type Time = S::Time;
1631 }
1632 pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>);
1634 impl<S: State> sealed::Sealed for SetTime<S> {}
1635 impl<S: State> State for SetTime<S> {
1636 type Seq = S::Seq;
1637 type Did = S::Did;
1638 type Time = Set<members::time>;
1639 }
1640 #[allow(non_camel_case_types)]
1642 pub mod members {
1643 pub struct seq(());
1645 pub struct did(());
1647 pub struct time(());
1649 }
1650}
1651
1652pub struct IdentityBuilder<'a, S: identity_state::State> {
1654 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
1655 __unsafe_private_named: (
1656 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
1657 ::core::option::Option<jacquard_common::types::string::Handle<'a>>,
1658 ::core::option::Option<i64>,
1659 ::core::option::Option<jacquard_common::types::string::Datetime>,
1660 ),
1661 _phantom: ::core::marker::PhantomData<&'a ()>,
1662}
1663
1664impl<'a> Identity<'a> {
1665 pub fn new() -> IdentityBuilder<'a, identity_state::Empty> {
1667 IdentityBuilder::new()
1668 }
1669}
1670
1671impl<'a> IdentityBuilder<'a, identity_state::Empty> {
1672 pub fn new() -> Self {
1674 IdentityBuilder {
1675 _phantom_state: ::core::marker::PhantomData,
1676 __unsafe_private_named: (None, None, None, None),
1677 _phantom: ::core::marker::PhantomData,
1678 }
1679 }
1680}
1681
1682impl<'a, S> IdentityBuilder<'a, S>
1683where
1684 S: identity_state::State,
1685 S::Did: identity_state::IsUnset,
1686{
1687 pub fn did(
1689 mut self,
1690 value: impl Into<jacquard_common::types::string::Did<'a>>,
1691 ) -> IdentityBuilder<'a, identity_state::SetDid<S>> {
1692 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
1693 IdentityBuilder {
1694 _phantom_state: ::core::marker::PhantomData,
1695 __unsafe_private_named: self.__unsafe_private_named,
1696 _phantom: ::core::marker::PhantomData,
1697 }
1698 }
1699}
1700
1701impl<'a, S: identity_state::State> IdentityBuilder<'a, S> {
1702 pub fn handle(
1704 mut self,
1705 value: impl Into<Option<jacquard_common::types::string::Handle<'a>>>,
1706 ) -> Self {
1707 self.__unsafe_private_named.1 = value.into();
1708 self
1709 }
1710 pub fn maybe_handle(
1712 mut self,
1713 value: Option<jacquard_common::types::string::Handle<'a>>,
1714 ) -> Self {
1715 self.__unsafe_private_named.1 = value;
1716 self
1717 }
1718}
1719
1720impl<'a, S> IdentityBuilder<'a, S>
1721where
1722 S: identity_state::State,
1723 S::Seq: identity_state::IsUnset,
1724{
1725 pub fn seq(
1727 mut self,
1728 value: impl Into<i64>,
1729 ) -> IdentityBuilder<'a, identity_state::SetSeq<S>> {
1730 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
1731 IdentityBuilder {
1732 _phantom_state: ::core::marker::PhantomData,
1733 __unsafe_private_named: self.__unsafe_private_named,
1734 _phantom: ::core::marker::PhantomData,
1735 }
1736 }
1737}
1738
1739impl<'a, S> IdentityBuilder<'a, S>
1740where
1741 S: identity_state::State,
1742 S::Time: identity_state::IsUnset,
1743{
1744 pub fn time(
1746 mut self,
1747 value: impl Into<jacquard_common::types::string::Datetime>,
1748 ) -> IdentityBuilder<'a, identity_state::SetTime<S>> {
1749 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
1750 IdentityBuilder {
1751 _phantom_state: ::core::marker::PhantomData,
1752 __unsafe_private_named: self.__unsafe_private_named,
1753 _phantom: ::core::marker::PhantomData,
1754 }
1755 }
1756}
1757
1758impl<'a, S> IdentityBuilder<'a, S>
1759where
1760 S: identity_state::State,
1761 S::Seq: identity_state::IsSet,
1762 S::Did: identity_state::IsSet,
1763 S::Time: identity_state::IsSet,
1764{
1765 pub fn build(self) -> Identity<'a> {
1767 Identity {
1768 did: self.__unsafe_private_named.0.unwrap(),
1769 handle: self.__unsafe_private_named.1,
1770 seq: self.__unsafe_private_named.2.unwrap(),
1771 time: self.__unsafe_private_named.3.unwrap(),
1772 extra_data: Default::default(),
1773 }
1774 }
1775 pub fn build_with_data(
1777 self,
1778 extra_data: std::collections::BTreeMap<
1779 jacquard_common::smol_str::SmolStr,
1780 jacquard_common::types::value::Data<'a>,
1781 >,
1782 ) -> Identity<'a> {
1783 Identity {
1784 did: self.__unsafe_private_named.0.unwrap(),
1785 handle: self.__unsafe_private_named.1,
1786 seq: self.__unsafe_private_named.2.unwrap(),
1787 time: self.__unsafe_private_named.3.unwrap(),
1788 extra_data: Some(extra_data),
1789 }
1790 }
1791}
1792
1793impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Identity<'a> {
1794 fn nsid() -> &'static str {
1795 "com.atproto.sync.subscribeRepos"
1796 }
1797 fn def_name() -> &'static str {
1798 "identity"
1799 }
1800 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1801 lexicon_doc_com_atproto_sync_subscribeRepos()
1802 }
1803 fn validate(
1804 &self,
1805 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1806 Ok(())
1807 }
1808}
1809
1810#[jacquard_derive::lexicon]
1811#[derive(
1812 serde::Serialize,
1813 serde::Deserialize,
1814 Debug,
1815 Clone,
1816 PartialEq,
1817 Eq,
1818 jacquard_derive::IntoStatic,
1819 Default
1820)]
1821#[serde(rename_all = "camelCase")]
1822pub struct Info<'a> {
1823 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1824 #[serde(borrow)]
1825 pub message: std::option::Option<jacquard_common::CowStr<'a>>,
1826 #[serde(borrow)]
1827 pub name: jacquard_common::CowStr<'a>,
1828}
1829
1830impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Info<'a> {
1831 fn nsid() -> &'static str {
1832 "com.atproto.sync.subscribeRepos"
1833 }
1834 fn def_name() -> &'static str {
1835 "info"
1836 }
1837 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
1838 lexicon_doc_com_atproto_sync_subscribeRepos()
1839 }
1840 fn validate(
1841 &self,
1842 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
1843 Ok(())
1844 }
1845}
1846
1847#[derive(
1848 serde::Serialize,
1849 serde::Deserialize,
1850 Debug,
1851 Clone,
1852 PartialEq,
1853 Eq,
1854 jacquard_derive::IntoStatic
1855)]
1856#[serde(rename_all = "camelCase")]
1857pub struct SubscribeRepos {
1858 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1859 pub cursor: std::option::Option<i64>,
1860}
1861
1862pub mod subscribe_repos_state {
1863
1864 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1865 #[allow(unused)]
1866 use ::core::marker::PhantomData;
1867 mod sealed {
1868 pub trait Sealed {}
1869 }
1870 pub trait State: sealed::Sealed {}
1872 pub struct Empty(());
1874 impl sealed::Sealed for Empty {}
1875 impl State for Empty {}
1876 #[allow(non_camel_case_types)]
1878 pub mod members {}
1879}
1880
1881pub struct SubscribeReposBuilder<S: subscribe_repos_state::State> {
1883 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
1884 __unsafe_private_named: (::core::option::Option<i64>,),
1885}
1886
1887impl SubscribeRepos {
1888 pub fn new() -> SubscribeReposBuilder<subscribe_repos_state::Empty> {
1890 SubscribeReposBuilder::new()
1891 }
1892}
1893
1894impl SubscribeReposBuilder<subscribe_repos_state::Empty> {
1895 pub fn new() -> Self {
1897 SubscribeReposBuilder {
1898 _phantom_state: ::core::marker::PhantomData,
1899 __unsafe_private_named: (None,),
1900 }
1901 }
1902}
1903
1904impl<S: subscribe_repos_state::State> SubscribeReposBuilder<S> {
1905 pub fn cursor(mut self, value: impl Into<Option<i64>>) -> Self {
1907 self.__unsafe_private_named.0 = value.into();
1908 self
1909 }
1910 pub fn maybe_cursor(mut self, value: Option<i64>) -> Self {
1912 self.__unsafe_private_named.0 = value;
1913 self
1914 }
1915}
1916
1917impl<S> SubscribeReposBuilder<S>
1918where
1919 S: subscribe_repos_state::State,
1920{
1921 pub fn build(self) -> SubscribeRepos {
1923 SubscribeRepos {
1924 cursor: self.__unsafe_private_named.0,
1925 }
1926 }
1927}
1928
1929#[jacquard_derive::open_union]
1930#[derive(
1931 serde::Serialize,
1932 serde::Deserialize,
1933 Debug,
1934 Clone,
1935 PartialEq,
1936 Eq,
1937 jacquard_derive::IntoStatic
1938)]
1939#[serde(tag = "$type")]
1940#[serde(bound(deserialize = "'de: 'a"))]
1941pub enum SubscribeReposMessage<'a> {
1942 #[serde(rename = "#commit")]
1943 Commit(Box<crate::com_atproto::sync::subscribe_repos::Commit<'a>>),
1944 #[serde(rename = "#sync")]
1945 Sync(Box<crate::com_atproto::sync::subscribe_repos::Sync<'a>>),
1946 #[serde(rename = "#identity")]
1947 Identity(Box<crate::com_atproto::sync::subscribe_repos::Identity<'a>>),
1948 #[serde(rename = "#account")]
1949 Account(Box<crate::com_atproto::sync::subscribe_repos::Account<'a>>),
1950 #[serde(rename = "#info")]
1951 Info(Box<crate::com_atproto::sync::subscribe_repos::Info<'a>>),
1952}
1953
1954impl<'a> SubscribeReposMessage<'a> {
1955 pub fn decode_framed<'de: 'a>(
1957 bytes: &'de [u8],
1958 ) -> Result<SubscribeReposMessage<'a>, jacquard_common::error::DecodeError> {
1959 let (header, body) = jacquard_common::xrpc::subscription::parse_event_header(
1960 bytes,
1961 )?;
1962 match header.t.as_str() {
1963 "#commit" => {
1964 let variant = serde_ipld_dagcbor::from_slice(body)?;
1965 Ok(Self::Commit(Box::new(variant)))
1966 }
1967 "#sync" => {
1968 let variant = serde_ipld_dagcbor::from_slice(body)?;
1969 Ok(Self::Sync(Box::new(variant)))
1970 }
1971 "#identity" => {
1972 let variant = serde_ipld_dagcbor::from_slice(body)?;
1973 Ok(Self::Identity(Box::new(variant)))
1974 }
1975 "#account" => {
1976 let variant = serde_ipld_dagcbor::from_slice(body)?;
1977 Ok(Self::Account(Box::new(variant)))
1978 }
1979 "#info" => {
1980 let variant = serde_ipld_dagcbor::from_slice(body)?;
1981 Ok(Self::Info(Box::new(variant)))
1982 }
1983 unknown => {
1984 Err(
1985 jacquard_common::error::DecodeError::UnknownEventType(unknown.into()),
1986 )
1987 }
1988 }
1989 }
1990}
1991
1992#[jacquard_derive::open_union]
1993#[derive(
1994 serde::Serialize,
1995 serde::Deserialize,
1996 Debug,
1997 Clone,
1998 PartialEq,
1999 Eq,
2000 thiserror::Error,
2001 miette::Diagnostic,
2002 jacquard_derive::IntoStatic
2003)]
2004#[serde(tag = "error", content = "message")]
2005#[serde(bound(deserialize = "'de: 'a"))]
2006pub enum SubscribeReposError<'a> {
2007 #[serde(rename = "FutureCursor")]
2008 FutureCursor(std::option::Option<String>),
2009 #[serde(rename = "ConsumerTooSlow")]
2011 ConsumerTooSlow(std::option::Option<String>),
2012}
2013
2014impl std::fmt::Display for SubscribeReposError<'_> {
2015 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2016 match self {
2017 Self::FutureCursor(msg) => {
2018 write!(f, "FutureCursor")?;
2019 if let Some(msg) = msg {
2020 write!(f, ": {}", msg)?;
2021 }
2022 Ok(())
2023 }
2024 Self::ConsumerTooSlow(msg) => {
2025 write!(f, "ConsumerTooSlow")?;
2026 if let Some(msg) = msg {
2027 write!(f, ": {}", msg)?;
2028 }
2029 Ok(())
2030 }
2031 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err),
2032 }
2033 }
2034}
2035
2036pub struct SubscribeReposStream;
2039impl jacquard_common::xrpc::SubscriptionResp for SubscribeReposStream {
2040 const NSID: &'static str = "com.atproto.sync.subscribeRepos";
2041 const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::DagCbor;
2042 type Message<'de> = SubscribeReposMessage<'de>;
2043 type Error<'de> = SubscribeReposError<'de>;
2044 fn decode_message<'de>(
2045 bytes: &'de [u8],
2046 ) -> Result<Self::Message<'de>, jacquard_common::error::DecodeError> {
2047 SubscribeReposMessage::decode_framed(bytes)
2048 }
2049}
2050
2051impl jacquard_common::xrpc::XrpcSubscription for SubscribeRepos {
2052 const NSID: &'static str = "com.atproto.sync.subscribeRepos";
2053 const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::DagCbor;
2054 type Stream = SubscribeReposStream;
2055}
2056
2057pub struct SubscribeReposEndpoint;
2058impl jacquard_common::xrpc::SubscriptionEndpoint for SubscribeReposEndpoint {
2059 const PATH: &'static str = "/xrpc/com.atproto.sync.subscribeRepos";
2060 const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::DagCbor;
2061 type Params<'de> = SubscribeRepos;
2062 type Stream = SubscribeReposStream;
2063}
2064
2065#[jacquard_derive::lexicon]
2067#[derive(
2068 serde::Serialize,
2069 serde::Deserialize,
2070 Debug,
2071 Clone,
2072 PartialEq,
2073 Eq,
2074 jacquard_derive::IntoStatic
2075)]
2076#[serde(rename_all = "camelCase")]
2077pub struct RepoOp<'a> {
2078 #[serde(borrow)]
2079 pub action: jacquard_common::CowStr<'a>,
2080 #[serde(borrow)]
2082 pub cid: jacquard_common::types::cid::CidLink<'a>,
2083 #[serde(borrow)]
2084 pub path: jacquard_common::CowStr<'a>,
2085 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2087 #[serde(borrow)]
2088 pub prev: Option<jacquard_common::types::cid::CidLink<'a>>,
2089}
2090
2091pub mod repo_op_state {
2092
2093 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2094 #[allow(unused)]
2095 use ::core::marker::PhantomData;
2096 mod sealed {
2097 pub trait Sealed {}
2098 }
2099 pub trait State: sealed::Sealed {
2101 type Action;
2102 type Path;
2103 type Cid;
2104 }
2105 pub struct Empty(());
2107 impl sealed::Sealed for Empty {}
2108 impl State for Empty {
2109 type Action = Unset;
2110 type Path = Unset;
2111 type Cid = Unset;
2112 }
2113 pub struct SetAction<S: State = Empty>(PhantomData<fn() -> S>);
2115 impl<S: State> sealed::Sealed for SetAction<S> {}
2116 impl<S: State> State for SetAction<S> {
2117 type Action = Set<members::action>;
2118 type Path = S::Path;
2119 type Cid = S::Cid;
2120 }
2121 pub struct SetPath<S: State = Empty>(PhantomData<fn() -> S>);
2123 impl<S: State> sealed::Sealed for SetPath<S> {}
2124 impl<S: State> State for SetPath<S> {
2125 type Action = S::Action;
2126 type Path = Set<members::path>;
2127 type Cid = S::Cid;
2128 }
2129 pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
2131 impl<S: State> sealed::Sealed for SetCid<S> {}
2132 impl<S: State> State for SetCid<S> {
2133 type Action = S::Action;
2134 type Path = S::Path;
2135 type Cid = Set<members::cid>;
2136 }
2137 #[allow(non_camel_case_types)]
2139 pub mod members {
2140 pub struct action(());
2142 pub struct path(());
2144 pub struct cid(());
2146 }
2147}
2148
2149pub struct RepoOpBuilder<'a, S: repo_op_state::State> {
2151 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
2152 __unsafe_private_named: (
2153 ::core::option::Option<jacquard_common::CowStr<'a>>,
2154 ::core::option::Option<jacquard_common::types::cid::CidLink<'a>>,
2155 ::core::option::Option<jacquard_common::CowStr<'a>>,
2156 ::core::option::Option<jacquard_common::types::cid::CidLink<'a>>,
2157 ),
2158 _phantom: ::core::marker::PhantomData<&'a ()>,
2159}
2160
2161impl<'a> RepoOp<'a> {
2162 pub fn new() -> RepoOpBuilder<'a, repo_op_state::Empty> {
2164 RepoOpBuilder::new()
2165 }
2166}
2167
2168impl<'a> RepoOpBuilder<'a, repo_op_state::Empty> {
2169 pub fn new() -> Self {
2171 RepoOpBuilder {
2172 _phantom_state: ::core::marker::PhantomData,
2173 __unsafe_private_named: (None, None, None, None),
2174 _phantom: ::core::marker::PhantomData,
2175 }
2176 }
2177}
2178
2179impl<'a, S> RepoOpBuilder<'a, S>
2180where
2181 S: repo_op_state::State,
2182 S::Action: repo_op_state::IsUnset,
2183{
2184 pub fn action(
2186 mut self,
2187 value: impl Into<jacquard_common::CowStr<'a>>,
2188 ) -> RepoOpBuilder<'a, repo_op_state::SetAction<S>> {
2189 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
2190 RepoOpBuilder {
2191 _phantom_state: ::core::marker::PhantomData,
2192 __unsafe_private_named: self.__unsafe_private_named,
2193 _phantom: ::core::marker::PhantomData,
2194 }
2195 }
2196}
2197
2198impl<'a, S> RepoOpBuilder<'a, S>
2199where
2200 S: repo_op_state::State,
2201 S::Cid: repo_op_state::IsUnset,
2202{
2203 pub fn cid(
2205 mut self,
2206 value: impl Into<jacquard_common::types::cid::CidLink<'a>>,
2207 ) -> RepoOpBuilder<'a, repo_op_state::SetCid<S>> {
2208 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
2209 RepoOpBuilder {
2210 _phantom_state: ::core::marker::PhantomData,
2211 __unsafe_private_named: self.__unsafe_private_named,
2212 _phantom: ::core::marker::PhantomData,
2213 }
2214 }
2215}
2216
2217impl<'a, S> RepoOpBuilder<'a, S>
2218where
2219 S: repo_op_state::State,
2220 S::Path: repo_op_state::IsUnset,
2221{
2222 pub fn path(
2224 mut self,
2225 value: impl Into<jacquard_common::CowStr<'a>>,
2226 ) -> RepoOpBuilder<'a, repo_op_state::SetPath<S>> {
2227 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
2228 RepoOpBuilder {
2229 _phantom_state: ::core::marker::PhantomData,
2230 __unsafe_private_named: self.__unsafe_private_named,
2231 _phantom: ::core::marker::PhantomData,
2232 }
2233 }
2234}
2235
2236impl<'a, S: repo_op_state::State> RepoOpBuilder<'a, S> {
2237 pub fn prev(
2239 mut self,
2240 value: impl Into<Option<jacquard_common::types::cid::CidLink<'a>>>,
2241 ) -> Self {
2242 self.__unsafe_private_named.3 = value.into();
2243 self
2244 }
2245 pub fn maybe_prev(
2247 mut self,
2248 value: Option<jacquard_common::types::cid::CidLink<'a>>,
2249 ) -> Self {
2250 self.__unsafe_private_named.3 = value;
2251 self
2252 }
2253}
2254
2255impl<'a, S> RepoOpBuilder<'a, S>
2256where
2257 S: repo_op_state::State,
2258 S::Action: repo_op_state::IsSet,
2259 S::Path: repo_op_state::IsSet,
2260 S::Cid: repo_op_state::IsSet,
2261{
2262 pub fn build(self) -> RepoOp<'a> {
2264 RepoOp {
2265 action: self.__unsafe_private_named.0.unwrap(),
2266 cid: self.__unsafe_private_named.1.unwrap(),
2267 path: self.__unsafe_private_named.2.unwrap(),
2268 prev: self.__unsafe_private_named.3,
2269 extra_data: Default::default(),
2270 }
2271 }
2272 pub fn build_with_data(
2274 self,
2275 extra_data: std::collections::BTreeMap<
2276 jacquard_common::smol_str::SmolStr,
2277 jacquard_common::types::value::Data<'a>,
2278 >,
2279 ) -> RepoOp<'a> {
2280 RepoOp {
2281 action: self.__unsafe_private_named.0.unwrap(),
2282 cid: self.__unsafe_private_named.1.unwrap(),
2283 path: self.__unsafe_private_named.2.unwrap(),
2284 prev: self.__unsafe_private_named.3,
2285 extra_data: Some(extra_data),
2286 }
2287 }
2288}
2289
2290impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RepoOp<'a> {
2291 fn nsid() -> &'static str {
2292 "com.atproto.sync.subscribeRepos"
2293 }
2294 fn def_name() -> &'static str {
2295 "repoOp"
2296 }
2297 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
2298 lexicon_doc_com_atproto_sync_subscribeRepos()
2299 }
2300 fn validate(
2301 &self,
2302 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
2303 Ok(())
2304 }
2305}
2306
2307#[jacquard_derive::lexicon]
2309#[derive(
2310 serde::Serialize,
2311 serde::Deserialize,
2312 Debug,
2313 Clone,
2314 PartialEq,
2315 Eq,
2316 jacquard_derive::IntoStatic
2317)]
2318#[serde(rename_all = "camelCase")]
2319pub struct Sync<'a> {
2320 pub blocks: bytes::Bytes,
2322 #[serde(borrow)]
2324 pub did: jacquard_common::types::string::Did<'a>,
2325 #[serde(borrow)]
2327 pub rev: jacquard_common::CowStr<'a>,
2328 pub seq: i64,
2330 pub time: jacquard_common::types::string::Datetime,
2332}
2333
2334pub mod sync_state {
2335
2336 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2337 #[allow(unused)]
2338 use ::core::marker::PhantomData;
2339 mod sealed {
2340 pub trait Sealed {}
2341 }
2342 pub trait State: sealed::Sealed {
2344 type Seq;
2345 type Did;
2346 type Blocks;
2347 type Rev;
2348 type Time;
2349 }
2350 pub struct Empty(());
2352 impl sealed::Sealed for Empty {}
2353 impl State for Empty {
2354 type Seq = Unset;
2355 type Did = Unset;
2356 type Blocks = Unset;
2357 type Rev = Unset;
2358 type Time = Unset;
2359 }
2360 pub struct SetSeq<S: State = Empty>(PhantomData<fn() -> S>);
2362 impl<S: State> sealed::Sealed for SetSeq<S> {}
2363 impl<S: State> State for SetSeq<S> {
2364 type Seq = Set<members::seq>;
2365 type Did = S::Did;
2366 type Blocks = S::Blocks;
2367 type Rev = S::Rev;
2368 type Time = S::Time;
2369 }
2370 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
2372 impl<S: State> sealed::Sealed for SetDid<S> {}
2373 impl<S: State> State for SetDid<S> {
2374 type Seq = S::Seq;
2375 type Did = Set<members::did>;
2376 type Blocks = S::Blocks;
2377 type Rev = S::Rev;
2378 type Time = S::Time;
2379 }
2380 pub struct SetBlocks<S: State = Empty>(PhantomData<fn() -> S>);
2382 impl<S: State> sealed::Sealed for SetBlocks<S> {}
2383 impl<S: State> State for SetBlocks<S> {
2384 type Seq = S::Seq;
2385 type Did = S::Did;
2386 type Blocks = Set<members::blocks>;
2387 type Rev = S::Rev;
2388 type Time = S::Time;
2389 }
2390 pub struct SetRev<S: State = Empty>(PhantomData<fn() -> S>);
2392 impl<S: State> sealed::Sealed for SetRev<S> {}
2393 impl<S: State> State for SetRev<S> {
2394 type Seq = S::Seq;
2395 type Did = S::Did;
2396 type Blocks = S::Blocks;
2397 type Rev = Set<members::rev>;
2398 type Time = S::Time;
2399 }
2400 pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>);
2402 impl<S: State> sealed::Sealed for SetTime<S> {}
2403 impl<S: State> State for SetTime<S> {
2404 type Seq = S::Seq;
2405 type Did = S::Did;
2406 type Blocks = S::Blocks;
2407 type Rev = S::Rev;
2408 type Time = Set<members::time>;
2409 }
2410 #[allow(non_camel_case_types)]
2412 pub mod members {
2413 pub struct seq(());
2415 pub struct did(());
2417 pub struct blocks(());
2419 pub struct rev(());
2421 pub struct time(());
2423 }
2424}
2425
2426pub struct SyncBuilder<'a, S: sync_state::State> {
2428 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
2429 __unsafe_private_named: (
2430 ::core::option::Option<bytes::Bytes>,
2431 ::core::option::Option<jacquard_common::types::string::Did<'a>>,
2432 ::core::option::Option<jacquard_common::CowStr<'a>>,
2433 ::core::option::Option<i64>,
2434 ::core::option::Option<jacquard_common::types::string::Datetime>,
2435 ),
2436 _phantom: ::core::marker::PhantomData<&'a ()>,
2437}
2438
2439impl<'a> Sync<'a> {
2440 pub fn new() -> SyncBuilder<'a, sync_state::Empty> {
2442 SyncBuilder::new()
2443 }
2444}
2445
2446impl<'a> SyncBuilder<'a, sync_state::Empty> {
2447 pub fn new() -> Self {
2449 SyncBuilder {
2450 _phantom_state: ::core::marker::PhantomData,
2451 __unsafe_private_named: (None, None, None, None, None),
2452 _phantom: ::core::marker::PhantomData,
2453 }
2454 }
2455}
2456
2457impl<'a, S> SyncBuilder<'a, S>
2458where
2459 S: sync_state::State,
2460 S::Blocks: sync_state::IsUnset,
2461{
2462 pub fn blocks(
2464 mut self,
2465 value: impl Into<bytes::Bytes>,
2466 ) -> SyncBuilder<'a, sync_state::SetBlocks<S>> {
2467 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
2468 SyncBuilder {
2469 _phantom_state: ::core::marker::PhantomData,
2470 __unsafe_private_named: self.__unsafe_private_named,
2471 _phantom: ::core::marker::PhantomData,
2472 }
2473 }
2474}
2475
2476impl<'a, S> SyncBuilder<'a, S>
2477where
2478 S: sync_state::State,
2479 S::Did: sync_state::IsUnset,
2480{
2481 pub fn did(
2483 mut self,
2484 value: impl Into<jacquard_common::types::string::Did<'a>>,
2485 ) -> SyncBuilder<'a, sync_state::SetDid<S>> {
2486 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
2487 SyncBuilder {
2488 _phantom_state: ::core::marker::PhantomData,
2489 __unsafe_private_named: self.__unsafe_private_named,
2490 _phantom: ::core::marker::PhantomData,
2491 }
2492 }
2493}
2494
2495impl<'a, S> SyncBuilder<'a, S>
2496where
2497 S: sync_state::State,
2498 S::Rev: sync_state::IsUnset,
2499{
2500 pub fn rev(
2502 mut self,
2503 value: impl Into<jacquard_common::CowStr<'a>>,
2504 ) -> SyncBuilder<'a, sync_state::SetRev<S>> {
2505 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
2506 SyncBuilder {
2507 _phantom_state: ::core::marker::PhantomData,
2508 __unsafe_private_named: self.__unsafe_private_named,
2509 _phantom: ::core::marker::PhantomData,
2510 }
2511 }
2512}
2513
2514impl<'a, S> SyncBuilder<'a, S>
2515where
2516 S: sync_state::State,
2517 S::Seq: sync_state::IsUnset,
2518{
2519 pub fn seq(
2521 mut self,
2522 value: impl Into<i64>,
2523 ) -> SyncBuilder<'a, sync_state::SetSeq<S>> {
2524 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
2525 SyncBuilder {
2526 _phantom_state: ::core::marker::PhantomData,
2527 __unsafe_private_named: self.__unsafe_private_named,
2528 _phantom: ::core::marker::PhantomData,
2529 }
2530 }
2531}
2532
2533impl<'a, S> SyncBuilder<'a, S>
2534where
2535 S: sync_state::State,
2536 S::Time: sync_state::IsUnset,
2537{
2538 pub fn time(
2540 mut self,
2541 value: impl Into<jacquard_common::types::string::Datetime>,
2542 ) -> SyncBuilder<'a, sync_state::SetTime<S>> {
2543 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
2544 SyncBuilder {
2545 _phantom_state: ::core::marker::PhantomData,
2546 __unsafe_private_named: self.__unsafe_private_named,
2547 _phantom: ::core::marker::PhantomData,
2548 }
2549 }
2550}
2551
2552impl<'a, S> SyncBuilder<'a, S>
2553where
2554 S: sync_state::State,
2555 S::Seq: sync_state::IsSet,
2556 S::Did: sync_state::IsSet,
2557 S::Blocks: sync_state::IsSet,
2558 S::Rev: sync_state::IsSet,
2559 S::Time: sync_state::IsSet,
2560{
2561 pub fn build(self) -> Sync<'a> {
2563 Sync {
2564 blocks: self.__unsafe_private_named.0.unwrap(),
2565 did: self.__unsafe_private_named.1.unwrap(),
2566 rev: self.__unsafe_private_named.2.unwrap(),
2567 seq: self.__unsafe_private_named.3.unwrap(),
2568 time: self.__unsafe_private_named.4.unwrap(),
2569 extra_data: Default::default(),
2570 }
2571 }
2572 pub fn build_with_data(
2574 self,
2575 extra_data: std::collections::BTreeMap<
2576 jacquard_common::smol_str::SmolStr,
2577 jacquard_common::types::value::Data<'a>,
2578 >,
2579 ) -> Sync<'a> {
2580 Sync {
2581 blocks: self.__unsafe_private_named.0.unwrap(),
2582 did: self.__unsafe_private_named.1.unwrap(),
2583 rev: self.__unsafe_private_named.2.unwrap(),
2584 seq: self.__unsafe_private_named.3.unwrap(),
2585 time: self.__unsafe_private_named.4.unwrap(),
2586 extra_data: Some(extra_data),
2587 }
2588 }
2589}
2590
2591impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Sync<'a> {
2592 fn nsid() -> &'static str {
2593 "com.atproto.sync.subscribeRepos"
2594 }
2595 fn def_name() -> &'static str {
2596 "sync"
2597 }
2598 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
2599 lexicon_doc_com_atproto_sync_subscribeRepos()
2600 }
2601 fn validate(
2602 &self,
2603 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
2604 Ok(())
2605 }
2606}