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
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
//! The data types sent to and returned from the API client.
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

/// Rev.ai Account Model
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Account {
    /**
     * Rev.ai Account Model
     */
    #[serde(
        default,
        skip_serializing_if = "crate::utils::zero_i64",
        deserialize_with = "crate::utils::deserialize_null_i64::deserialize"
    )]
    pub balance_seconds: i64,
    /**
     * Rev.ai Account Model
     */
    #[serde(
        default,
        skip_serializing_if = "String::is_empty",
        deserialize_with = "crate::utils::deserialize_null_string::deserialize"
    )]
    pub email: String,
}

#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct DescriptionlessJobOptions {
    /**
     * Email of developer account
     */
    #[serde(
        default,
        skip_serializing_if = "String::is_empty",
        deserialize_with = "crate::utils::deserialize_null_string::deserialize"
    )]
    pub metadata: String,
}

#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct DescriptionlessJobOptionsData {
    /**
     * Email of developer account
     */
    #[serde(
        default,
        skip_serializing_if = "String::is_empty",
        deserialize_with = "crate::utils::deserialize_null_string::deserialize"
    )]
    pub callback_url: String,
}

#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub enum Language {
    #[serde(rename = "ar")]
    Ar,
    #[serde(rename = "bg")]
    Bg,
    #[serde(rename = "ca")]
    Ca,
    #[serde(rename = "cmn")]
    Cmn,
    #[serde(rename = "cs")]
    Cs,
    #[serde(rename = "da")]
    Da,
    #[serde(rename = "de")]
    De,
    #[serde(rename = "el")]
    El,
    #[serde(rename = "en")]
    En,
    #[serde(rename = "es")]
    Es,
    #[serde(rename = "fi")]
    Fi,
    #[serde(rename = "fr")]
    Fr,
    #[serde(rename = "hi")]
    Hi,
    #[serde(rename = "hr")]
    Hr,
    #[serde(rename = "hu")]
    Hu,
    #[serde(rename = "it")]
    It,
    #[serde(rename = "ja")]
    Ja,
    #[serde(rename = "ko")]
    Ko,
    #[serde(rename = "lt")]
    Lt,
    #[serde(rename = "lv")]
    Lv,
    #[serde(rename = "ms")]
    Ms,
    #[serde(rename = "nl")]
    Nl,
    #[serde(rename = "no")]
    No,
    #[serde(rename = "pl")]
    Pl,
    #[serde(rename = "pt")]
    Pt,
    #[serde(rename = "ro")]
    Ro,
    #[serde(rename = "ru")]
    Ru,
    #[serde(rename = "sk")]
    Sk,
    #[serde(rename = "sl")]
    Sl,
    #[serde(rename = "sv")]
    Sv,
    #[serde(rename = "tr")]
    Tr,
    #[serde(other)]
    FallthroughString,
}

impl std::fmt::Display for Language {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match &*self {
            Language::Ar => "ar",
            Language::Bg => "bg",
            Language::Ca => "ca",
            Language::Cmn => "cmn",
            Language::Cs => "cs",
            Language::Da => "da",
            Language::De => "de",
            Language::El => "el",
            Language::En => "en",
            Language::Es => "es",
            Language::Fi => "fi",
            Language::Fr => "fr",
            Language::Hi => "hi",
            Language::Hr => "hr",
            Language::Hu => "hu",
            Language::It => "it",
            Language::Ja => "ja",
            Language::Ko => "ko",
            Language::Lt => "lt",
            Language::Lv => "lv",
            Language::Ms => "ms",
            Language::Nl => "nl",
            Language::No => "no",
            Language::Pl => "pl",
            Language::Pt => "pt",
            Language::Ro => "ro",
            Language::Ru => "ru",
            Language::Sk => "sk",
            Language::Sl => "sl",
            Language::Sv => "sv",
            Language::Tr => "tr",
            Language::FallthroughString => "*",
        }
        .fmt(f)
    }
}

impl Default for Language {
    fn default() -> Language {
        Language::En
    }
}

#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct DescriptionlessJobOptionsDataType {
    /**
     * Email of developer account
     */
    #[serde(
        default,
        skip_serializing_if = "String::is_empty",
        deserialize_with = "crate::utils::deserialize_null_string::deserialize"
    )]
    pub custom_vocabulary_id: String,
    /**
     * Amount of Rev.ai API credits remaining in seconds
     */
    #[serde(
        default,
        skip_serializing_if = "crate::utils::zero_i64",
        deserialize_with = "crate::utils::deserialize_null_i64::deserialize"
    )]
    pub delete_after_seconds: i64,
    #[serde(
        default,
        deserialize_with = "crate::utils::deserialize_null_boolean::deserialize"
    )]
    pub filter_profanity: bool,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub language: Option<Language>,
    /**
     * Email of developer account
     */
    #[serde(
        default,
        skip_serializing_if = "String::is_empty",
        deserialize_with = "crate::utils::deserialize_null_string::deserialize"
    )]
    pub media_url: String,
    #[serde(
        default,
        deserialize_with = "crate::utils::deserialize_null_boolean::deserialize"
    )]
    pub remove_disfluencies: bool,
    #[serde(
        default,
        deserialize_with = "crate::utils::deserialize_null_boolean::deserialize"
    )]
    pub skip_diarization: bool,
    #[serde(
        default,
        deserialize_with = "crate::utils::deserialize_null_boolean::deserialize"
    )]
    pub skip_punctuation: bool,
    /**
     * Amount of Rev.ai API credits remaining in seconds
     */
    #[serde(
        default,
        skip_serializing_if = "crate::utils::zero_i64",
        deserialize_with = "crate::utils::deserialize_null_i64::deserialize"
    )]
    pub speaker_channels_count: i64,
}

/// All of the following types are flattened into one object:
///
/// - `DescriptionlessJobOptions`
/// - `DescriptionlessJobOptionsData`
/// - `DescriptionlessJobOptionsDataType`
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct DescriptionlessJobOptionsAllOf {
    #[serde(flatten)]
    pub descriptionless_job_options: DescriptionlessJobOptions,
    #[serde(flatten)]
    pub descriptionless_job_options_data: DescriptionlessJobOptionsData,
    #[serde(flatten)]
    pub descriptionless_job_options_data_type: DescriptionlessJobOptionsDataType,
}

/**
 * Simple reason of why the transcription job failed. Check `failure_detail` for specific details and solutions
 */
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub enum Failure {
    #[serde(rename = "download_failure")]
    DownloadFailure,
    #[serde(rename = "duration_exceeded")]
    DurationExceeded,
    #[serde(rename = "duration_too_short")]
    DurationTooShort,
    #[serde(rename = "empty_media")]
    EmptyMedia,
    #[serde(rename = "insufficient_balance")]
    InsufficientBalance,
    #[serde(rename = "internal_processing")]
    InternalProcessing,
    #[serde(rename = "invalid_media")]
    InvalidMedia,
    #[serde(rename = "invoicing_limit_exceeded")]
    InvoicingLimitExceeded,
    #[serde(rename = "transcription")]
    Transcription,
    #[serde(rename = "")]
    Noop,
    #[serde(other)]
    FallthroughString,
}

impl std::fmt::Display for Failure {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match &*self {
            Failure::DownloadFailure => "download_failure",
            Failure::DurationExceeded => "duration_exceeded",
            Failure::DurationTooShort => "duration_too_short",
            Failure::EmptyMedia => "empty_media",
            Failure::InsufficientBalance => "insufficient_balance",
            Failure::InternalProcessing => "internal_processing",
            Failure::InvalidMedia => "invalid_media",
            Failure::InvoicingLimitExceeded => "invoicing_limit_exceeded",
            Failure::Transcription => "transcription",
            Failure::Noop => "",
            Failure::FallthroughString => "*",
        }
        .fmt(f)
    }
}

impl Default for Failure {
    fn default() -> Failure {
        Failure::Noop
    }
}
impl Failure {
    pub fn is_noop(&self) -> bool {
        matches!(self, Failure::Noop)
    }
}

/**
 * Current status of the job
 */
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub enum Status {
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "in_progress")]
    InProgress,
    #[serde(rename = "transcribed")]
    Transcribed,
    #[serde(rename = "")]
    Noop,
    #[serde(other)]
    FallthroughString,
}

impl std::fmt::Display for Status {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match &*self {
            Status::Failed => "failed",
            Status::InProgress => "in_progress",
            Status::Transcribed => "transcribed",
            Status::Noop => "",
            Status::FallthroughString => "*",
        }
        .fmt(f)
    }
}

impl Default for Status {
    fn default() -> Status {
        Status::Noop
    }
}
impl Status {
    pub fn is_noop(&self) -> bool {
        matches!(self, Status::Noop)
    }
}

/**
 * Type of speech recognition performed. Currently the only supported values are 'async' for asynchronous jobs and `stream` for streaming jobs
 */
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub enum Type {
    #[serde(rename = "async")]
    Async,
    #[serde(rename = "")]
    Noop,
    #[serde(other)]
    FallthroughString,
}

impl std::fmt::Display for Type {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match &*self {
            Type::Async => "async",
            Type::Noop => "",
            Type::FallthroughString => "*",
        }
        .fmt(f)
    }
}

impl Default for Type {
    fn default() -> Type {
        Type::Noop
    }
}
impl Type {
    pub fn is_noop(&self) -> bool {
        matches!(self, Type::Noop)
    }
}

/// Rev.ai Transcription Job
/// ***
/// Note: properties are not displayed in the returned object if they are null
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Job {
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub callback_url: Option<serde_json::Value>,
    /**
     * The date and time the job was completed, whether successfully or failing, in ISO-8601 UTC form
     */
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        deserialize_with = "crate::utils::date_time_format::deserialize"
    )]
    pub completed_on: Option<chrono::DateTime<chrono::Utc>>,
    /**
     * The date and time the job was completed, whether successfully or failing, in ISO-8601 UTC form
     */
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        deserialize_with = "crate::utils::date_time_format::deserialize"
    )]
    pub created_on: Option<chrono::DateTime<chrono::Utc>>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub custom_vocabulary_id: Option<serde_json::Value>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub delete_after_seconds: Option<serde_json::Value>,
    /**
     * Duration of the file in seconds. Null if the file could not be retrieved or there was not a valid media file
     */
    #[serde(
        default,
        skip_serializing_if = "crate::utils::zero_f64",
        deserialize_with = "crate::utils::deserialize_null_f64::deserialize"
    )]
    pub duration_seconds: f64,
    /**
     * Simple reason of why the transcription job failed. Check `failure_detail` for specific details and solutions
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub failure: Option<Failure>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(
        default,
        skip_serializing_if = "String::is_empty",
        deserialize_with = "crate::utils::deserialize_null_string::deserialize"
    )]
    pub failure_detail: String,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub filter_profanity: Option<serde_json::Value>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(
        default,
        skip_serializing_if = "String::is_empty",
        deserialize_with = "crate::utils::deserialize_null_string::deserialize"
    )]
    pub id: String,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub language: Option<serde_json::Value>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub media_url: Option<serde_json::Value>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<serde_json::Value>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(
        default,
        skip_serializing_if = "String::is_empty",
        deserialize_with = "crate::utils::deserialize_null_string::deserialize"
    )]
    pub name: String,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub remove_disfluencies: Option<serde_json::Value>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub skip_diarization: Option<serde_json::Value>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub skip_punctuation: Option<serde_json::Value>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub speaker_channels_count: Option<serde_json::Value>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub type_: Option<Type>,
}

/// All of the following types are flattened into one object:
///
/// - `DescriptionlessJobOptionsAllOf`
/// - `Job`
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct JobAllOf {
    #[serde(flatten)]
    pub descriptionless_job_options_all_of: DescriptionlessJobOptionsAllOf,
    /**
     * Rev.ai Transcription Job
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *
     */
    #[serde(flatten)]
    pub job: Job,
}

#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct SubmitJobMediaUrlOptions {
    /**
     * Email of developer account
     */
    #[serde(
        default,
        skip_serializing_if = "String::is_empty",
        deserialize_with = "crate::utils::deserialize_null_string::deserialize"
    )]
    pub media_url: String,
}

/// All of the following types are flattened into one object:
///
/// - `SubmitJobMediaUrlOptions`
/// - `SubmitJobOptionsAllOf`
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct SubmitJobMediaUrlOptionsAllOf {
    #[serde(flatten)]
    pub submit_job_media_url_options: SubmitJobMediaUrlOptions,
    #[serde(flatten)]
    pub submit_job_options_all_of: SubmitJobOptionsAllOf,
}

/// Rev.ai Job Options Object Model
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct SubmitJobOptions {
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub callback_url: Option<serde_json::Value>,
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub custom_vocabulary_id: Option<serde_json::Value>,
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub delete_after_seconds: Option<serde_json::Value>,
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub filter_profanity: Option<serde_json::Value>,
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub language: Option<serde_json::Value>,
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<serde_json::Value>,
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub remove_disfluencies: Option<serde_json::Value>,
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub skip_diarization: Option<serde_json::Value>,
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub skip_punctuation: Option<serde_json::Value>,
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub speaker_channels_count: Option<serde_json::Value>,
}

/// Contains a collection of phrases. Custom vocabulary informs and biases the speech recognition to find those phrases (at the cost of slightly slower transcription).
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct CustomVocabularies {
    /**
     * Array of phrases not found in normal dictionary. Add technical jargon, proper nouns and uncommon phrases as strings in this array to add them to the lexicon for this job.
     *  
     *  A phrase must contain at least 1 alpha character but may contain any non-numeric character from the Basic Latin set. A phrase can contain up to 12 words. Each word can contain up to 34 characters.
     *  
     *  \*\*Note\*\*: Only 6000 phrases can be used per transcription job. For more details, check [Custom Vocabularies](https://www.rev.ai/docs/overview#section/Features/Custom-Vocabularies).
     *
     */
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
    )]
    pub phrases: Vec<String>,
}

#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct SubmitJobOptionsData {
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
    )]
    pub custom_vocabularies: Vec<CustomVocabularies>,
}

/// All of the following types are flattened into one object:
///
/// - `DescriptionlessJobOptionsAllOf`
/// - `SubmitJobOptions`
/// - `SubmitJobOptionsData`
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct SubmitJobOptionsAllOf {
    #[serde(flatten)]
    pub descriptionless_job_options_all_of: DescriptionlessJobOptionsAllOf,
    /**
     * Rev.ai Job Options Object Model
     */
    #[serde(flatten)]
    pub submit_job_options: SubmitJobOptions,
    #[serde(flatten)]
    pub submit_job_options_data: SubmitJobOptionsData,
}

/**
 * Type of transcript element. If Rev.ai was unable to determine the spoken word, the `type` will be `unknown`.
 */
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub enum TranscriptMonologuesElementsType {
    #[serde(rename = "punct")]
    Punct,
    #[serde(rename = "text")]
    Text,
    #[serde(rename = "unknown")]
    Unknown,
    #[serde(rename = "")]
    Noop,
    #[serde(other)]
    FallthroughString,
}

impl std::fmt::Display for TranscriptMonologuesElementsType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match &*self {
            TranscriptMonologuesElementsType::Punct => "punct",
            TranscriptMonologuesElementsType::Text => "text",
            TranscriptMonologuesElementsType::Unknown => "unknown",
            TranscriptMonologuesElementsType::Noop => "",
            TranscriptMonologuesElementsType::FallthroughString => "*",
        }
        .fmt(f)
    }
}

impl Default for TranscriptMonologuesElementsType {
    fn default() -> TranscriptMonologuesElementsType {
        TranscriptMonologuesElementsType::Noop
    }
}
impl TranscriptMonologuesElementsType {
    pub fn is_noop(&self) -> bool {
        matches!(self, TranscriptMonologuesElementsType::Noop)
    }
}

#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Elements {
    /**
     * Duration of the file in seconds. Null if the file could not be retrieved or there was not a valid media file
     */
    #[serde(
        default,
        skip_serializing_if = "crate::utils::zero_f64",
        deserialize_with = "crate::utils::deserialize_null_f64::deserialize"
    )]
    pub confidence: f64,
    /**
     * Duration of the file in seconds. Null if the file could not be retrieved or there was not a valid media file
     */
    #[serde(
        default,
        skip_serializing_if = "crate::utils::zero_f64",
        deserialize_with = "crate::utils::deserialize_null_f64::deserialize"
    )]
    pub ts: f64,
    /**
     * Duration of the file in seconds. Null if the file could not be retrieved or there was not a valid media file
     */
    #[serde(
        default,
        skip_serializing_if = "crate::utils::zero_f64",
        deserialize_with = "crate::utils::deserialize_null_f64::deserialize"
    )]
    pub ts_end: f64,
    /**
     * Type of transcript element. If Rev.ai was unable to determine the spoken word, the `type` will be `unknown`.
     */
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub type_: Option<TranscriptMonologuesElementsType>,
    /**
     * Email of developer account
     */
    #[serde(
        default,
        skip_serializing_if = "String::is_empty",
        deserialize_with = "crate::utils::deserialize_null_string::deserialize"
    )]
    pub value: String,
}

#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Monologues {
    /**
     * Array of transcript elements
     */
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
    )]
    pub elements: Vec<Elements>,
    /**
     * Amount of Rev.ai API credits remaining in seconds
     */
    #[serde(
        default,
        skip_serializing_if = "crate::utils::zero_i64",
        deserialize_with = "crate::utils::deserialize_null_i64::deserialize"
    )]
    pub speaker: i64,
}

/// Rev.ai Transcript Model
/// ***
/// Note: properties are not displayed in the returned object if they are null
///
/// Jobs with skip_diarization set to true will only show a single speaker for the entire duration of the transcript.
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub struct Transcript {
    /**
     * Rev.ai Transcript Model
     *  \*\*\*
     *  Note: properties are not displayed in the returned object if they are null
     *  
     *  Jobs with skip_diarization set to true will only show a single speaker for the entire duration of the transcript.
     *
     */
    #[serde(
        default,
        skip_serializing_if = "Vec::is_empty",
        deserialize_with = "crate::utils::deserialize_null_vector::deserialize"
    )]
    pub monologues: Vec<Monologues>,
}

/**
 * MIME type specifying the caption output format
 */
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub enum Accept {
    #[serde(rename = "application/x-subrip")]
    ApplicationXSubrip,
    #[serde(rename = "text/vtt")]
    TextVtt,
    #[serde(rename = "")]
    Noop,
    #[serde(other)]
    FallthroughString,
}

impl std::fmt::Display for Accept {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match &*self {
            Accept::ApplicationXSubrip => "application/x-subrip",
            Accept::TextVtt => "text/vtt",
            Accept::Noop => "",
            Accept::FallthroughString => "*",
        }
        .fmt(f)
    }
}

impl Default for Accept {
    fn default() -> Accept {
        Accept::Noop
    }
}
impl Accept {
    pub fn is_noop(&self) -> bool {
        matches!(self, Accept::Noop)
    }
}

/**
 * MIME type specifying the transcription output format
 */
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone, JsonSchema)]
pub enum AcceptTranscript {
    #[serde(rename = "application/vnd.rev.transcript.v1.0+json")]
    ApplicationVndRevTranscript0Json,
    #[serde(rename = "text/plain")]
    TextPlain,
    #[serde(rename = "")]
    Noop,
    #[serde(other)]
    FallthroughString,
}

impl std::fmt::Display for AcceptTranscript {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match &*self {
            AcceptTranscript::ApplicationVndRevTranscript0Json => {
                "application/vnd.rev.transcript.v1.0+json"
            }
            AcceptTranscript::TextPlain => "text/plain",
            AcceptTranscript::Noop => "",
            AcceptTranscript::FallthroughString => "*",
        }
        .fmt(f)
    }
}

impl Default for AcceptTranscript {
    fn default() -> AcceptTranscript {
        AcceptTranscript::Noop
    }
}
impl AcceptTranscript {
    pub fn is_noop(&self) -> bool {
        matches!(self, AcceptTranscript::Noop)
    }
}