1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: blue.rito.service.getSchema
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 Langs<'a> {
20 #[serde(skip_serializing_if = "std::option::Option::is_none")]
21 #[serde(borrow)]
22 pub comment: std::option::Option<jacquard_common::CowStr<'a>>,
23 #[serde(borrow)]
24 pub lang: jacquard_common::CowStr<'a>,
25 #[serde(borrow)]
26 pub moderation: Vec<jacquard_common::CowStr<'a>>,
27 #[serde(borrow)]
28 pub title: jacquard_common::CowStr<'a>,
29}
30
31#[jacquard_derive::lexicon]
32#[derive(
33 serde::Serialize,
34 serde::Deserialize,
35 Debug,
36 Clone,
37 PartialEq,
38 Eq,
39 bon::Builder,
40 jacquard_derive::IntoStatic
41)]
42#[serde(rename_all = "camelCase")]
43#[builder(start_fn = new)]
44pub struct GetSchema<'a> {
45 #[serde(borrow)]
46 #[builder(into)]
47 pub nsid: jacquard_common::CowStr<'a>,
48 #[serde(flatten)]
49 #[serde(borrow)]
50 #[builder(default)]
51 pub extra_data: ::std::collections::BTreeMap<
52 ::jacquard_common::smol_str::SmolStr,
53 ::jacquard_common::types::value::Data<'a>,
54 >,
55}
56
57///Returns the Bookmark data for the given NSID.
58#[jacquard_derive::lexicon]
59#[derive(
60 serde::Serialize,
61 serde::Deserialize,
62 Debug,
63 Clone,
64 PartialEq,
65 Eq,
66 jacquard_derive::IntoStatic
67)]
68#[serde(rename_all = "camelCase")]
69pub struct GetSchemaOutput<'a> {
70 ///Comments with titles, content, and moderation in multiple languages.
71 #[serde(borrow)]
72 pub comments: Vec<crate::blue_rito::service::get_schema::Langs<'a>>,
73 ///Moderation result for OGP title and description
74 #[serde(borrow)]
75 pub moderations: Vec<jacquard_common::CowStr<'a>>,
76 ///Namespace ID of the service or application (e.g., 'uk.skyblur.post').
77 #[serde(borrow)]
78 pub nsid: jacquard_common::CowStr<'a>,
79 ///The Open Graph Protocol (OGP) description for the bookmark.
80 #[serde(skip_serializing_if = "std::option::Option::is_none")]
81 #[serde(borrow)]
82 pub ogp_description: std::option::Option<jacquard_common::CowStr<'a>>,
83 ///The Open Graph Protocol (OGP) image URL for the bookmark.
84 #[serde(skip_serializing_if = "std::option::Option::is_none")]
85 #[serde(borrow)]
86 pub ogp_image: std::option::Option<jacquard_common::types::string::Uri<'a>>,
87 ///The Open Graph Protocol (OGP) title for the bookmark.
88 #[serde(skip_serializing_if = "std::option::Option::is_none")]
89 #[serde(borrow)]
90 pub ogp_title: std::option::Option<jacquard_common::CowStr<'a>>,
91 ///The schema URL pattern associated with this NSID (e.g., 'https://skyblur.uk/post/{did}/{rkey}').
92 #[serde(borrow)]
93 pub schema: jacquard_common::CowStr<'a>,
94 ///This field contains tags. If registered by the owner, it may include 'Verified'.
95 #[serde(skip_serializing_if = "std::option::Option::is_none")]
96 #[serde(borrow)]
97 pub tags: std::option::Option<Vec<jacquard_common::CowStr<'a>>>,
98 ///If this comment registed by owner, this field should be true.
99 pub verified: bool,
100}
101
102///Response type for
103///blue.rito.service.getSchema
104pub struct GetSchemaResponse;
105impl jacquard_common::xrpc::XrpcResp for GetSchemaResponse {
106 const NSID: &'static str = "blue.rito.service.getSchema";
107 const ENCODING: &'static str = "application/json";
108 type Output<'de> = GetSchemaOutput<'de>;
109 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
110}
111
112impl<'de> jacquard_common::xrpc::XrpcRequest<'de> for GetSchema<'de> {
113 const NSID: &'static str = "blue.rito.service.getSchema";
114 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
115 "application/json",
116 );
117 type Response = GetSchemaResponse;
118}
119
120///Endpoint type for
121///blue.rito.service.getSchema
122pub struct GetSchemaRequest;
123impl jacquard_common::xrpc::XrpcEndpoint for GetSchemaRequest {
124 const PATH: &'static str = "/xrpc/blue.rito.service.getSchema";
125 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
126 "application/json",
127 );
128 type Request<'de> = GetSchema<'de>;
129 type Response = GetSchemaResponse;
130}