Skip to main content

clientapi_pbs/models/
config_notifications_get_smtp_response_data_inner.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 ConfigNotificationsGetSmtpResponseDataInner {
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    /// 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
54    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
55    pub port: Option<i32>,
56
57    /// Host name or IP of the SMTP relay.
58    #[serde(rename = "server")]
59    pub server: String,
60
61    /// Username to use during authentication. If no username is set, no authentication will be performed. The PLAIN and LOGIN authentication methods are supported
62    #[serde(rename = "username", skip_serializing_if = "Option::is_none")]
63    pub username: Option<String>,
64
65
66}
67
68impl ConfigNotificationsGetSmtpResponseDataInner {
69    pub fn new(from_address: String, name: String, server: String) -> ConfigNotificationsGetSmtpResponseDataInner {
70        ConfigNotificationsGetSmtpResponseDataInner {
71            
72            author: None,
73            
74            comment: None,
75            
76            disable: None,
77            
78            from_address,
79            
80            mailto: None,
81            
82            mailto_user: None,
83            
84            mode: None,
85            
86            name,
87            
88            origin: None,
89            
90            port: None,
91            
92            server,
93            
94            username: None,
95            
96        }
97    }
98}
99
100