1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: network.slices.slice.getSparklines
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 bon::Builder,
17 jacquard_derive::IntoStatic
18)]
19#[serde(rename_all = "camelCase")]
20#[builder(start_fn = new)]
21pub struct GetSparklines<'a> {
22 /// Time range to fetch data for
23 #[serde(skip_serializing_if = "std::option::Option::is_none")]
24 #[builder(into)]
25 #[serde(borrow)]
26 pub duration: Option<jacquard_common::CowStr<'a>>,
27 /// Time interval for data points
28 #[serde(skip_serializing_if = "std::option::Option::is_none")]
29 #[builder(into)]
30 #[serde(borrow)]
31 pub interval: Option<jacquard_common::CowStr<'a>>,
32 /// Array of slice AT-URIs to get sparkline data for
33 #[serde(borrow)]
34 pub slices: Vec<jacquard_common::CowStr<'a>>,
35 #[serde(flatten)]
36 #[serde(borrow)]
37 #[builder(default)]
38 pub extra_data: ::std::collections::BTreeMap<
39 ::jacquard_common::smol_str::SmolStr,
40 ::jacquard_common::types::value::Data<'a>,
41 >,
42}
43
44#[jacquard_derive::lexicon]
45#[derive(
46 serde::Serialize,
47 serde::Deserialize,
48 Debug,
49 Clone,
50 PartialEq,
51 Eq,
52 jacquard_derive::IntoStatic
53)]
54#[serde(rename_all = "camelCase")]
55pub struct GetSparklinesOutput<'a> {
56 /// Array of slice sparkline data entries
57 #[serde(borrow)]
58 pub sparklines: Vec<jacquard_common::types::value::Data<'a>>,
59}
60
61///Response type for
62///network.slices.slice.getSparklines
63pub struct GetSparklinesResponse;
64impl jacquard_common::xrpc::XrpcResp for GetSparklinesResponse {
65 const NSID: &'static str = "network.slices.slice.getSparklines";
66 const ENCODING: &'static str = "application/json";
67 type Output<'de> = GetSparklinesOutput<'de>;
68 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
69}
70
71impl<'a> jacquard_common::xrpc::XrpcRequest for GetSparklines<'a> {
72 const NSID: &'static str = "network.slices.slice.getSparklines";
73 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
74 "application/json",
75 );
76 type Response = GetSparklinesResponse;
77}
78
79///Endpoint type for
80///network.slices.slice.getSparklines
81pub struct GetSparklinesRequest;
82impl jacquard_common::xrpc::XrpcEndpoint for GetSparklinesRequest {
83 const PATH: &'static str = "/xrpc/network.slices.slice.getSparklines";
84 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
85 "application/json",
86 );
87 type Request<'de> = GetSparklines<'de>;
88 type Response = GetSparklinesResponse;
89}
90
91#[jacquard_derive::lexicon]
92#[derive(
93 serde::Serialize,
94 serde::Deserialize,
95 Debug,
96 Clone,
97 PartialEq,
98 Eq,
99 jacquard_derive::IntoStatic,
100 bon::Builder
101)]
102#[serde(rename_all = "camelCase")]
103pub struct SparklineEntry<'a> {
104 /// Array of sparkline data points
105 #[serde(borrow)]
106 pub points: Vec<crate::network_slices::slice::SparklinePoint<'a>>,
107 /// AT-URI of the slice
108 #[serde(borrow)]
109 #[builder(into)]
110 pub slice_uri: jacquard_common::CowStr<'a>,
111}