atproto blogging
1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.feed.threadgate
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8/// Allow replies from actors who follow you.
9#[jacquard_derive::lexicon]
10#[derive(
11 serde::Serialize,
12 serde::Deserialize,
13 Debug,
14 Clone,
15 PartialEq,
16 Eq,
17 jacquard_derive::IntoStatic,
18 Default
19)]
20#[serde(rename_all = "camelCase")]
21pub struct FollowerRule<'a> {}
22fn lexicon_doc_app_bsky_feed_threadgate() -> ::jacquard_lexicon::lexicon::LexiconDoc<
23 'static,
24> {
25 ::jacquard_lexicon::lexicon::LexiconDoc {
26 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
27 id: ::jacquard_common::CowStr::new_static("app.bsky.feed.threadgate"),
28 revision: None,
29 description: None,
30 defs: {
31 let mut map = ::alloc::collections::BTreeMap::new();
32 map.insert(
33 ::jacquard_common::smol_str::SmolStr::new_static("followerRule"),
34 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
35 description: Some(
36 ::jacquard_common::CowStr::new_static(
37 "Allow replies from actors who follow you.",
38 ),
39 ),
40 required: None,
41 nullable: None,
42 properties: {
43 #[allow(unused_mut)]
44 let mut map = ::alloc::collections::BTreeMap::new();
45 map
46 },
47 }),
48 );
49 map.insert(
50 ::jacquard_common::smol_str::SmolStr::new_static("followingRule"),
51 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
52 description: Some(
53 ::jacquard_common::CowStr::new_static(
54 "Allow replies from actors you follow.",
55 ),
56 ),
57 required: None,
58 nullable: None,
59 properties: {
60 #[allow(unused_mut)]
61 let mut map = ::alloc::collections::BTreeMap::new();
62 map
63 },
64 }),
65 );
66 map.insert(
67 ::jacquard_common::smol_str::SmolStr::new_static("listRule"),
68 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
69 description: Some(
70 ::jacquard_common::CowStr::new_static(
71 "Allow replies from actors on a list.",
72 ),
73 ),
74 required: Some(
75 vec![::jacquard_common::smol_str::SmolStr::new_static("list")],
76 ),
77 nullable: None,
78 properties: {
79 #[allow(unused_mut)]
80 let mut map = ::alloc::collections::BTreeMap::new();
81 map.insert(
82 ::jacquard_common::smol_str::SmolStr::new_static("list"),
83 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
84 description: None,
85 format: Some(
86 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
87 ),
88 default: None,
89 min_length: None,
90 max_length: None,
91 min_graphemes: None,
92 max_graphemes: None,
93 r#enum: None,
94 r#const: None,
95 known_values: None,
96 }),
97 );
98 map
99 },
100 }),
101 );
102 map.insert(
103 ::jacquard_common::smol_str::SmolStr::new_static("main"),
104 ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
105 description: Some(
106 ::jacquard_common::CowStr::new_static(
107 "Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.",
108 ),
109 ),
110 key: Some(::jacquard_common::CowStr::new_static("tid")),
111 record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
112 description: None,
113 required: Some(
114 vec![
115 ::jacquard_common::smol_str::SmolStr::new_static("post"),
116 ::jacquard_common::smol_str::SmolStr::new_static("createdAt")
117 ],
118 ),
119 nullable: None,
120 properties: {
121 #[allow(unused_mut)]
122 let mut map = ::alloc::collections::BTreeMap::new();
123 map.insert(
124 ::jacquard_common::smol_str::SmolStr::new_static("allow"),
125 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
126 description: Some(
127 ::jacquard_common::CowStr::new_static(
128 "List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply.",
129 ),
130 ),
131 items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion {
132 description: None,
133 refs: vec![
134 ::jacquard_common::CowStr::new_static("#mentionRule"),
135 ::jacquard_common::CowStr::new_static("#followerRule"),
136 ::jacquard_common::CowStr::new_static("#followingRule"),
137 ::jacquard_common::CowStr::new_static("#listRule")
138 ],
139 closed: None,
140 }),
141 min_length: None,
142 max_length: Some(5usize),
143 }),
144 );
145 map.insert(
146 ::jacquard_common::smol_str::SmolStr::new_static(
147 "createdAt",
148 ),
149 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
150 description: None,
151 format: Some(
152 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
153 ),
154 default: None,
155 min_length: None,
156 max_length: None,
157 min_graphemes: None,
158 max_graphemes: None,
159 r#enum: None,
160 r#const: None,
161 known_values: None,
162 }),
163 );
164 map.insert(
165 ::jacquard_common::smol_str::SmolStr::new_static(
166 "hiddenReplies",
167 ),
168 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
169 description: Some(
170 ::jacquard_common::CowStr::new_static(
171 "List of hidden reply URIs.",
172 ),
173 ),
174 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
175 description: None,
176 format: Some(
177 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
178 ),
179 default: None,
180 min_length: None,
181 max_length: None,
182 min_graphemes: None,
183 max_graphemes: None,
184 r#enum: None,
185 r#const: None,
186 known_values: None,
187 }),
188 min_length: None,
189 max_length: Some(300usize),
190 }),
191 );
192 map.insert(
193 ::jacquard_common::smol_str::SmolStr::new_static("post"),
194 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
195 description: Some(
196 ::jacquard_common::CowStr::new_static(
197 "Reference (AT-URI) to the post record.",
198 ),
199 ),
200 format: Some(
201 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
202 ),
203 default: None,
204 min_length: None,
205 max_length: None,
206 min_graphemes: None,
207 max_graphemes: None,
208 r#enum: None,
209 r#const: None,
210 known_values: None,
211 }),
212 );
213 map
214 },
215 }),
216 }),
217 );
218 map.insert(
219 ::jacquard_common::smol_str::SmolStr::new_static("mentionRule"),
220 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
221 description: Some(
222 ::jacquard_common::CowStr::new_static(
223 "Allow replies from actors mentioned in your post.",
224 ),
225 ),
226 required: None,
227 nullable: None,
228 properties: {
229 #[allow(unused_mut)]
230 let mut map = ::alloc::collections::BTreeMap::new();
231 map
232 },
233 }),
234 );
235 map
236 },
237 }
238}
239
240impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FollowerRule<'a> {
241 fn nsid() -> &'static str {
242 "app.bsky.feed.threadgate"
243 }
244 fn def_name() -> &'static str {
245 "followerRule"
246 }
247 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
248 lexicon_doc_app_bsky_feed_threadgate()
249 }
250 fn validate(
251 &self,
252 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
253 Ok(())
254 }
255}
256
257/// Allow replies from actors you follow.
258#[jacquard_derive::lexicon]
259#[derive(
260 serde::Serialize,
261 serde::Deserialize,
262 Debug,
263 Clone,
264 PartialEq,
265 Eq,
266 jacquard_derive::IntoStatic,
267 Default
268)]
269#[serde(rename_all = "camelCase")]
270pub struct FollowingRule<'a> {}
271impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FollowingRule<'a> {
272 fn nsid() -> &'static str {
273 "app.bsky.feed.threadgate"
274 }
275 fn def_name() -> &'static str {
276 "followingRule"
277 }
278 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
279 lexicon_doc_app_bsky_feed_threadgate()
280 }
281 fn validate(
282 &self,
283 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
284 Ok(())
285 }
286}
287
288/// Allow replies from actors on a list.
289#[jacquard_derive::lexicon]
290#[derive(
291 serde::Serialize,
292 serde::Deserialize,
293 Debug,
294 Clone,
295 PartialEq,
296 Eq,
297 jacquard_derive::IntoStatic
298)]
299#[serde(rename_all = "camelCase")]
300pub struct ListRule<'a> {
301 #[serde(borrow)]
302 pub list: jacquard_common::types::string::AtUri<'a>,
303}
304
305pub mod list_rule_state {
306
307 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
308 #[allow(unused)]
309 use ::core::marker::PhantomData;
310 mod sealed {
311 pub trait Sealed {}
312 }
313 /// State trait tracking which required fields have been set
314 pub trait State: sealed::Sealed {
315 type List;
316 }
317 /// Empty state - all required fields are unset
318 pub struct Empty(());
319 impl sealed::Sealed for Empty {}
320 impl State for Empty {
321 type List = Unset;
322 }
323 ///State transition - sets the `list` field to Set
324 pub struct SetList<S: State = Empty>(PhantomData<fn() -> S>);
325 impl<S: State> sealed::Sealed for SetList<S> {}
326 impl<S: State> State for SetList<S> {
327 type List = Set<members::list>;
328 }
329 /// Marker types for field names
330 #[allow(non_camel_case_types)]
331 pub mod members {
332 ///Marker type for the `list` field
333 pub struct list(());
334 }
335}
336
337/// Builder for constructing an instance of this type
338pub struct ListRuleBuilder<'a, S: list_rule_state::State> {
339 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
340 __unsafe_private_named: (
341 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
342 ),
343 _phantom: ::core::marker::PhantomData<&'a ()>,
344}
345
346impl<'a> ListRule<'a> {
347 /// Create a new builder for this type
348 pub fn new() -> ListRuleBuilder<'a, list_rule_state::Empty> {
349 ListRuleBuilder::new()
350 }
351}
352
353impl<'a> ListRuleBuilder<'a, list_rule_state::Empty> {
354 /// Create a new builder with all fields unset
355 pub fn new() -> Self {
356 ListRuleBuilder {
357 _phantom_state: ::core::marker::PhantomData,
358 __unsafe_private_named: (None,),
359 _phantom: ::core::marker::PhantomData,
360 }
361 }
362}
363
364impl<'a, S> ListRuleBuilder<'a, S>
365where
366 S: list_rule_state::State,
367 S::List: list_rule_state::IsUnset,
368{
369 /// Set the `list` field (required)
370 pub fn list(
371 mut self,
372 value: impl Into<jacquard_common::types::string::AtUri<'a>>,
373 ) -> ListRuleBuilder<'a, list_rule_state::SetList<S>> {
374 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
375 ListRuleBuilder {
376 _phantom_state: ::core::marker::PhantomData,
377 __unsafe_private_named: self.__unsafe_private_named,
378 _phantom: ::core::marker::PhantomData,
379 }
380 }
381}
382
383impl<'a, S> ListRuleBuilder<'a, S>
384where
385 S: list_rule_state::State,
386 S::List: list_rule_state::IsSet,
387{
388 /// Build the final struct
389 pub fn build(self) -> ListRule<'a> {
390 ListRule {
391 list: self.__unsafe_private_named.0.unwrap(),
392 extra_data: Default::default(),
393 }
394 }
395 /// Build the final struct with custom extra_data
396 pub fn build_with_data(
397 self,
398 extra_data: std::collections::BTreeMap<
399 jacquard_common::smol_str::SmolStr,
400 jacquard_common::types::value::Data<'a>,
401 >,
402 ) -> ListRule<'a> {
403 ListRule {
404 list: self.__unsafe_private_named.0.unwrap(),
405 extra_data: Some(extra_data),
406 }
407 }
408}
409
410impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ListRule<'a> {
411 fn nsid() -> &'static str {
412 "app.bsky.feed.threadgate"
413 }
414 fn def_name() -> &'static str {
415 "listRule"
416 }
417 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
418 lexicon_doc_app_bsky_feed_threadgate()
419 }
420 fn validate(
421 &self,
422 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
423 Ok(())
424 }
425}
426
427/// Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.
428#[jacquard_derive::lexicon]
429#[derive(
430 serde::Serialize,
431 serde::Deserialize,
432 Debug,
433 Clone,
434 PartialEq,
435 Eq,
436 jacquard_derive::IntoStatic
437)]
438#[serde(rename_all = "camelCase")]
439pub struct Threadgate<'a> {
440 /// List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply.
441 #[serde(skip_serializing_if = "std::option::Option::is_none")]
442 #[serde(borrow)]
443 pub allow: std::option::Option<Vec<ThreadgateAllowItem<'a>>>,
444 pub created_at: jacquard_common::types::string::Datetime,
445 /// List of hidden reply URIs.
446 #[serde(skip_serializing_if = "std::option::Option::is_none")]
447 #[serde(borrow)]
448 pub hidden_replies: std::option::Option<
449 Vec<jacquard_common::types::string::AtUri<'a>>,
450 >,
451 /// Reference (AT-URI) to the post record.
452 #[serde(borrow)]
453 pub post: jacquard_common::types::string::AtUri<'a>,
454}
455
456pub mod threadgate_state {
457
458 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
459 #[allow(unused)]
460 use ::core::marker::PhantomData;
461 mod sealed {
462 pub trait Sealed {}
463 }
464 /// State trait tracking which required fields have been set
465 pub trait State: sealed::Sealed {
466 type CreatedAt;
467 type Post;
468 }
469 /// Empty state - all required fields are unset
470 pub struct Empty(());
471 impl sealed::Sealed for Empty {}
472 impl State for Empty {
473 type CreatedAt = Unset;
474 type Post = Unset;
475 }
476 ///State transition - sets the `created_at` field to Set
477 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
478 impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
479 impl<S: State> State for SetCreatedAt<S> {
480 type CreatedAt = Set<members::created_at>;
481 type Post = S::Post;
482 }
483 ///State transition - sets the `post` field to Set
484 pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>);
485 impl<S: State> sealed::Sealed for SetPost<S> {}
486 impl<S: State> State for SetPost<S> {
487 type CreatedAt = S::CreatedAt;
488 type Post = Set<members::post>;
489 }
490 /// Marker types for field names
491 #[allow(non_camel_case_types)]
492 pub mod members {
493 ///Marker type for the `created_at` field
494 pub struct created_at(());
495 ///Marker type for the `post` field
496 pub struct post(());
497 }
498}
499
500/// Builder for constructing an instance of this type
501pub struct ThreadgateBuilder<'a, S: threadgate_state::State> {
502 _phantom_state: ::core::marker::PhantomData<fn() -> S>,
503 __unsafe_private_named: (
504 ::core::option::Option<Vec<ThreadgateAllowItem<'a>>>,
505 ::core::option::Option<jacquard_common::types::string::Datetime>,
506 ::core::option::Option<Vec<jacquard_common::types::string::AtUri<'a>>>,
507 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
508 ),
509 _phantom: ::core::marker::PhantomData<&'a ()>,
510}
511
512impl<'a> Threadgate<'a> {
513 /// Create a new builder for this type
514 pub fn new() -> ThreadgateBuilder<'a, threadgate_state::Empty> {
515 ThreadgateBuilder::new()
516 }
517}
518
519impl<'a> ThreadgateBuilder<'a, threadgate_state::Empty> {
520 /// Create a new builder with all fields unset
521 pub fn new() -> Self {
522 ThreadgateBuilder {
523 _phantom_state: ::core::marker::PhantomData,
524 __unsafe_private_named: (None, None, None, None),
525 _phantom: ::core::marker::PhantomData,
526 }
527 }
528}
529
530impl<'a, S: threadgate_state::State> ThreadgateBuilder<'a, S> {
531 /// Set the `allow` field (optional)
532 pub fn allow(
533 mut self,
534 value: impl Into<Option<Vec<ThreadgateAllowItem<'a>>>>,
535 ) -> Self {
536 self.__unsafe_private_named.0 = value.into();
537 self
538 }
539 /// Set the `allow` field to an Option value (optional)
540 pub fn maybe_allow(mut self, value: Option<Vec<ThreadgateAllowItem<'a>>>) -> Self {
541 self.__unsafe_private_named.0 = value;
542 self
543 }
544}
545
546impl<'a, S> ThreadgateBuilder<'a, S>
547where
548 S: threadgate_state::State,
549 S::CreatedAt: threadgate_state::IsUnset,
550{
551 /// Set the `createdAt` field (required)
552 pub fn created_at(
553 mut self,
554 value: impl Into<jacquard_common::types::string::Datetime>,
555 ) -> ThreadgateBuilder<'a, threadgate_state::SetCreatedAt<S>> {
556 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
557 ThreadgateBuilder {
558 _phantom_state: ::core::marker::PhantomData,
559 __unsafe_private_named: self.__unsafe_private_named,
560 _phantom: ::core::marker::PhantomData,
561 }
562 }
563}
564
565impl<'a, S: threadgate_state::State> ThreadgateBuilder<'a, S> {
566 /// Set the `hiddenReplies` field (optional)
567 pub fn hidden_replies(
568 mut self,
569 value: impl Into<Option<Vec<jacquard_common::types::string::AtUri<'a>>>>,
570 ) -> Self {
571 self.__unsafe_private_named.2 = value.into();
572 self
573 }
574 /// Set the `hiddenReplies` field to an Option value (optional)
575 pub fn maybe_hidden_replies(
576 mut self,
577 value: Option<Vec<jacquard_common::types::string::AtUri<'a>>>,
578 ) -> Self {
579 self.__unsafe_private_named.2 = value;
580 self
581 }
582}
583
584impl<'a, S> ThreadgateBuilder<'a, S>
585where
586 S: threadgate_state::State,
587 S::Post: threadgate_state::IsUnset,
588{
589 /// Set the `post` field (required)
590 pub fn post(
591 mut self,
592 value: impl Into<jacquard_common::types::string::AtUri<'a>>,
593 ) -> ThreadgateBuilder<'a, threadgate_state::SetPost<S>> {
594 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
595 ThreadgateBuilder {
596 _phantom_state: ::core::marker::PhantomData,
597 __unsafe_private_named: self.__unsafe_private_named,
598 _phantom: ::core::marker::PhantomData,
599 }
600 }
601}
602
603impl<'a, S> ThreadgateBuilder<'a, S>
604where
605 S: threadgate_state::State,
606 S::CreatedAt: threadgate_state::IsSet,
607 S::Post: threadgate_state::IsSet,
608{
609 /// Build the final struct
610 pub fn build(self) -> Threadgate<'a> {
611 Threadgate {
612 allow: self.__unsafe_private_named.0,
613 created_at: self.__unsafe_private_named.1.unwrap(),
614 hidden_replies: self.__unsafe_private_named.2,
615 post: self.__unsafe_private_named.3.unwrap(),
616 extra_data: Default::default(),
617 }
618 }
619 /// Build the final struct with custom extra_data
620 pub fn build_with_data(
621 self,
622 extra_data: std::collections::BTreeMap<
623 jacquard_common::smol_str::SmolStr,
624 jacquard_common::types::value::Data<'a>,
625 >,
626 ) -> Threadgate<'a> {
627 Threadgate {
628 allow: self.__unsafe_private_named.0,
629 created_at: self.__unsafe_private_named.1.unwrap(),
630 hidden_replies: self.__unsafe_private_named.2,
631 post: self.__unsafe_private_named.3.unwrap(),
632 extra_data: Some(extra_data),
633 }
634 }
635}
636
637impl<'a> Threadgate<'a> {
638 pub fn uri(
639 uri: impl Into<jacquard_common::CowStr<'a>>,
640 ) -> Result<
641 jacquard_common::types::uri::RecordUri<'a, ThreadgateRecord>,
642 jacquard_common::types::uri::UriError,
643 > {
644 jacquard_common::types::uri::RecordUri::try_from_uri(
645 jacquard_common::types::string::AtUri::new_cow(uri.into())?,
646 )
647 }
648}
649
650#[jacquard_derive::open_union]
651#[derive(
652 serde::Serialize,
653 serde::Deserialize,
654 Debug,
655 Clone,
656 PartialEq,
657 Eq,
658 jacquard_derive::IntoStatic
659)]
660#[serde(tag = "$type")]
661#[serde(bound(deserialize = "'de: 'a"))]
662pub enum ThreadgateAllowItem<'a> {
663 #[serde(rename = "app.bsky.feed.threadgate#mentionRule")]
664 MentionRule(Box<crate::app_bsky::feed::threadgate::MentionRule<'a>>),
665 #[serde(rename = "app.bsky.feed.threadgate#followerRule")]
666 FollowerRule(Box<crate::app_bsky::feed::threadgate::FollowerRule<'a>>),
667 #[serde(rename = "app.bsky.feed.threadgate#followingRule")]
668 FollowingRule(Box<crate::app_bsky::feed::threadgate::FollowingRule<'a>>),
669 #[serde(rename = "app.bsky.feed.threadgate#listRule")]
670 ListRule(Box<crate::app_bsky::feed::threadgate::ListRule<'a>>),
671}
672
673/// Typed wrapper for GetRecord response with this collection's record type.
674#[derive(
675 serde::Serialize,
676 serde::Deserialize,
677 Debug,
678 Clone,
679 PartialEq,
680 Eq,
681 jacquard_derive::IntoStatic
682)]
683#[serde(rename_all = "camelCase")]
684pub struct ThreadgateGetRecordOutput<'a> {
685 #[serde(skip_serializing_if = "std::option::Option::is_none")]
686 #[serde(borrow)]
687 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
688 #[serde(borrow)]
689 pub uri: jacquard_common::types::string::AtUri<'a>,
690 #[serde(borrow)]
691 pub value: Threadgate<'a>,
692}
693
694impl From<ThreadgateGetRecordOutput<'_>> for Threadgate<'_> {
695 fn from(output: ThreadgateGetRecordOutput<'_>) -> Self {
696 use jacquard_common::IntoStatic;
697 output.value.into_static()
698 }
699}
700
701impl jacquard_common::types::collection::Collection for Threadgate<'_> {
702 const NSID: &'static str = "app.bsky.feed.threadgate";
703 type Record = ThreadgateRecord;
704}
705
706/// Marker type for deserializing records from this collection.
707#[derive(Debug, serde::Serialize, serde::Deserialize)]
708pub struct ThreadgateRecord;
709impl jacquard_common::xrpc::XrpcResp for ThreadgateRecord {
710 const NSID: &'static str = "app.bsky.feed.threadgate";
711 const ENCODING: &'static str = "application/json";
712 type Output<'de> = ThreadgateGetRecordOutput<'de>;
713 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
714}
715
716impl jacquard_common::types::collection::Collection for ThreadgateRecord {
717 const NSID: &'static str = "app.bsky.feed.threadgate";
718 type Record = ThreadgateRecord;
719}
720
721impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Threadgate<'a> {
722 fn nsid() -> &'static str {
723 "app.bsky.feed.threadgate"
724 }
725 fn def_name() -> &'static str {
726 "main"
727 }
728 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
729 lexicon_doc_app_bsky_feed_threadgate()
730 }
731 fn validate(
732 &self,
733 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
734 if let Some(ref value) = self.allow {
735 #[allow(unused_comparisons)]
736 if value.len() > 5usize {
737 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
738 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
739 "allow",
740 ),
741 max: 5usize,
742 actual: value.len(),
743 });
744 }
745 }
746 if let Some(ref value) = self.hidden_replies {
747 #[allow(unused_comparisons)]
748 if value.len() > 300usize {
749 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
750 path: ::jacquard_lexicon::validation::ValidationPath::from_field(
751 "hidden_replies",
752 ),
753 max: 300usize,
754 actual: value.len(),
755 });
756 }
757 }
758 Ok(())
759 }
760}
761
762/// Allow replies from actors mentioned in your post.
763#[jacquard_derive::lexicon]
764#[derive(
765 serde::Serialize,
766 serde::Deserialize,
767 Debug,
768 Clone,
769 PartialEq,
770 Eq,
771 jacquard_derive::IntoStatic,
772 Default
773)]
774#[serde(rename_all = "camelCase")]
775pub struct MentionRule<'a> {}
776impl<'a> ::jacquard_lexicon::schema::LexiconSchema for MentionRule<'a> {
777 fn nsid() -> &'static str {
778 "app.bsky.feed.threadgate"
779 }
780 fn def_name() -> &'static str {
781 "mentionRule"
782 }
783 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
784 lexicon_doc_app_bsky_feed_threadgate()
785 }
786 fn validate(
787 &self,
788 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
789 Ok(())
790 }
791}