1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* 1MSG WhatsApp Business API (Public)
*
* Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
*
* The version of the OpenAPI document: 1.0.0
* Contact: support@1msg.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// SendMessageRequest : Request body for sending a text message
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SendMessageRequest {
/// Message text, UTF-8 or UTF-16 string with emoji
#[serde(rename = "body")]
pub body: String,
/// Message ID to quote/reply to (Cloud API wamid)
#[serde(rename = "quotedMsgId", skip_serializing_if = "Option::is_none")]
pub quoted_msg_id: Option<String>,
/// Chat ID in format: phone@c.us (individual) or phone@g.us (group)
#[serde(rename = "chatId", skip_serializing_if = "Option::is_none")]
pub chat_id: Option<String>,
/// Phone number starting with country code (alternative to chatId)
#[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
pub phone: Option<i32>,
}
impl SendMessageRequest {
/// Request body for sending a text message
pub fn new(body: String) -> SendMessageRequest {
SendMessageRequest {
body,
quoted_msg_id: None,
chat_id: None,
phone: None,
}
}
}