jacquard_api/network_slices/slice/
stats.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: network.slices.slice.stats
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 CollectionStats<'a> {
21    /// Collection NSID
22    #[serde(borrow)]
23    pub collection: jacquard_common::types::string::Nsid<'a>,
24    /// Number of records in this collection
25    pub record_count: i64,
26    /// Number of unique actors with records in this collection
27    pub unique_actors: i64,
28}
29
30#[derive(
31    serde::Serialize,
32    serde::Deserialize,
33    Debug,
34    Clone,
35    PartialEq,
36    Eq,
37    bon::Builder,
38    jacquard_derive::IntoStatic
39)]
40#[builder(start_fn = new)]
41#[serde(rename_all = "camelCase")]
42pub struct Stats<'a> {
43    #[serde(borrow)]
44    #[builder(into)]
45    pub slice: jacquard_common::CowStr<'a>,
46}
47
48#[jacquard_derive::lexicon]
49#[derive(
50    serde::Serialize,
51    serde::Deserialize,
52    Debug,
53    Clone,
54    PartialEq,
55    Eq,
56    jacquard_derive::IntoStatic
57)]
58#[serde(rename_all = "camelCase")]
59pub struct StatsOutput<'a> {
60    /// Per-collection statistics
61    #[serde(borrow)]
62    pub collection_stats: Vec<jacquard_common::types::value::Data<'a>>,
63    /// List of collection NSIDs indexed in this slice
64    #[serde(borrow)]
65    pub collections: Vec<jacquard_common::types::string::Nsid<'a>>,
66    /// Total number of unique actors indexed in this slice
67    pub total_actors: i64,
68    /// Total number of lexicons defined for this slice
69    pub total_lexicons: i64,
70    /// Total number of records indexed in this slice
71    pub total_records: i64,
72}
73
74/// Response type for
75///network.slices.slice.stats
76pub struct StatsResponse;
77impl jacquard_common::xrpc::XrpcResp for StatsResponse {
78    const NSID: &'static str = "network.slices.slice.stats";
79    const ENCODING: &'static str = "application/json";
80    type Output<'de> = StatsOutput<'de>;
81    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
82}
83
84impl<'a> jacquard_common::xrpc::XrpcRequest for Stats<'a> {
85    const NSID: &'static str = "network.slices.slice.stats";
86    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
87    type Response = StatsResponse;
88}
89
90/// Endpoint type for
91///network.slices.slice.stats
92pub struct StatsRequest;
93impl jacquard_common::xrpc::XrpcEndpoint for StatsRequest {
94    const PATH: &'static str = "/xrpc/network.slices.slice.stats";
95    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
96    type Request<'de> = Stats<'de>;
97    type Response = StatsResponse;
98}