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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RetrieveTranscriptResponse {
    /// Speechmatics JSON transcript format version number.
    #[serde(rename = "format")]
    pub format: String,
    #[serde(rename = "job")]
    pub job: Box<models::JobInfo>,
    #[serde(rename = "metadata")]
    pub metadata: Box<models::RecognitionMetadata>,
    #[serde(rename = "results")]
    pub results: Vec<models::RecognitionResult>,
    /// Translations of the transcript into other languages. It is a map of ISO language codes to arrays of translated sentences. Configured using `translation_config`.
    #[serde(rename = "translations", skip_serializing_if = "Option::is_none")]
    pub translations: Option<std::collections::HashMap<String, Vec<models::TranslationSentence>>>,
    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
    pub summary: Option<Box<models::SummarizationResult>>,
    #[serde(rename = "sentiment_analysis", skip_serializing_if = "Option::is_none")]
    pub sentiment_analysis: Option<Box<models::SentimentAnalysisResult>>,
}

impl RetrieveTranscriptResponse {
    pub fn new(format: String, job: models::JobInfo, metadata: models::RecognitionMetadata, results: Vec<models::RecognitionResult>) -> RetrieveTranscriptResponse {
        RetrieveTranscriptResponse {
            format,
            job: Box::new(job),
            metadata: Box::new(metadata),
            results,
            translations: None,
            summary: None,
            sentiment_analysis: None,
        }
    }
}