Skip to main content

clientapi_pbs/models/
config_traffic_control_create_traffic_control_request.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 ConfigTrafficControlCreateTrafficControlRequest {
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    /// Rule ID.
30    #[serde(rename = "name")]
31    pub name: String,
32
33    /// Rule applies to Source IPs within this networks
34    #[serde(rename = "network")]
35    pub network: Vec<String>,
36
37    /// Byte size with optional unit (B, KB (base 10), MB, GB, ..., KiB (base 2), MiB, Gib, ...).
38    #[serde(rename = "rate-in", skip_serializing_if = "Option::is_none")]
39    pub rate_in: Option<String>,
40
41    /// Byte size with optional unit (B, KB (base 10), MB, GB, ..., KiB (base 2), MiB, Gib, ...).
42    #[serde(rename = "rate-out", skip_serializing_if = "Option::is_none")]
43    pub rate_out: Option<String>,
44
45    /// Enable the rule at specific times
46    #[serde(rename = "timeframe", skip_serializing_if = "Option::is_none")]
47    pub timeframe: Option<Vec<String>>,
48
49    /// Rule applies to authenticated API requests of any of these users (overrides IP-only rules)
50    #[serde(rename = "users", skip_serializing_if = "Option::is_none")]
51    pub users: Option<Vec<String>>,
52
53
54}
55
56impl ConfigTrafficControlCreateTrafficControlRequest {
57    pub fn new(name: String, network: Vec<String>) -> ConfigTrafficControlCreateTrafficControlRequest {
58        ConfigTrafficControlCreateTrafficControlRequest {
59            
60            burst_in: None,
61            
62            burst_out: None,
63            
64            comment: None,
65            
66            name,
67            
68            network,
69            
70            rate_in: None,
71            
72            rate_out: None,
73            
74            timeframe: None,
75            
76            users: None,
77            
78        }
79    }
80}
81
82