Skip to main content

clientapi_pbs/models/
config_notifications_create_webhook_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 ConfigNotificationsCreateWebhookRequest {
16
17    /// The HTTP body to send. Supports templating.
18    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
19    pub body: Option<String>,
20
21    /// Comment.
22    #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
23    pub comment: Option<String>,
24
25    /// Disable this target.
26    #[serde(rename = "disable", skip_serializing_if = "Option::is_none")]
27    pub disable: Option<bool>,
28
29    /// Array of HTTP headers. Each entry is a property string with a name and a value. The value property contains the header in base64 encoding. Supports templating.
30    #[serde(rename = "header", skip_serializing_if = "Option::is_none")]
31    pub header: Option<Vec<models::ConfigNotificationsGetWebhookResponseDataInnerHeaderInner>>,
32
33    /// HTTP Method to use.
34    #[serde(rename = "method")]
35    pub method: models::PbsMethodEnum,
36
37    /// Name schema for targets and matchers
38    #[serde(rename = "name")]
39    pub name: String,
40
41    /// The origin of a notification configuration entry.
42    #[serde(rename = "origin", skip_serializing_if = "Option::is_none")]
43    pub origin: Option<models::PbsOriginEnum>,
44
45    /// Array of secrets. Each entry is a property string with a name and an optional value. The value property contains the secret in base64 encoding. For any API endpoints returning the endpoint config, only the secret name but not the value will be returned. When updating the config, also send all secrets that you want to keep, setting only the name but not the value. Can be accessed from templates.
46    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
47    pub secret: Option<Vec<models::ConfigNotificationsGetWebhookResponseDataInnerHeaderInner>>,
48
49    /// HTTP(s) url with optional port.
50    #[serde(rename = "url")]
51    pub url: String,
52
53
54}
55
56impl ConfigNotificationsCreateWebhookRequest {
57    pub fn new(method: models::PbsMethodEnum, name: String, url: String) -> ConfigNotificationsCreateWebhookRequest {
58        ConfigNotificationsCreateWebhookRequest {
59            
60            body: None,
61            
62            comment: None,
63            
64            disable: None,
65            
66            header: None,
67            
68            method,
69            
70            name,
71            
72            origin: None,
73            
74            secret: None,
75            
76            url,
77            
78        }
79    }
80}
81
82