quicknode_sdk/admin/
endpoint_metrics.rs1#[cfg(feature = "node")]
2use napi_derive::napi;
3#[cfg(feature = "python")]
4use pyo3::pyclass;
5#[cfg(feature = "python")]
6use pyo3_stub_gen::derive::gen_stub_pyclass;
7use serde::{Deserialize, Serialize};
8
9#[cfg_attr(feature = "python", gen_stub_pyclass)]
11#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
12#[cfg_attr(feature = "node", napi(object))]
13#[derive(Debug, Clone, Default, Serialize)]
14pub struct GetEndpointMetricsRequest {
15 pub period: String,
17 pub metric: String,
19}
20
21#[cfg_attr(feature = "python", gen_stub_pyclass)]
23#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
24#[cfg_attr(feature = "node", napi(object))]
25#[derive(Debug, Clone, Default, Serialize)]
26pub struct GetAccountMetricsRequest {
27 pub period: String,
29 pub metric: String,
31 #[serde(skip_serializing_if = "Option::is_none")]
33 pub percentile: Option<String>,
34}
35
36#[cfg_attr(feature = "python", gen_stub_pyclass)]
38#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
39#[cfg_attr(feature = "node", napi(object))]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41pub struct EndpointMetric {
42 pub data: Vec<Vec<i64>>,
44 pub tag: String,
46}
47
48#[cfg_attr(feature = "python", gen_stub_pyclass)]
50#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
51#[cfg_attr(feature = "node", napi(object))]
52#[derive(Debug, Clone, Serialize, Deserialize)]
53pub struct GetEndpointMetricsResponse {
54 #[serde(default)]
56 pub data: Vec<EndpointMetric>,
57 pub error: Option<String>,
59}
60
61#[cfg_attr(feature = "python", gen_stub_pyclass)]
63#[cfg_attr(feature = "python", pyclass(get_all, set_all))]
64#[cfg_attr(feature = "node", napi(object))]
65#[derive(Debug, Clone, Serialize, Deserialize)]
66pub struct GetAccountMetricsResponse {
67 #[serde(default)]
69 pub data: Vec<EndpointMetric>,
70 pub error: Option<String>,
72}