1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: buzz.bookhive.searchBooks
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[derive(
9 serde::Serialize,
10 serde::Deserialize,
11 Debug,
12 Clone,
13 PartialEq,
14 Eq,
15 bon::Builder,
16 jacquard_derive::IntoStatic
17)]
18#[builder(start_fn = new)]
19#[serde(rename_all = "camelCase")]
20pub struct SearchBooks<'a> {
21 #[serde(skip_serializing_if = "std::option::Option::is_none")]
22 #[serde(borrow)]
23 #[builder(into)]
24 pub id: std::option::Option<jacquard_common::CowStr<'a>>,
25 ///(default: 25, min: 1, max: 100)
26 #[serde(skip_serializing_if = "std::option::Option::is_none")]
27 pub limit: std::option::Option<i64>,
28 #[serde(skip_serializing_if = "std::option::Option::is_none")]
29 pub offset: std::option::Option<i64>,
30 #[serde(borrow)]
31 #[builder(into)]
32 pub q: jacquard_common::CowStr<'a>,
33}
34
35#[jacquard_derive::lexicon]
36#[derive(
37 serde::Serialize,
38 serde::Deserialize,
39 Debug,
40 Clone,
41 PartialEq,
42 Eq,
43 jacquard_derive::IntoStatic
44)]
45#[serde(rename_all = "camelCase")]
46pub struct SearchBooksOutput<'a> {
47 #[serde(borrow)]
48 pub books: Vec<jacquard_common::types::value::Data<'a>>,
49 /// The next offset to use for pagination (result of limit + offset)
50 #[serde(skip_serializing_if = "std::option::Option::is_none")]
51 pub offset: std::option::Option<i64>,
52}
53
54///Response type for
55///buzz.bookhive.searchBooks
56pub struct SearchBooksResponse;
57impl jacquard_common::xrpc::XrpcResp for SearchBooksResponse {
58 const NSID: &'static str = "buzz.bookhive.searchBooks";
59 const ENCODING: &'static str = "application/json";
60 type Output<'de> = SearchBooksOutput<'de>;
61 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
62}
63
64impl<'a> jacquard_common::xrpc::XrpcRequest for SearchBooks<'a> {
65 const NSID: &'static str = "buzz.bookhive.searchBooks";
66 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
67 type Response = SearchBooksResponse;
68}
69
70///Endpoint type for
71///buzz.bookhive.searchBooks
72pub struct SearchBooksRequest;
73impl jacquard_common::xrpc::XrpcEndpoint for SearchBooksRequest {
74 const PATH: &'static str = "/xrpc/buzz.bookhive.searchBooks";
75 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
76 type Request<'de> = SearchBooks<'de>;
77 type Response = SearchBooksResponse;
78}