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