1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Hetzner Cloud API
*
* Copied from the official API documentation for the Public Hetzner Cloud.
*
* The version of the OpenAPI document: 0.28.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Metrics : You must specify the type of metric to get: open_connections, requests_per_second or bandwidth. You can also specify more than one type by comma separation, e.g. requests_per_second,bandwidth. Depending on the type you will get different time series data.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Metrics {
/// End of period of metrics reported (in ISO-8601 format).
#[serde(rename = "end")]
pub end: String,
/// Start of period of metrics reported (in ISO-8601 format).
#[serde(rename = "start")]
pub start: String,
/// Resolution of results in seconds.
#[serde(rename = "step")]
pub step: i32,
/// Hash with timeseries information, containing the name of timeseries as key.
#[serde(rename = "time_series")]
pub time_series: std::collections::HashMap<String, models::MetricsTimeSeries>,
}
impl Metrics {
/// You must specify the type of metric to get: open_connections, requests_per_second or bandwidth. You can also specify more than one type by comma separation, e.g. requests_per_second,bandwidth. Depending on the type you will get different time series data.
pub fn new(
end: String,
start: String,
step: i32,
time_series: std::collections::HashMap<String, models::MetricsTimeSeries>,
) -> Metrics {
Metrics {
end,
start,
step,
time_series,
}
}
}