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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
* Proxmox Backup Server API
*
* Generated from apidoc.js. NOT an official Proxmox specification. See https://pbs.proxmox.com/docs/api-viewer/ for the upstream documentation.
*
* The version of the OpenAPI document: 9.x
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ConfigNotificationsGetSmtpResponseDataInner {
/// Author of the mail. Defaults to 'Proxmox Backup Server ($hostname)'
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
pub author: Option<String>,
/// Comment.
#[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
/// Disable this target.
#[serde(rename = "disable", skip_serializing_if = "Option::is_none")]
pub disable: Option<bool>,
/// `From` address for the mail. SMTP relays might require that this address is owned by the user in order to avoid spoofing. The `From` header in the email will be set to `$author <$from-address>`.
#[serde(rename = "from-address")]
pub from_address: String,
/// Mail address to send a mail to.
#[serde(rename = "mailto", skip_serializing_if = "Option::is_none")]
pub mailto: Option<Vec<String>>,
/// Users to send a mail to. The email address of the user will be looked up in users.cfg.
#[serde(rename = "mailto-user", skip_serializing_if = "Option::is_none")]
pub mailto_user: Option<Vec<String>>,
/// Connection security
#[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
pub mode: Option<models::PbsConfigNotificationsModeEnum>,
/// Name schema for targets and matchers
#[serde(rename = "name")]
pub name: String,
/// The origin of a notification configuration entry.
#[serde(rename = "origin", skip_serializing_if = "Option::is_none")]
pub origin: Option<models::PbsOriginEnum>,
/// The port to connect to. If not set, the used port defaults to 25 (insecure), 465 (tls) or 587 (starttls), depending on the value of mode
#[serde(rename = "port", skip_serializing_if = "Option::is_none")]
pub port: Option<i32>,
/// Host name or IP of the SMTP relay.
#[serde(rename = "server")]
pub server: String,
/// Username to use during authentication. If no username is set, no authentication will be performed. The PLAIN and LOGIN authentication methods are supported
#[serde(rename = "username", skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
impl ConfigNotificationsGetSmtpResponseDataInner {
pub fn new(from_address: String, name: String, server: String) -> ConfigNotificationsGetSmtpResponseDataInner {
ConfigNotificationsGetSmtpResponseDataInner {
author: None,
comment: None,
disable: None,
from_address,
mailto: None,
mailto_user: None,
mode: None,
name,
origin: None,
port: None,
server,
username: None,
}
}
}