hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation
/*
 * Hanzo Cloud API
 *
 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifySend {
    /// Body is the message text, sent verbatim when present — the no-template path.
    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
    pub body: Option<String>,
    /// Channel selects the delivery channel, sms or email. The per-channel routes (/send/sms, /send/email) pin it, overriding whatever the body names; on the generic route it is required.
    #[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
    pub channel: Option<String>,
    /// Event is the event name, which doubles as the template id when TemplateID is empty — the IAM OTP path sends event=iam.otp_sent and nothing else.
    #[serde(rename = "event", skip_serializing_if = "Option::is_none")]
    pub event: Option<String>,
    /// Provider pins a provider service name (twilio, plivo, twilio_email, mail). Empty picks the one whose org credentials are actually configured in KMS.
    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
    pub provider: Option<String>,
    /// Subject is the message subject, carried on the email channel only.
    #[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
    pub subject: Option<String>,
    /// Sync must be exactly \"true\": delivery here is synchronous, and anything else answers 503 because the queue plane that would run an async dispatch is owned elsewhere. Over REST it rides as ?sync=true (the URL binds over the body); a by-name call states it in its arguments.
    #[serde(rename = "sync", skip_serializing_if = "Option::is_none")]
    pub sync: Option<String>,
    /// TemplateID selects a built-in template when Body is empty.
    #[serde(rename = "template_id", skip_serializing_if = "Option::is_none")]
    pub template_id: Option<String>,
    #[serde(rename = "template_vars", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub template_vars: Option<Option<serde_json::Value>>,
    /// To is the destination address per recipient — a phone number for sms, an email address for email. Several recipients fan out into one provider call each, and the response shape follows the count (see the items field).
    #[serde(rename = "to", skip_serializing_if = "Option::is_none")]
    pub to: Option<Vec<String>>,
}

impl NotifySend {
    pub fn new() -> NotifySend {
        NotifySend {
            body: None,
            channel: None,
            event: None,
            provider: None,
            subject: None,
            sync: None,
            template_id: None,
            template_vars: None,
            to: None,
        }
    }
}