webhook_line/models/callback_request.rs
1/*
2 * Webhook Type Definition
3 *
4 * Webhook event definition of the LINE Messaging API
5 *
6 * The version of the OpenAPI document: 1.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CallbackRequest : The request body contains a JSON object with the user ID of a bot that should receive webhook events and an array of webhook event objects.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CallbackRequest {
17 /// User ID of a bot that should receive webhook events. The user ID value is a string that matches the regular expression, `U[0-9a-f]{32}`.
18 #[serde(rename = "destination")]
19 pub destination: String,
20 /// Array of webhook event objects. The LINE Platform may send an empty array that doesn't include a webhook event object to confirm communication.
21 #[serde(rename = "events")]
22 pub events: Vec<models::Event>,
23}
24
25impl CallbackRequest {
26 /// The request body contains a JSON object with the user ID of a bot that should receive webhook events and an array of webhook event objects.
27 pub fn new(destination: String, events: Vec<models::Event>) -> CallbackRequest {
28 CallbackRequest {
29 destination,
30 events,
31 }
32 }
33}
34