1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use serde::{Deserialize, Serialize};

#[derive(Serialize, Debug)]
pub struct DetectLanguageRequest<'input> {
    /// List of detected languages, one per text
    pub texts: &'input [String],
}

#[derive(Deserialize, Debug)]
pub(crate) struct DetectLanguageResponse {
    /// List of detected languages, one per text
    pub results: Vec<DetectLanguageResult>,
}

#[derive(Deserialize, Debug, PartialEq)]
pub struct DetectLanguageResult {
    /// Name of the language, e.g. "Spanish"
    pub language_name: String,
    /// Code of the language, e.g. "es"
    pub language_code: String,
}