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
use Method;
use Term;
use crate::;
/// List a project's terms.
///
/// **Endpoint** `GET /api/v1/projects/{projectId}/terms`
///
/// **Default model** [`Term`]
///
/// # Examples
/// ```
/// # use traduora::{Login, TestClient as Traduora, TraduoraError};
/// use chrono::{TimeZone, Utc};
/// use traduora::{api::terms::Terms, api::labels::Label, Query};
///
/// # let login = Login::password("tester@mail.example", "letmeinpls");
/// let client = Traduora::with_auth("localhost:8080", login)?;
/// let terms = Terms("b1001dd9-e1c0-4fb0-a60d-eaaec304d332".into()).query(&client)?;
///
/// assert_eq!(terms.len(), 2);
/// assert_eq!(terms[0].value, "this.is.a.term");
/// assert_eq!(
/// terms[0].labels,
/// vec![Label {
/// id: "c16d0fc3-73e6-4962-b8d5-f3054b8ff002".into(),
/// value: "Example label".into(),
/// color: "#D81159".into()
/// }]
/// );
/// assert_eq!(terms[0].id.value(), "38ba819e-8023-464b-aa1b-6177c149f888");
/// assert_eq!(terms[0].date.created, Utc.ymd(2021, 10, 24).and_hms_milli(18, 43, 12, 131));
/// assert_eq!(terms[0].date.modified, Utc.ymd(2021, 10, 24).and_hms_milli(18, 43, 12, 131));
///
/// assert_eq!(terms[1].value, "this.is.another.term");
/// assert!(terms[1].labels.is_empty());
/// assert_eq!(terms[1].id.value(), "7eafe83d-1448-49ea-8ae0-f8753cbd669c");
/// assert_eq!(terms[1].date.created, Utc.ymd(2021, 10, 24).and_hms_milli(20, 02, 07, 952));
/// assert_eq!(terms[1].date.modified, Utc.ymd(2021, 10, 24).and_hms_milli(20, 02, 07, 952));
/// # Ok::<(), TraduoraError>(())
/// ```
;