clientapi-pbs 2026.5.24

Generated from apidoc.js. NOT an official Proxmox specification. See https://pbs.proxmox.com/docs/api-viewer/ for the upstream documentation.
Documentation
/*
 * 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 ConfigNotificationsCreateSmtpRequest {

    /// 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>,

    /// SMTP authentication password
    #[serde(rename = "password", skip_serializing_if = "Option::is_none")]
    pub password: Option<String>,

    /// 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 ConfigNotificationsCreateSmtpRequest {
    pub fn new(from_address: String, name: String, server: String) -> ConfigNotificationsCreateSmtpRequest {
        ConfigNotificationsCreateSmtpRequest {
            
            author: None,
            
            comment: None,
            
            disable: None,
            
            from_address,
            
            mailto: None,
            
            mailto_user: None,
            
            mode: None,
            
            name,
            
            origin: None,
            
            password: None,
            
            port: None,
            
            server,
            
            username: None,
            
        }
    }
}