speechmatics 0.4.0

An async rust SDK for the Speechmatics API
Documentation
/*
 * Speechmatics ASR REST API
 *
 * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. 
 *
 * The version of the OpenAPI document: 2.0.0
 * Contact: support@speechmatics.com
 * Generated by: https://openapi-generator.tech
 */

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

/// JobInfo : Summary information about an ASR job, to support identification and tracking
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JobInfo {
    /// The UTC date time the job was created.
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// Name of data file submitted for job.
    #[serde(rename = "data_name")]
    pub data_name: String,
    /// The data file audio duration (in seconds).
    #[serde(rename = "duration")]
    pub duration: i32,
    /// The unique id assigned to the job.
    #[serde(rename = "id")]
    pub id: String,
    /// Name of the text file submitted to be aligned to audio.
    #[serde(rename = "text_name", skip_serializing_if = "Option::is_none")]
    pub text_name: Option<String>,
    #[serde(rename = "tracking", skip_serializing_if = "Option::is_none")]
    pub tracking: Option<Box<models::TrackingData>>,
}

impl JobInfo {
    /// Summary information about an ASR job, to support identification and tracking
    pub fn new(created_at: String, data_name: String, duration: i32, id: String) -> JobInfo {
        JobInfo {
            created_at,
            data_name,
            duration,
            id,
            text_name: None,
            tracking: None,
        }
    }
}