Skip to main content

clientapi_pve/models/
cluster_notifications_create_matcher_request.rs

1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-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 ClusterNotificationsCreateMatcherRequest {
16
17    /// Comment
18    #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
19    pub comment: Option<String>,
20
21    /// Disable this matcher
22    #[serde(rename = "disable", skip_serializing_if = "Option::is_none")]
23    pub disable: Option<models::PveBoolean>,
24
25    /// Invert match of the whole matcher
26    #[serde(rename = "invert-match", skip_serializing_if = "Option::is_none")]
27    pub invert_match: Option<models::PveBoolean>,
28
29    /// Match notification timestamp
30    #[serde(rename = "match-calendar", skip_serializing_if = "Option::is_none")]
31    pub match_calendar: Option<Vec<String>>,
32
33    /// Metadata fields to match (regex or exact match). Must be in the form (regex|exact):<field>=<value>
34    #[serde(rename = "match-field", skip_serializing_if = "Option::is_none")]
35    pub match_field: Option<Vec<String>>,
36
37    /// Notification severities to match
38    #[serde(rename = "match-severity", skip_serializing_if = "Option::is_none")]
39    pub match_severity: Option<Vec<String>>,
40
41    /// Choose between 'all' and 'any' for when multiple properties are specified
42    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
43    pub mode: Option<models::PveModeModeEnum>,
44
45    /// Name of the matcher.
46    #[serde(rename = "name")]
47    pub name: String,
48
49    /// Targets to notify on match
50    #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
51    pub target: Option<Vec<String>>,
52
53
54}
55
56impl ClusterNotificationsCreateMatcherRequest {
57    pub fn new(name: String) -> ClusterNotificationsCreateMatcherRequest {
58        ClusterNotificationsCreateMatcherRequest {
59            
60            comment: None,
61            
62            disable: None,
63            
64            invert_match: None,
65            
66            match_calendar: None,
67            
68            match_field: None,
69            
70            match_severity: None,
71            
72            mode: None,
73            
74            name,
75            
76            target: None,
77            
78        }
79    }
80}
81
82