1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* 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};
/// JobDetails : Document describing a job, including the status and config used. This model will be returned when you get job details or list all jobs.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JobDetails {
/// The UTC date time the job was created.
#[serde(rename = "created_at")]
pub created_at: String,
/// Name of the data file submitted for job.
#[serde(rename = "data_name")]
pub data_name: 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>,
/// The file duration (in seconds). May be missing for fetch URL jobs.
#[serde(rename = "duration", skip_serializing_if = "Option::is_none")]
pub duration: Option<i32>,
/// The unique id assigned to the job.
#[serde(rename = "id")]
pub id: String,
/// The status of the job. - `running` - The job is actively running - `done` - The job completed successfully. - `rejected` - The job was accepted at first, but later could not be processed by the transcriber. - `deleted` - The user deleted the job. - `expired` - The system deleted the job. Usually because the job was in the `done` state for a very long time.
#[serde(rename = "status")]
pub status: Status,
#[serde(rename = "config", skip_serializing_if = "Option::is_none")]
pub config: Option<Box<models::JobConfig>>,
/// Optional parameter used for backwards compatibility with v1 api
#[serde(rename = "lang", skip_serializing_if = "Option::is_none")]
pub lang: Option<String>,
/// Optional list of errors that have occurred in user interaction, for example: audio could not be fetched or notification could not be sent.
#[serde(rename = "errors", skip_serializing_if = "Option::is_none")]
pub errors: Option<Vec<models::JobDetailError>>,
}
impl JobDetails {
/// Document describing a job, including the status and config used. This model will be returned when you get job details or list all jobs.
pub fn new(created_at: String, data_name: String, id: String, status: Status) -> JobDetails {
JobDetails {
created_at,
data_name,
text_name: None,
duration: None,
id,
status,
config: None,
lang: None,
errors: None,
}
}
}
/// The status of the job. - `running` - The job is actively running - `done` - The job completed successfully. - `rejected` - The job was accepted at first, but later could not be processed by the transcriber. - `deleted` - The user deleted the job. - `expired` - The system deleted the job. Usually because the job was in the `done` state for a very long time.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "running")]
Running,
#[serde(rename = "done")]
Done,
#[serde(rename = "rejected")]
Rejected,
#[serde(rename = "deleted")]
Deleted,
#[serde(rename = "expired")]
Expired,
}
impl Default for Status {
fn default() -> Status {
Self::Running
}
}