webhook_line/models/
scenario_result.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ScenarioResult {
16    /// Scenario ID executed
17    #[serde(rename = "scenarioId", skip_serializing_if = "Option::is_none")]
18    pub scenario_id: Option<String>,
19    /// Revision number of the scenario set containing the executed scenario
20    #[serde(rename = "revision", skip_serializing_if = "Option::is_none")]
21    pub revision: Option<i32>,
22    /// Timestamp for when execution of scenario action started (milliseconds, LINE app time)
23    #[serde(rename = "startTime")]
24    pub start_time: i64,
25    /// Timestamp for when execution of scenario was completed (milliseconds, LINE app time)
26    #[serde(rename = "endTime")]
27    pub end_time: i64,
28    /// Scenario execution completion status
29    #[serde(rename = "resultCode")]
30    pub result_code: String,
31    /// Execution result of individual operations specified in action. Only included when things.result.resultCode is success.
32    #[serde(rename = "actionResults", skip_serializing_if = "Option::is_none")]
33    pub action_results: Option<Vec<models::ActionResult>>,
34    /// Data contained in notification.
35    #[serde(rename = "bleNotificationPayload", skip_serializing_if = "Option::is_none")]
36    pub ble_notification_payload: Option<String>,
37    /// Error reason.
38    #[serde(rename = "errorReason", skip_serializing_if = "Option::is_none")]
39    pub error_reason: Option<String>,
40}
41
42impl ScenarioResult {
43    pub fn new(start_time: i64, end_time: i64, result_code: String) -> ScenarioResult {
44        ScenarioResult {
45            scenario_id: None,
46            revision: None,
47            start_time,
48            end_time,
49            result_code,
50            action_results: None,
51            ble_notification_payload: None,
52            error_reason: None,
53        }
54    }
55}
56