@@ -190,10 +190,10 @@ public async Task<GlossaryImportStatus> CheckGlossaryImportStatus(int glossaryId
190190 [ PublicAPI ]
191191 public Task < ResponseList < Term > > ListTerms (
192192 int glossaryId , int ? userId = null , string ? languageId = null ,
193- int ? translationOfTermId = null , int limit = 25 , int offset = 0 )
193+ int ? translationOfTermId = null , int ? conceptId = null , int limit = 25 , int offset = 0 )
194194 {
195195 return ListTerms ( glossaryId ,
196- new TermsListParams ( limit , offset , userId , languageId , translationOfTermId ) ) ;
196+ new TermsListParams ( limit , offset , userId , languageId , translationOfTermId , conceptId ) ) ;
197197 }
198198
199199 /// <summary>
@@ -228,12 +228,15 @@ public async Task<Term> AddTerm(int glossaryId, AddTermRequest request)
228228 /// <a href="https://support.crowdin.com/enterprise/api/#operation/api.glossaries.terms.deleteMany">Crowdin Enterprise API</a>
229229 /// </summary>
230230 [ PublicAPI ]
231- public async Task ClearGlossary ( int glossaryId , string ? languageId = null , int ? translationOfTermId = null )
231+ public async Task ClearGlossary (
232+ int glossaryId , string ? languageId = null ,
233+ int ? conceptId = null , int ? translationOfTermId = null )
232234 {
233235 string url = FormUrl_Terms ( glossaryId ) ;
234236
235237 var queryParams = new Dictionary < string , string > ( ) ;
236238 queryParams . AddParamIfPresent ( "languageId" , languageId ) ;
239+ queryParams . AddParamIfPresent ( "conceptId" , conceptId ) ;
237240 queryParams . AddParamIfPresent ( "translationOfTermId" , translationOfTermId ) ;
238241
239242 HttpStatusCode statusCode = await _apiClient . SendDeleteRequest ( url , queryParams ) ;
@@ -279,6 +282,64 @@ public async Task<Term> EditTerm(int glossaryId, int termId, IEnumerable<TermPat
279282 return _jsonParser . ParseResponseObject < Term > ( result . JsonObject ) ;
280283 }
281284
285+ #endregion
286+
287+ #region Concepts
288+
289+ /// <summary>
290+ /// List terms. Documentation:
291+ /// <a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.getMany">Crowdin API</a>
292+ /// <a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.concepts.getMany">Crowdin Enterprise API</a>
293+ /// </summary>
294+ [ PublicAPI ]
295+ public async Task < ResponseList < Concept > > ListConcepts ( int glossaryId , int limit = 25 , int offset = 0 )
296+ {
297+ string url = FormUrl_Concepts ( glossaryId ) ;
298+ IDictionary < string , string > queryParams = Utils . CreateQueryParamsFromPaging ( limit , offset ) ;
299+
300+ CrowdinApiResult result = await _apiClient . SendGetRequest ( url , queryParams ) ;
301+ return _jsonParser . ParseResponseList < Concept > ( result . JsonObject ) ;
302+ }
303+
304+ /// <summary>
305+ /// List terms. Documentation:
306+ /// <a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.get">Crowdin API</a>
307+ /// <a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.concepts.get">Crowdin Enterprise API</a>
308+ /// </summary>
309+ [ PublicAPI ]
310+ public async Task < Concept > GetConcept ( int glossaryId , int conceptId )
311+ {
312+ string url = FormUrl_ConceptId ( glossaryId , conceptId ) ;
313+ CrowdinApiResult result = await _apiClient . SendGetRequest ( url ) ;
314+ return _jsonParser . ParseResponseObject < Concept > ( result . JsonObject ) ;
315+ }
316+
317+ /// <summary>
318+ /// List terms. Documentation:
319+ /// <a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.put">Crowdin API</a>
320+ /// <a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.concepts.put">Crowdin Enterprise API</a>
321+ /// </summary>
322+ [ PublicAPI ]
323+ public async Task < Concept > UpdateConcept ( int glossaryId , int conceptId , UpdateConceptRequest request )
324+ {
325+ string url = FormUrl_ConceptId ( glossaryId , conceptId ) ;
326+ CrowdinApiResult result = await _apiClient . SendPutRequest ( url , request ) ;
327+ return _jsonParser . ParseResponseObject < Concept > ( result . JsonObject ) ;
328+ }
329+
330+ /// <summary>
331+ /// List terms. Documentation:
332+ /// <a href="https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.delete">Crowdin API</a>
333+ /// <a href="https://developer.crowdin.com/enterprise/api/v2/#operation/api.glossaries.concepts.delete">Crowdin Enterprise API</a>
334+ /// </summary>
335+ [ PublicAPI ]
336+ public async Task DeleteConcept ( int glossaryId , int conceptId )
337+ {
338+ string url = FormUrl_ConceptId ( glossaryId , conceptId ) ;
339+ HttpStatusCode statusCode = await _apiClient . SendDeleteRequest ( url ) ;
340+ Utils . ThrowIfStatusNot204 ( statusCode , $ "Concept { conceptId } removal failed") ;
341+ }
342+
282343 #endregion
283344
284345 #region Helper methods
@@ -298,6 +359,16 @@ private static string FormUrl_TermId(int glossaryId, int termId)
298359 return $ "{ BaseUrl } /{ glossaryId } /terms/{ termId } ";
299360 }
300361
362+ private static string FormUrl_Concepts ( int glossaryId )
363+ {
364+ return $ "{ BaseUrl } /{ glossaryId } /concepts";
365+ }
366+
367+ private static string FormUrl_ConceptId ( int glossaryId , int conceptId )
368+ {
369+ return $ "{ BaseUrl } /{ glossaryId } /concepts/{ conceptId } ";
370+ }
371+
301372 #endregion
302373 }
303374}
0 commit comments