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

/// JobConfig : JSON object that contains various groups of job configuration parameters.  Based on the value of `type`, a type-specific object such as `transcription_config` is required to be present to specify all configuration settings or parameters needed to process the job inputs as expected.  If the results of the job are to be forwarded on completion, `notification_config` can be provided with a list of callbacks to be made; no assumptions should be made about the order in which they will occur.  Customer specific job details or metadata can be supplied in `tracking`, and this information will be available where possible in the job results and in callbacks. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JobConfig {
    #[serde(rename = "type")]
    pub type_value: models::JobType,
    #[serde(rename = "fetch_data", skip_serializing_if = "Option::is_none")]
    pub fetch_data: Option<Box<models::DataFetchConfig>>,
    #[serde(rename = "fetch_text", skip_serializing_if = "Option::is_none")]
    pub fetch_text: Option<Box<models::DataFetchConfig>>,
    #[serde(rename = "alignment_config", skip_serializing_if = "Option::is_none")]
    pub alignment_config: Option<Box<models::AlignmentConfig>>,
    #[serde(rename = "transcription_config", skip_serializing_if = "Option::is_none")]
    pub transcription_config: Option<Box<models::TranscriptionConfig>>,
    #[serde(rename = "notification_config", skip_serializing_if = "Option::is_none")]
    pub notification_config: Option<Vec<models::NotificationConfig>>,
    #[serde(rename = "tracking", skip_serializing_if = "Option::is_none")]
    pub tracking: Option<Box<models::TrackingData>>,
    #[serde(rename = "output_config", skip_serializing_if = "Option::is_none")]
    pub output_config: Option<Box<models::OutputConfig>>,
    #[serde(rename = "translation_config", skip_serializing_if = "Option::is_none")]
    pub translation_config: Option<Box<models::TranslationConfig>>,
    #[serde(rename = "language_identification_config", skip_serializing_if = "Option::is_none")]
    pub language_identification_config: Option<Box<models::LanguageIdentificationConfig>>,
    #[serde(rename = "summarization_config", skip_serializing_if = "Option::is_none")]
    pub summarization_config: Option<Box<models::SummarizationConfig>>,
    #[serde(rename = "sentiment_analysis_config", skip_serializing_if = "Option::is_none")]
    pub sentiment_analysis_config: Option<serde_json::Value>,
}

impl JobConfig {
    /// JSON object that contains various groups of job configuration parameters.  Based on the value of `type`, a type-specific object such as `transcription_config` is required to be present to specify all configuration settings or parameters needed to process the job inputs as expected.  If the results of the job are to be forwarded on completion, `notification_config` can be provided with a list of callbacks to be made; no assumptions should be made about the order in which they will occur.  Customer specific job details or metadata can be supplied in `tracking`, and this information will be available where possible in the job results and in callbacks. 
    pub fn new(type_value: models::JobType) -> JobConfig {
        JobConfig {
            type_value,
            fetch_data: None,
            fetch_text: None,
            alignment_config: None,
            transcription_config: None,
            notification_config: None,
            tracking: None,
            output_config: None,
            translation_config: None,
            language_identification_config: None,
            summarization_config: None,
            sentiment_analysis_config: None,
        }
    }
}