1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.tangled.string
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[jacquard_derive::lexicon]
9#[derive(
10 serde::Serialize,
11 serde::Deserialize,
12 Debug,
13 Clone,
14 PartialEq,
15 Eq,
16 jacquard_derive::IntoStatic,
17 bon::Builder
18)]
19#[serde(rename_all = "camelCase")]
20pub struct String<'a> {
21 #[serde(borrow)]
22 #[builder(into)]
23 pub contents: jacquard_common::CowStr<'a>,
24 pub created_at: jacquard_common::types::string::Datetime,
25 #[serde(borrow)]
26 #[builder(into)]
27 pub description: jacquard_common::CowStr<'a>,
28 #[serde(borrow)]
29 #[builder(into)]
30 pub filename: jacquard_common::CowStr<'a>,
31}
32
33/// Typed wrapper for GetRecord response with this collection's record type.
34#[derive(
35 serde::Serialize,
36 serde::Deserialize,
37 Debug,
38 Clone,
39 PartialEq,
40 Eq,
41 jacquard_derive::IntoStatic
42)]
43#[serde(rename_all = "camelCase")]
44pub struct StringGetRecordOutput<'a> {
45 #[serde(skip_serializing_if = "std::option::Option::is_none")]
46 #[serde(borrow)]
47 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
48 #[serde(borrow)]
49 pub uri: jacquard_common::types::string::AtUri<'a>,
50 #[serde(borrow)]
51 pub value: String<'a>,
52}
53
54/// Marker type for deserializing records from this collection.
55pub struct StringRecord;
56impl jacquard_common::xrpc::XrpcResp for StringRecord {
57 const NSID: &'static str = "sh.tangled.string";
58 const ENCODING: &'static str = "application/json";
59 type Output<'de> = StringGetRecordOutput<'de>;
60 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
61}
62
63impl jacquard_common::types::collection::Collection for String<'_> {
64 const NSID: &'static str = "sh.tangled.string";
65 type Record = StringRecord;
66}
67
68impl From<StringGetRecordOutput<'_>> for String<'_> {
69 fn from(output: StringGetRecordOutput<'_>) -> Self {
70 use jacquard_common::IntoStatic;
71 output.value.into_static()
72 }
73}