webhook-line 1.0.1

Webhook event definition of the LINE Messaging API
Documentation
/*
 * Webhook Type Definition
 *
 * Webhook event definition of the LINE Messaging API
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ScenarioResult {
    /// Scenario ID executed
    #[serde(rename = "scenarioId", skip_serializing_if = "Option::is_none")]
    pub scenario_id: Option<String>,
    /// Revision number of the scenario set containing the executed scenario
    #[serde(rename = "revision", skip_serializing_if = "Option::is_none")]
    pub revision: Option<i32>,
    /// Timestamp for when execution of scenario action started (milliseconds, LINE app time)
    #[serde(rename = "startTime")]
    pub start_time: i64,
    /// Timestamp for when execution of scenario was completed (milliseconds, LINE app time)
    #[serde(rename = "endTime")]
    pub end_time: i64,
    /// Scenario execution completion status
    #[serde(rename = "resultCode")]
    pub result_code: String,
    /// Execution result of individual operations specified in action. Only included when things.result.resultCode is success.
    #[serde(rename = "actionResults", skip_serializing_if = "Option::is_none")]
    pub action_results: Option<Vec<models::ActionResult>>,
    /// Data contained in notification.
    #[serde(rename = "bleNotificationPayload", skip_serializing_if = "Option::is_none")]
    pub ble_notification_payload: Option<String>,
    /// Error reason.
    #[serde(rename = "errorReason", skip_serializing_if = "Option::is_none")]
    pub error_reason: Option<String>,
}

impl ScenarioResult {
    pub fn new(start_time: i64, end_time: i64, result_code: String) -> ScenarioResult {
        ScenarioResult {
            scenario_id: None,
            revision: None,
            start_time,
            end_time,
            result_code,
            action_results: None,
            ble_notification_payload: None,
            error_reason: None,
        }
    }
}