babelforce-manager-sdk 0.44.0

Rust SDK for the babelforce manager APIs — auth, user & agent management, call reporting, metrics, and task automations.
Documentation
/*
 * task-automation API
 *
 * task-automation engine to automate and customize web based integration processes
 *
 * The version of the OpenAPI document: 3.63.10
 * Contact: support@babelforce.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActionLog {
    #[serde(rename = "log_type")]
    pub log_type: models::LogType,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "parent")]
    pub parent: String,
    #[serde(rename = "has_error")]
    pub has_error: bool,
    #[serde(rename = "task_id")]
    pub task_id: String,
    #[serde(rename = "type")]
    pub r#type: String,
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<models::TaskState>,
    #[serde(rename = "meta")]
    pub meta: Box<models::LogMeta>,
    #[serde(rename = "details", skip_serializing_if = "Option::is_none")]
    pub details: Option<serde_json::Value>,
}

impl ActionLog {
    pub fn new(
        log_type: models::LogType,
        id: String,
        parent: String,
        has_error: bool,
        task_id: String,
        r#type: String,
        meta: models::LogMeta,
    ) -> ActionLog {
        ActionLog {
            log_type,
            id,
            parent,
            has_error,
            task_id,
            r#type,
            state: None,
            meta: Box::new(meta),
            details: None,
        }
    }
}