polyglotlib/dto/
translate_request.rs

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

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct TranslateRequest {
    pub q: String,
    pub source: String,
    pub target: String,
    pub format: Option<String>,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct TranslateFromTextRequest {
    pub source: String,
    pub target: String,
    pub format: Option<String>,
    pub text: String,
    pub kind: String,
    pub title: String,
    pub category_id: Uuid,
}