1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: network.slices.lexicon
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)]
18#[serde(rename_all = "camelCase")]
19pub struct Lexicon<'a> {
20 ///When the lexicon was created
21 pub created_at: jacquard_common::types::string::Datetime,
22 ///The lexicon schema definitions as JSON
23 #[serde(borrow)]
24 pub definitions: jacquard_common::CowStr<'a>,
25 ///Human-readable description of the lexicon
26 #[serde(skip_serializing_if = "std::option::Option::is_none")]
27 #[serde(borrow)]
28 pub description: std::option::Option<jacquard_common::CowStr<'a>>,
29 ///Whether this lexicon should be excluded from sync operations
30 #[serde(skip_serializing_if = "std::option::Option::is_none")]
31 pub excluded_from_sync: std::option::Option<bool>,
32 ///Namespaced identifier for the lexicon
33 #[serde(borrow)]
34 pub nsid: jacquard_common::CowStr<'a>,
35 ///AT-URI reference to the slice this lexicon belongs to
36 #[serde(borrow)]
37 pub slice: jacquard_common::types::string::AtUri<'a>,
38 ///When the lexicon was last updated
39 #[serde(skip_serializing_if = "std::option::Option::is_none")]
40 pub updated_at: std::option::Option<jacquard_common::types::string::Datetime>,
41}
42
43/// Typed wrapper for GetRecord response with this collection's record type.
44#[derive(
45 serde::Serialize,
46 serde::Deserialize,
47 Debug,
48 Clone,
49 PartialEq,
50 Eq,
51 jacquard_derive::IntoStatic
52)]
53#[serde(rename_all = "camelCase")]
54pub struct LexiconGetRecordOutput<'a> {
55 #[serde(skip_serializing_if = "std::option::Option::is_none")]
56 #[serde(borrow)]
57 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
58 #[serde(borrow)]
59 pub uri: jacquard_common::types::string::AtUri<'a>,
60 #[serde(borrow)]
61 pub value: Lexicon<'a>,
62}
63
64/// Marker type for deserializing records from this collection.
65pub struct LexiconRecord;
66impl jacquard_common::xrpc::XrpcResp for LexiconRecord {
67 const NSID: &'static str = "network.slices.lexicon";
68 const ENCODING: &'static str = "application/json";
69 type Output<'de> = LexiconGetRecordOutput<'de>;
70 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
71}
72
73impl jacquard_common::types::collection::Collection for Lexicon<'_> {
74 const NSID: &'static str = "network.slices.lexicon";
75 type Record = LexiconRecord;
76}
77
78impl From<LexiconGetRecordOutput<'_>> for Lexicon<'_> {
79 fn from(output: LexiconGetRecordOutput<'_>) -> Self {
80 use jacquard_common::IntoStatic;
81 output.value.into_static()
82 }
83}