Skip to main content

clientapi_pve/models/
cluster_notifications_create_smtp_endpoint_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 ClusterNotificationsCreateSmtpEndpointRequest {
16
17    /// Author of the mail. Defaults to 'Proxmox VE'.
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<models::PveBoolean>,
28
29    /// `From` address for the mail
30    #[serde(rename = "from-address")]
31    pub from_address: String,
32
33    /// List of email recipients
34    #[serde(rename = "mailto", skip_serializing_if = "Option::is_none")]
35    pub mailto: Option<Vec<String>>,
36
37    /// List of users
38    #[serde(rename = "mailto-user", skip_serializing_if = "Option::is_none")]
39    pub mailto_user: Option<Vec<String>>,
40
41    /// Determine which encryption method shall be used for the connection.
42    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
43    pub mode: Option<models::PveClusterNotificationsModeEnum>,
44
45    /// The name of the endpoint.
46    #[serde(rename = "name")]
47    pub name: String,
48
49    /// Password for SMTP authentication
50    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
51    pub password: Option<String>,
52
53    /// The port to be used. Defaults to 465 for TLS based connections, 587 for STARTTLS based connections and port 25 for insecure plain-text connections.
54    #[serde(rename = "port", skip_serializing_if = "Option::is_none")]
55    pub port: Option<i64>,
56
57    /// The address of the SMTP server.
58    #[serde(rename = "server")]
59    pub server: String,
60
61    /// Username for SMTP authentication
62    #[serde(rename = "username", skip_serializing_if = "Option::is_none")]
63    pub username: Option<String>,
64
65
66}
67
68impl ClusterNotificationsCreateSmtpEndpointRequest {
69    pub fn new(from_address: String, name: String, server: String) -> ClusterNotificationsCreateSmtpEndpointRequest {
70        ClusterNotificationsCreateSmtpEndpointRequest {
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            password: None,
89            
90            port: None,
91            
92            server,
93            
94            username: None,
95            
96        }
97    }
98}
99
100