messaging_api_line/models/
pnp_messages_request.rs

1/*
2 * LINE Messaging API
3 *
4 * This document describes LINE Messaging API.
5 *
6 * The version of the OpenAPI document: 0.0.1
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 PnpMessagesRequest {
16    /// Message to be sent.
17    #[serde(rename = "messages")]
18    pub messages: Vec<models::Message>,
19    /// Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256.
20    #[serde(rename = "to")]
21    pub to: String,
22    /// `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. 
23    #[serde(rename = "notificationDisabled", skip_serializing_if = "Option::is_none")]
24    pub notification_disabled: Option<bool>,
25}
26
27impl PnpMessagesRequest {
28    pub fn new(messages: Vec<models::Message>, to: String) -> PnpMessagesRequest {
29        PnpMessagesRequest {
30            messages,
31            to,
32            notification_disabled: None,
33        }
34    }
35}
36