forked from crowdin/crowdin-api-client-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGlossariesApi.java
More file actions
455 lines (417 loc) · 25.7 KB
/
GlossariesApi.java
File metadata and controls
455 lines (417 loc) · 25.7 KB
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
package com.crowdin.client.glossaries;
import com.crowdin.client.core.CrowdinApi;
import com.crowdin.client.core.http.HttpRequestConfig;
import com.crowdin.client.core.http.exceptions.HttpBadRequestException;
import com.crowdin.client.core.http.exceptions.HttpException;
import com.crowdin.client.core.model.*;
import com.crowdin.client.glossaries.model.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
public class GlossariesApi extends CrowdinApi {
public GlossariesApi(Credentials credentials) {
super(credentials);
}
public GlossariesApi(Credentials credentials, ClientConfig clientConfig) {
super(credentials, clientConfig);
}
/**
* @param projectId project identifier
* @param request request object
* @return list of search results
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.projects.glossaries.concordance.post" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.glossaries.concordance.post" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseList<SearchConcordance> searchConcordance(Long projectId, SearchConcordanceRequest request) {
SearchConcordanceResponseList searchConcordanceResponseList =
this.httpClient.post(this.url + "/projects/" + projectId + "/glossaries/concordance", request, new HttpRequestConfig(), SearchConcordanceResponseList.class);
return SearchConcordanceResponseList.of(searchConcordanceResponseList);
}
/**
* @param glossaryId glossary identifier
* @param limit maximum number of items to retrieve (default 25)
* @param offset starting offset in the collection (default 0)
* @return list of concepts
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.getMany" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.concepts.getMany" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseList<Concept> listConcepts(Long glossaryId, Integer limit, Integer offset) throws HttpException, HttpBadRequestException {
ListConceptsParams params = new ListConceptsParams();
params.setLimit(limit);
params.setOffset(offset);
return listConcepts(glossaryId, params);
}
/**
* @param glossaryId glossary identifier
* @param limit maximum number of items to retrieve (default 25)
* @param offset starting offset in the collection (default 0)
* @param orderBy list of OrderByFields
* @return list of concepts
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.getMany" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.concepts.getMany" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseList<Concept> listConcepts(Long glossaryId, Integer limit, Integer offset, List<OrderByField> orderBy) throws HttpException, HttpBadRequestException {
ListConceptsParams params = new ListConceptsParams();
params.setLimit(limit);
params.setOffset(offset);
params.setOrderByList(orderBy);
return listConcepts(glossaryId, params);
}
public ResponseList<Concept> listConcepts(Long glossaryId, ListConceptsParams params) throws HttpException, HttpBadRequestException {
ListConceptsParams query = Optional.ofNullable(params).orElse(new ListConceptsParams());
String orderBy = query.getOrderByList() != null
? OrderByField.generateSortParam(query.getOrderByList())
: query.getOrderBy();
Map<String, Optional<Object>> queryParams = HttpRequestConfig.buildUrlParams(
"orderBy", Optional.ofNullable(orderBy),
"limit", Optional.ofNullable(query.getLimit()),
"offset", Optional.ofNullable(query.getOffset())
);
ConceptResponseList conceptResponseList = this.httpClient.get(this.url + "/glossaries/" + glossaryId + "/concepts", new HttpRequestConfig(queryParams), ConceptResponseList.class);
return ConceptResponseList.to(conceptResponseList);
}
/**
* @param glossaryId glossary identifier
* @param conceptId concept identifier
* @return concept
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.get" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.concepts.get" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<Concept> getConcept(Long glossaryId, Long conceptId) throws HttpException, HttpBadRequestException {
ConceptResponseObject conceptResponseObject = this.httpClient.get(this.url + "/glossaries/" + glossaryId + "/concepts/" + conceptId, new HttpRequestConfig(), ConceptResponseObject.class);
return ResponseObject.of(conceptResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @param conceptId concept identifier
* @param request request object
* @return updated concept
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.put" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.concepts.put" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<Concept> updateConcept(Long glossaryId, Long conceptId, Concept request) throws HttpException, HttpBadRequestException {
ConceptResponseObject conceptResponseObject = this.httpClient.put(this.url + "/glossaries/" + glossaryId + "/concepts/" + conceptId, request, new HttpRequestConfig(), ConceptResponseObject.class);
return ResponseObject.of(conceptResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @param conceptId concept identifier
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.delete" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.concepts.delete" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public void deleteConcept(Long glossaryId, Long conceptId) throws HttpException, HttpBadRequestException {
this.httpClient.delete(this.url + "/glossaries/" + glossaryId + "/concepts/" + conceptId, new HttpRequestConfig(), Void.class);
}
/**
* @param groupId group identifier
* @param limit maximum number of items to retrieve (default 25)
* @param offset starting offset in the collection (default 0)
* @return list of glossaries
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.getMany" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.getMany" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseList<Glossary> listGlossaries(Long groupId, Integer limit, Integer offset) throws HttpException, HttpBadRequestException {
ListGlossariesParams params = new ListGlossariesParams();
params.setGroupId(groupId);
params.setLimit(limit);
params.setOffset(offset);
return listGlossaries(params);
}
/**
* @param groupId group identifier
* @param limit maximum number of items to retrieve (default 25)
* @param offset starting offset in the collection (default 0)
* @param orderBy list of OrderByField
* @return list of glossaries
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.getMany" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.getMany" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseList<Glossary> listGlossaries(Long groupId, Integer limit, Integer offset, List<OrderByField> orderBy) throws HttpException, HttpBadRequestException {
ListGlossariesParams params = new ListGlossariesParams();
params.setGroupId(groupId);
params.setLimit(limit);
params.setOffset(offset);
params.setOrderByList(orderBy);
return listGlossaries(params);
}
public ResponseList<Glossary> listGlossaries(ListGlossariesParams params) throws HttpException, HttpBadRequestException {
ListGlossariesParams query = Optional.ofNullable(params).orElse(new ListGlossariesParams());
String orderBy = query.getOrderByList() != null
? OrderByField.generateSortParam(query.getOrderByList())
: query.getOrderBy();
Map<String, Optional<Object>> queryParams = HttpRequestConfig.buildUrlParams(
"groupId", Optional.ofNullable(query.getGroupId()),
"userId", Optional.ofNullable(query.getUserId()),
"limit", Optional.ofNullable(query.getLimit()),
"offset", Optional.ofNullable(query.getOffset()),
"orderBy", Optional.ofNullable(orderBy)
);
GlossaryResponseList glossaryResponseList = this.httpClient.get(this.url + "/glossaries", new HttpRequestConfig(queryParams), GlossaryResponseList.class);
return GlossaryResponseList.to(glossaryResponseList);
}
/**
* @param request request object
* @return newly created glossary
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.post" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.post" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<Glossary> addGlossary(AddGlossaryRequest request) throws HttpException, HttpBadRequestException {
GlossaryResponseObject glossaryResponseObject = this.httpClient.post(this.url + "/glossaries", request, new HttpRequestConfig(), GlossaryResponseObject.class);
return ResponseObject.of(glossaryResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @return glossary
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.get" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.get" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<Glossary> getGlossary(Long glossaryId) throws HttpException, HttpBadRequestException {
GlossaryResponseObject glossaryResponseObject = this.httpClient.get(this.url + "/glossaries/" + glossaryId, new HttpRequestConfig(), GlossaryResponseObject.class);
return ResponseObject.of(glossaryResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.delete" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.delete" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public void deleteGlossary(Long glossaryId) throws HttpException, HttpBadRequestException {
this.httpClient.delete(this.url + "/glossaries/" + glossaryId, new HttpRequestConfig(), Void.class);
}
/**
* @param glossaryId glossary identifier
* @param request request object
* @return updated glossary
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.patch" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.patch" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<Glossary> editGlossary(Long glossaryId, List<PatchRequest> request) throws HttpException, HttpBadRequestException {
GlossaryResponseObject glossaryResponseObject = this.httpClient.patch(this.url + "/glossaries/" + glossaryId, request, new HttpRequestConfig(), GlossaryResponseObject.class);
return ResponseObject.of(glossaryResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @param request request object
* @return export status
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.exports.post" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.exports.post" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<GlossaryExportStatus> exportGlossary(Long glossaryId, ExportGlossaryRequest request) throws HttpException, HttpBadRequestException {
GlossaryExportStatusResponseObject glossaryExportStatusResponseObject = this.httpClient.post(this.url + "/glossaries/" + glossaryId + "/exports", request, new HttpRequestConfig(), GlossaryExportStatusResponseObject.class);
return ResponseObject.of(glossaryExportStatusResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @param exportId export identifier
* @return export status
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.exports.get" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.exports.get" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<GlossaryExportStatus> checkGlossaryExportStatus(Long glossaryId, String exportId) throws HttpException, HttpBadRequestException {
GlossaryExportStatusResponseObject glossaryExportStatusResponseObject = this.httpClient.get(this.url + "/glossaries/" + glossaryId + "/exports/" + exportId, new HttpRequestConfig(), GlossaryExportStatusResponseObject.class);
return ResponseObject.of(glossaryExportStatusResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @param exportId export identifier
* @return download link
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.exports.download.download" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.exports.download.download" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<DownloadLink> downloadGlossary(Long glossaryId, String exportId) throws HttpException, HttpBadRequestException {
DownloadLinkResponseObject downloadLinkResponseObject = this.httpClient.get(this.url + "/glossaries/" + glossaryId + "/exports/" + exportId + "/download", new HttpRequestConfig(), DownloadLinkResponseObject.class);
return ResponseObject.of(downloadLinkResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @param request request object
* @return import status
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.imports.post" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.imports.post" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<GlossaryImportStatus> importGlossary(Long glossaryId, ImportGlossaryRequest request) throws HttpException, HttpBadRequestException {
GlossaryImportStatusResponseObject glossaryImportStatusResponseObject = this.httpClient.post(this.url + "/glossaries/" + glossaryId + "/imports", request, new HttpRequestConfig(), GlossaryImportStatusResponseObject.class);
return ResponseObject.of(glossaryImportStatusResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @param importId import identifier
* @return import status
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.imports.get" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.imports.get" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<GlossaryImportStatus> checkGlossaryImportStatus(Long glossaryId, String importId) throws HttpException, HttpBadRequestException {
GlossaryImportStatusResponseObject glossaryImportStatusResponseObject = this.httpClient.get(this.url + "/glossaries/" + glossaryId + "/imports/" + importId, new HttpRequestConfig(), GlossaryImportStatusResponseObject.class);
return ResponseObject.of(glossaryImportStatusResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @param userId user identifier
* @param languageId language identifier
* @param conceptId concept identifier
* @param translationOfTermId term identifier
* @param limit maximum number of items to retrieve (default 25)
* @param offset starting offset in the collection (default 0)
* @return list of terms
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.getMany" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.terms.getMany" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseList<Term> listTerms(Long glossaryId, Long userId, String languageId, Long conceptId, @Deprecated Long translationOfTermId, Integer limit, Integer offset) throws HttpException, HttpBadRequestException {
ListTermsParams params = new ListTermsParams();
params.setUserId(userId);
params.setLanguageId(languageId);
params.setConceptId(conceptId);
params.setTranslationOfTermId(translationOfTermId);
params.setLimit(limit);
params.setOffset(offset);
return listTerms(glossaryId, params);
}
/**
* @param glossaryId glossary identifier
* @param userId user identifier
* @param languageId language identifier
* @param conceptId concept identifier
* @param translationOfTermId term identifier
* @param limit maximum number of items to retrieve (default 25)
* @param offset starting offset in the collection (default 0)
* @param orderBy list of OrderByField
* @return list of terms
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.getMany" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.terms.getMany" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseList<Term> listTerms(Long glossaryId, Long userId, String languageId, Long conceptId, @Deprecated Long translationOfTermId, Integer limit, Integer offset, List<OrderByField> orderBy) throws HttpException, HttpBadRequestException {
ListTermsParams params = new ListTermsParams();
params.setUserId(userId);
params.setLanguageId(languageId);
params.setConceptId(conceptId);
params.setTranslationOfTermId(translationOfTermId);
params.setLimit(limit);
params.setOffset(offset);
params.setOrderByList(orderBy);
return listTerms(glossaryId, params);
}
public ResponseList<Term> listTerms(Long glossaryId, ListTermsParams params) throws HttpException, HttpBadRequestException {
ListTermsParams query = Optional.ofNullable(params).orElse(new ListTermsParams());
String orderBy = query.getOrderByList() != null
? OrderByField.generateSortParam(query.getOrderByList())
: query.getOrderBy();
Map<String, Optional<Object>> queryParams = HttpRequestConfig.buildUrlParams(
"orderBy", Optional.ofNullable(orderBy),
"userId", Optional.ofNullable(query.getUserId()),
"languageId", Optional.ofNullable(query.getLanguageId()),
"conceptId", Optional.ofNullable(query.getConceptId()),
"translationOfTermId", Optional.ofNullable(query.getTranslationOfTermId()),
"croql", Optional.ofNullable(query.getCroql()),
"limit", Optional.ofNullable(query.getLimit()),
"offset", Optional.ofNullable(query.getOffset())
);
TermResponseList termResponseList = this.httpClient.get(this.url + "/glossaries/" + glossaryId + "/terms", new HttpRequestConfig(queryParams), TermResponseList.class);
return TermResponseList.to(termResponseList);
}
/**
* @param glossaryId glossary identifier
* @param request request object
* @return newly created term
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.post" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.terms.post" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<Term> addTerm(Long glossaryId, AddTermRequest request) throws HttpException, HttpBadRequestException {
TermResponseObject termResponseObject = this.httpClient.post(this.url + "/glossaries/" + glossaryId + "/terms", request, new HttpRequestConfig(), TermResponseObject.class);
return ResponseObject.of(termResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @param languageId language identifier
* @param conceptId concept identifier
* @param translationOfTermId translationOfTerm identifier
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.deleteMany" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.terms.deleteMany" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public void clearGlossary(Long glossaryId, String languageId, Long conceptId, @Deprecated Long translationOfTermId) throws HttpException, HttpBadRequestException {
Map<String, Optional<Object>> queryParams = HttpRequestConfig.buildUrlParams(
"languageId", Optional.ofNullable(languageId),
"conceptId", Optional.ofNullable(conceptId),
"translationOfTermId", Optional.ofNullable(translationOfTermId)
);
this.httpClient.delete(this.url + "/glossaries/" + glossaryId + "/terms", new HttpRequestConfig(queryParams), Void.class);
}
/**
* @param glossaryId glossary identifier
* @param termId term identifier
* @return term
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.get" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.terms.get" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<Term> getTerm(Long glossaryId, Long termId) throws HttpException, HttpBadRequestException {
TermResponseObject termResponseObject = this.httpClient.get(this.url + "/glossaries/" + glossaryId + "/terms/" + termId, new HttpRequestConfig(), TermResponseObject.class);
return ResponseObject.of(termResponseObject.getData());
}
/**
* @param glossaryId glossary identifier
* @param termId term identifier
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.delete" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.terms.delete" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public void deleteTerm(Long glossaryId, Long termId) throws HttpException, HttpBadRequestException {
this.httpClient.delete(this.url + "/glossaries/" + glossaryId + "/terms/" + termId, new HttpRequestConfig(), Void.class);
}
/**
* @param glossaryId glossary identifier
* @param termId term identifier
* @param request request object
* @return updated term
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.patch" target="_blank"><b>API Documentation</b></a></li>
* <li><a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.terms.patch" target="_blank"><b>Enterprise API Documentation</b></a></li>
* </ul>
*/
public ResponseObject<Term> editTerm(Long glossaryId, Long termId, List<PatchRequest> request) throws HttpException, HttpBadRequestException {
TermResponseObject termResponseObject = this.httpClient.patch(this.url + "/glossaries/" + glossaryId + "/terms/" + termId, request, new HttpRequestConfig(), TermResponseObject.class);
return ResponseObject.of(termResponseObject.getData());
}
}