Skip to main content

clientapi_pbs/models/
admin_get_traffic_control_response_data_inner.rs

1/*
2 * Proxmox Backup Server API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pbs.proxmox.com/docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AdminGetTrafficControlResponseDataInner {
16
17    /// Byte size with optional unit (B, KB (base 10), MB, GB, ..., KiB (base 2), MiB, Gib, ...).
18    #[serde(rename = "burst-in", skip_serializing_if = "Option::is_none")]
19    pub burst_in: Option<String>,
20
21    /// Byte size with optional unit (B, KB (base 10), MB, GB, ..., KiB (base 2), MiB, Gib, ...).
22    #[serde(rename = "burst-out", skip_serializing_if = "Option::is_none")]
23    pub burst_out: Option<String>,
24
25    /// Comment.
26    #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
27    pub comment: Option<String>,
28
29    /// Current ingress rate in bytes/second
30    #[serde(rename = "cur-rate-in")]
31    pub cur_rate_in: i64,
32
33    /// Current egress rate in bytes/second
34    #[serde(rename = "cur-rate-out")]
35    pub cur_rate_out: i64,
36
37    /// Rule ID.
38    #[serde(rename = "name")]
39    pub name: String,
40
41    /// Rule applies to Source IPs within this networks
42    #[serde(rename = "network")]
43    pub network: Vec<String>,
44
45    /// Byte size with optional unit (B, KB (base 10), MB, GB, ..., KiB (base 2), MiB, Gib, ...).
46    #[serde(rename = "rate-in", skip_serializing_if = "Option::is_none")]
47    pub rate_in: Option<String>,
48
49    /// Byte size with optional unit (B, KB (base 10), MB, GB, ..., KiB (base 2), MiB, Gib, ...).
50    #[serde(rename = "rate-out", skip_serializing_if = "Option::is_none")]
51    pub rate_out: Option<String>,
52
53    /// Enable the rule at specific times
54    #[serde(rename = "timeframe", skip_serializing_if = "Option::is_none")]
55    pub timeframe: Option<Vec<String>>,
56
57    /// Rule applies to authenticated API requests of any of these users (overrides IP-only rules)
58    #[serde(rename = "users", skip_serializing_if = "Option::is_none")]
59    pub users: Option<Vec<String>>,
60
61
62}
63
64impl AdminGetTrafficControlResponseDataInner {
65    pub fn new(cur_rate_in: i64, cur_rate_out: i64, name: String, network: Vec<String>) -> AdminGetTrafficControlResponseDataInner {
66        AdminGetTrafficControlResponseDataInner {
67            
68            burst_in: None,
69            
70            burst_out: None,
71            
72            comment: None,
73            
74            cur_rate_in,
75            
76            cur_rate_out,
77            
78            name,
79            
80            network,
81            
82            rate_in: None,
83            
84            rate_out: None,
85            
86            timeframe: None,
87            
88            users: None,
89            
90        }
91    }
92}
93
94