Skip to main content

clientapi_pbs/models/
config_notifications_create_smtp_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 ConfigNotificationsCreateSmtpRequest {
16
17    /// Author of the mail. Defaults to 'Proxmox Backup Server ($hostname)'
18    #[serde(rename = "author", skip_serializing_if = "Option::is_none")]
19    pub author: 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    /// `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>`.
30    #[serde(rename = "from-address")]
31    pub from_address: String,
32
33    /// Mail address to send a mail to.
34    #[serde(rename = "mailto", skip_serializing_if = "Option::is_none")]
35    pub mailto: Option<Vec<String>>,
36
37    /// Users to send a mail to. The email address of the user will be looked up in users.cfg.
38    #[serde(rename = "mailto-user", skip_serializing_if = "Option::is_none")]
39    pub mailto_user: Option<Vec<String>>,
40
41    /// Connection security
42    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
43    pub mode: Option<models::PbsConfigNotificationsModeEnum>,
44
45    /// Name schema for targets and matchers
46    #[serde(rename = "name")]
47    pub name: String,
48
49    /// The origin of a notification configuration entry.
50    #[serde(rename = "origin", skip_serializing_if = "Option::is_none")]
51    pub origin: Option<models::PbsOriginEnum>,
52
53    /// SMTP authentication password
54    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
55    pub password: Option<String>,
56
57    /// 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
58    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
59    pub port: Option<i32>,
60
61    /// Host name or IP of the SMTP relay.
62    #[serde(rename = "server")]
63    pub server: String,
64
65    /// Username to use during authentication. If no username is set, no authentication will be performed. The PLAIN and LOGIN authentication methods are supported
66    #[serde(rename = "username", skip_serializing_if = "Option::is_none")]
67    pub username: Option<String>,
68
69
70}
71
72impl ConfigNotificationsCreateSmtpRequest {
73    pub fn new(from_address: String, name: String, server: String) -> ConfigNotificationsCreateSmtpRequest {
74        ConfigNotificationsCreateSmtpRequest {
75            
76            author: None,
77            
78            comment: None,
79            
80            disable: None,
81            
82            from_address,
83            
84            mailto: None,
85            
86            mailto_user: None,
87            
88            mode: None,
89            
90            name,
91            
92            origin: None,
93            
94            password: None,
95            
96            port: None,
97            
98            server,
99            
100            username: None,
101            
102        }
103    }
104}
105
106