1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.weaver.edit.diff
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8/// An edit record for a notebook.
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 bon::Builder
19)]
20#[serde(rename_all = "camelCase")]
21pub struct Diff<'a> {
22 #[serde(borrow)]
23 pub doc: crate::sh_weaver::edit::DocRef<'a>,
24 #[serde(borrow)]
25 pub root: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
26 #[serde(borrow)]
27 pub snapshot: jacquard_common::types::blob::Blob<'a>,
28}
29
30/// Typed wrapper for GetRecord response with this collection's record type.
31#[derive(
32 serde::Serialize,
33 serde::Deserialize,
34 Debug,
35 Clone,
36 PartialEq,
37 Eq,
38 jacquard_derive::IntoStatic
39)]
40#[serde(rename_all = "camelCase")]
41pub struct DiffGetRecordOutput<'a> {
42 #[serde(skip_serializing_if = "std::option::Option::is_none")]
43 #[serde(borrow)]
44 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
45 #[serde(borrow)]
46 pub uri: jacquard_common::types::string::AtUri<'a>,
47 #[serde(borrow)]
48 pub value: Diff<'a>,
49}
50
51/// Marker type for deserializing records from this collection.
52pub struct DiffRecord;
53impl jacquard_common::xrpc::XrpcResp for DiffRecord {
54 const NSID: &'static str = "sh.weaver.edit.diff";
55 const ENCODING: &'static str = "application/json";
56 type Output<'de> = DiffGetRecordOutput<'de>;
57 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
58}
59
60impl jacquard_common::types::collection::Collection for Diff<'_> {
61 const NSID: &'static str = "sh.weaver.edit.diff";
62 type Record = DiffRecord;
63}
64
65impl From<DiffGetRecordOutput<'_>> for Diff<'_> {
66 fn from(output: DiffGetRecordOutput<'_>) -> Self {
67 use jacquard_common::IntoStatic;
68 output.value.into_static()
69 }
70}