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};

/// RecognitionAlternative : List of possible job output item values, ordered by likelihood.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RecognitionAlternative {
    #[serde(rename = "content")]
    pub content: String,
    #[serde(rename = "confidence")]
    pub confidence: f32,
    #[serde(rename = "language")]
    pub language: String,
    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
    pub display: Option<Box<models::RecognitionDisplay>>,
    #[serde(rename = "speaker", skip_serializing_if = "Option::is_none")]
    pub speaker: Option<String>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<String>>,
}

impl RecognitionAlternative {
    /// List of possible job output item values, ordered by likelihood.
    pub fn new(content: String, confidence: f32, language: String) -> RecognitionAlternative {
        RecognitionAlternative {
            content,
            confidence,
            language,
            display: None,
            speaker: None,
            tags: None,
        }
    }
}