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
use Method;
use Deserialize;
use crate::;
/// List all translations locales for a project.
///
/// **Endpoint** `GET /api/v1/projects/{projectId}/translations`
///
/// **Default model** [`ProjectLocale`]
///
/// # Examples
/// ```
/// # use traduora::{Login, TestClient as Traduora, TraduoraError};
/// use chrono::{TimeZone, Utc};
/// use traduora::{api::translations::Locales, Query};
///
/// # let login = Login::password("tester@mail.example", "letmeinpls");
/// let client = Traduora::with_auth("localhost:8080", login)?;
/// let project = "b1001dd9-e1c0-4fb0-a60d-eaaec304d332".into();
/// let locales = Locales(project).query(&client)?;
///
/// assert_eq!(locales.len(), 2);
/// assert_eq!(locales[0].locale.code, "de_DE".into());
/// assert_eq!(locales[0].id.value(), "91ea2d61-8e14-481f-af19-9ae16bbf95a3");
/// assert_eq!(locales[0].date.created, Utc.ymd(2021, 10, 26).and_hms_milli(20, 15, 54, 194));
/// assert_eq!(locales[0].date.modified, Utc.ymd(2021, 10, 26).and_hms_milli(20, 15, 54, 194));
///
/// assert_eq!(locales[1].locale.code, "en".into());
/// assert_eq!(locales[1].id.value(), "38c02384-9be0-4308-aac6-056f1d7b0a08");
/// assert_eq!(locales[1].date.created, Utc.ymd(2021, 10, 26).and_hms_milli(20, 16, 03, 781));
/// assert_eq!(locales[1].date.modified, Utc.ymd(2021, 10, 26).and_hms_milli(20, 16, 03, 781));
/// # Ok::<(), TraduoraError>(())
/// ```
;
impl_wrapper!;
/// A project's locale. Contains a generic [`Locale`] as well
/// as an id and creation/modification times.
///
/// Default model.
///
/// **Endpoint**
/// - `GET /api/v1/projects/{projectId}/translations`