Skip to main content

hanzo_client/models/
notify_send.rs

1/*
2 * Hanzo Cloud API
3 *
4 * 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/.
5 *
6 * The version of the OpenAPI document: v1
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 NotifySend {
16    /// Body is the message text, sent verbatim when present — the no-template path.
17    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
18    pub body: Option<String>,
19    /// 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.
20    #[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
21    pub channel: Option<String>,
22    /// 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.
23    #[serde(rename = "event", skip_serializing_if = "Option::is_none")]
24    pub event: Option<String>,
25    /// Provider pins a provider service name (twilio, plivo, twilio_email, mail). Empty picks the one whose org credentials are actually configured in KMS.
26    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
27    pub provider: Option<String>,
28    /// Subject is the message subject, carried on the email channel only.
29    #[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
30    pub subject: Option<String>,
31    /// 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.
32    #[serde(rename = "sync", skip_serializing_if = "Option::is_none")]
33    pub sync: Option<String>,
34    /// TemplateID selects a built-in template when Body is empty.
35    #[serde(rename = "template_id", skip_serializing_if = "Option::is_none")]
36    pub template_id: Option<String>,
37    #[serde(rename = "template_vars", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub template_vars: Option<Option<serde_json::Value>>,
39    /// 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).
40    #[serde(rename = "to", skip_serializing_if = "Option::is_none")]
41    pub to: Option<Vec<String>>,
42}
43
44impl NotifySend {
45    pub fn new() -> NotifySend {
46        NotifySend {
47            body: None,
48            channel: None,
49            event: None,
50            provider: None,
51            subject: None,
52            sync: None,
53            template_id: None,
54            template_vars: None,
55            to: None,
56        }
57    }
58}
59